From 7e4b799899f7bb2ab8b7923ffed72be23afb32d8 Mon Sep 17 00:00:00 2001 From: b1rdhous3 Date: Sat, 20 Aug 2016 17:25:39 +0200 Subject: [PATCH 001/133] Minor Bugfix in German translation (#190) * Example JSON Form Example with General setting I have created a new Category "General" with several Settings for Hyperion. For now the Submit Button only console.log's the values. Known Bug: For some reason it seems to do not load the bootstrap correctly or maybe the Lib isn't compatible with the newest version of bootstrap. * Translationsupport for JSON Forms * Hotfix * Added Bootstrap Switches for all checkboxes All checkboxes will be converted to Switches * Minor Bugfix in German translation --- assets/webconfig/lang/de.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/webconfig/lang/de.json b/assets/webconfig/lang/de.json index d0b50a38..1696a585 100644 --- a/assets/webconfig/lang/de.json +++ b/assets/webconfig/lang/de.json @@ -63,7 +63,7 @@ "update_label_description" : "Beschreibung:", "update_button_install" : "Installieren", "update_button_changelog" : "Zeige Änderungsprotokoll", - "update_label_type" : "Art:" + "update_label_type" : "Art:", "remote_general_conf_intro" : "Hier kannst du allgemeine Einstellungen von Hyperion vornehmen.", "generalConfForm_jsonform-0-elt-logger.level" : "Stufe Logging", "generalConfForm_jsonform-0-elt-jsonServer.port" : "Port", From 44c5cd48cd91d555dd625d86ef059825be9f88e5 Mon Sep 17 00:00:00 2001 From: brindosch Date: Sat, 20 Aug 2016 17:49:40 +0200 Subject: [PATCH 002/133] Update de.json --- assets/webconfig/lang/de.json | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/webconfig/lang/de.json b/assets/webconfig/lang/de.json index 1696a585..9d868d3d 100644 --- a/assets/webconfig/lang/de.json +++ b/assets/webconfig/lang/de.json @@ -25,6 +25,7 @@ "main_menu_effects_token" : "Effekte", "main_menu_support_token" : "Hilfe", "main_menu_update_token" : "Update", + "main_menu_system_token" : "System", "main_menu_general_conf_token":"Allgemein", "remote_colors_label_color":"Farbe: ", "remote_colors_button_reset":"Farbe zurücksetzen", From 27eb314b1ca77f9660ecfac57cc2550518820535 Mon Sep 17 00:00:00 2001 From: brindosch Date: Sat, 20 Aug 2016 19:06:19 +0200 Subject: [PATCH 003/133] Update hyperion.css --- assets/webconfig/css/hyperion.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/assets/webconfig/css/hyperion.css b/assets/webconfig/css/hyperion.css index 5b8aeeae..97ef4b98 100644 --- a/assets/webconfig/css/hyperion.css +++ b/assets/webconfig/css/hyperion.css @@ -5,6 +5,8 @@ url("../fonts/Roboto-Regular.ttf") format('ttf'); } body{font-family:Roboto,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:15px;} +/*remove padding on all col elements for mobile view*/ +@media (max-width: 767px){div[class*="col-"] {padding:0;}} /*icon spacing*/ .fa-fw{margin-right:5px;} From c8318ff0c78016629b7ae0babc7a75cbed649505 Mon Sep 17 00:00:00 2001 From: penfold42 Date: Sun, 21 Aug 2016 06:39:21 +1000 Subject: [PATCH 004/133] support > 170 leds with E1.31 (#189) * Add support for > 170 leds. These are send as multiple packets Change default latchtime to be smaller * code cleanup * more code tidying added *.swp to gitignore --- .gitignore | 1 + libsrc/leddevice/LedDeviceFactory.cpp | 2 +- libsrc/leddevice/LedDeviceUdpE131.cpp | 69 ++++++++++++++++++++------- libsrc/leddevice/LedDeviceUdpE131.h | 4 +- 4 files changed, 56 insertions(+), 20 deletions(-) diff --git a/.gitignore b/.gitignore index 94dab4e2..11c9c013 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +*.swp /*.user /build* .DS_Store diff --git a/libsrc/leddevice/LedDeviceFactory.cpp b/libsrc/leddevice/LedDeviceFactory.cpp index cb733a44..3257904e 100755 --- a/libsrc/leddevice/LedDeviceFactory.cpp +++ b/libsrc/leddevice/LedDeviceFactory.cpp @@ -284,7 +284,7 @@ LedDevice * LedDeviceFactory::construct(const Json::Value & deviceConfig) { device = new LedDeviceUdpE131( deviceConfig["output"].asString(), - deviceConfig.get("latchtime",500000).asInt(), + deviceConfig.get("latchtime",104000).asInt(), deviceConfig.get("universe",1).asInt() ); } diff --git a/libsrc/leddevice/LedDeviceUdpE131.cpp b/libsrc/leddevice/LedDeviceUdpE131.cpp index dbd6744b..813a7382 100644 --- a/libsrc/leddevice/LedDeviceUdpE131.cpp +++ b/libsrc/leddevice/LedDeviceUdpE131.cpp @@ -23,52 +23,85 @@ LedDeviceUdpE131::LedDeviceUdpE131(const std::string& outputDevice, const unsign #define CID "hyperion!\0" #define SOURCE_NAME "hyperion on hostname\0" -int LedDeviceUdpE131::write(const std::vector &ledValues) +// populates the headers +void LedDeviceUdpE131::prepare(const unsigned this_universe, const unsigned this_dmxChannelCount) { - _ledCount = ledValues.size(); - int _dmxChannelCount = 3 * std::min(_ledCount,170); // DMX512 has max 512 channels == 170 RGB leds - memset(e131_packet.raw, 0, sizeof(e131_packet.raw)); /* Root Layer */ e131_packet.preamble_size = htons(16); e131_packet.postamble_size = 0; memcpy (e131_packet.acn_id, _acn_id, 12); - e131_packet.root_flength = htons(0x7000 | (110+_dmxChannelCount) ); + e131_packet.root_flength = htons(0x7000 | (110+this_dmxChannelCount) ); e131_packet.root_vector = htonl(VECTOR_ROOT_E131_DATA); memcpy (e131_packet.cid, CID, sizeof(CID) ); /* Frame Layer */ - e131_packet.frame_flength = htons(0x7000 | (88+_dmxChannelCount)); + e131_packet.frame_flength = htons(0x7000 | (88+this_dmxChannelCount)); e131_packet.frame_vector = htonl(VECTOR_E131_DATA_PACKET); memcpy (e131_packet.source_name, SOURCE_NAME, sizeof(SOURCE_NAME)); e131_packet.priority = 100; e131_packet.reserved = htons(0); - e131_packet.sequence_number = _e131_seq++; e131_packet.options = 0; // Bit 7 = Preview_Data // Bit 6 = Stream_Terminated // Bit 5 = Force_Synchronization - e131_packet.universe = htons(_e131_universe); - + e131_packet.universe = htons(this_universe); /* DMX Layer */ - e131_packet.dmp_flength = htons(0x7000 | (11+_dmxChannelCount)); + e131_packet.dmp_flength = htons(0x7000 | (11+this_dmxChannelCount)); e131_packet.dmp_vector = VECTOR_DMP_SET_PROPERTY; e131_packet.type = 0xa1; e131_packet.first_address = htons(0); e131_packet.address_increment = htons(1); - e131_packet.property_value_count = htons(1+_dmxChannelCount); + e131_packet.property_value_count = htons(1+this_dmxChannelCount); - int led_idx=0; e131_packet.property_values[0] = 0; // start code - for (int _dmxIdx=1; _dmxIdx <= _dmxChannelCount; ) +} + +int LedDeviceUdpE131::write(const std::vector &ledValues) +{ + int retVal = 0; + + int _thisChannelCount = 0; + + _e131_seq++; + + const uint8_t * rawdata = reinterpret_cast(ledValues.data()); + + _ledCount = ledValues.size(); + + int _dmxChannelCount = 3 * _ledCount; + + for (int rawIdx = 0; rawIdx < _dmxChannelCount; rawIdx++) { - e131_packet.property_values[_dmxIdx++] = ledValues[led_idx].red; - e131_packet.property_values[_dmxIdx++] = ledValues[led_idx].green; - e131_packet.property_values[_dmxIdx++] = ledValues[led_idx].blue; - led_idx ++; + if (rawIdx % DMX_MAX == 0) // start of new packet + { + _thisChannelCount = (_dmxChannelCount - rawIdx < DMX_MAX) ? _dmxChannelCount % DMX_MAX : DMX_MAX; +// is this the last packet? ? ^^ last packet : ^^ earlier packets + + prepare(_e131_universe + rawIdx / DMX_MAX, _thisChannelCount); + e131_packet.sequence_number = _e131_seq; + } + + e131_packet.property_values[1 + rawIdx%DMX_MAX] = rawdata[rawIdx]; + +// is this the last byte of last packet || last byte of other packets + if ( (rawIdx == _dmxChannelCount-1) || (rawIdx %DMX_MAX == DMX_MAX-1) ) + { +#undef e131debug +#if e131debug + printf ( "send packet: rawidx %d dmxchannelcount %d universe: %d, packetsz %d\n" + , rawIdx + , _dmxChannelCount + , _e131_universe + rawIdx / DMX_MAX + , E131_DMP_DATA + 1 + _thisChannelCount + ); +#endif + retVal &= writeBytes(E131_DMP_DATA + 1 + _thisChannelCount, e131_packet.raw); + } } - return writeBytes(E131_DMP_DATA + 1 + _dmxChannelCount, e131_packet.raw); + + return retVal; } int LedDeviceUdpE131::switchOff() diff --git a/libsrc/leddevice/LedDeviceUdpE131.h b/libsrc/leddevice/LedDeviceUdpE131.h index 783cb76d..01a6c04f 100644 --- a/libsrc/leddevice/LedDeviceUdpE131.h +++ b/libsrc/leddevice/LedDeviceUdpE131.h @@ -91,7 +91,7 @@ typedef union { #define E131_E131_UNIVERSE_DISCOVERY_INTERVAL 10 // seconds #define E131_NETWORK_DATA_LOSS_TIMEOUT 2500 // milli econds #define E131_DISCOVERY_UNIVERSE 64214 - +#define DMX_MAX 512 // 512 usable slots /// /// Implementation of the LedDevice interface for sending led colors via udp/E1.31 packets @@ -121,6 +121,8 @@ public: virtual int switchOff(); private: + void prepare(const unsigned this_universe, const unsigned this_dmxChannelCount); + e131_packet_t e131_packet; uint8_t _e131_seq = 0; uint8_t _e131_universe = 1; From 6acf68c87ed3e5a4c6c83dd4d204495601790c7c Mon Sep 17 00:00:00 2001 From: Paulchen-Panther Date: Mon, 22 Aug 2016 11:59:07 +0200 Subject: [PATCH 005/133] Update X11 Grabber (scaling improvements) (#191) * Add transform Matrix for scaling * Add Image scaling by XRender * Coding Style correction --- include/grabber/X11Grabber.h | 4 + libsrc/grabber/x11/X11Grabber.cpp | 266 ++++++++++++++++++++---------- 2 files changed, 185 insertions(+), 85 deletions(-) diff --git a/include/grabber/X11Grabber.h b/include/grabber/X11Grabber.h index 1aafe1f8..e026bab2 100755 --- a/include/grabber/X11Grabber.h +++ b/include/grabber/X11Grabber.h @@ -72,6 +72,10 @@ private: XRenderPictureAttributes _pictAttr; Picture _srcPicture; Picture _dstPicture; + + XTransform _transform; + int _horizontalDecimation; + int _verticalDecimation; unsigned _screenWidth; unsigned _screenHeight; diff --git a/libsrc/grabber/x11/X11Grabber.cpp b/libsrc/grabber/x11/X11Grabber.cpp index 8fea47b0..e7066e9a 100755 --- a/libsrc/grabber/x11/X11Grabber.cpp +++ b/libsrc/grabber/x11/X11Grabber.cpp @@ -6,29 +6,29 @@ // X11Grabber includes #include -X11Grabber::X11Grabber(bool useXGetImage, int cropLeft, int cropRight, int cropTop, int cropBottom, int horizontalPixelDecimation, int verticalPixelDecimation) : - _imageResampler(), - _useXGetImage(useXGetImage), - _cropLeft(cropLeft), - _cropRight(cropRight), - _cropTop(cropTop), - _cropBottom(cropBottom), - _x11Display(nullptr), - _pixmap(None), - _srcFormat(nullptr), - _dstFormat(nullptr), - _srcPicture(None), - _dstPicture(None), - _screenWidth(0), - _screenHeight(0), - _croppedWidth(0), - _croppedHeight(0), - _image(0,0), - _log(Logger::getInstance("X11GRABBER")) +X11Grabber::X11Grabber(bool useXGetImage, int cropLeft, int cropRight, int cropTop, int cropBottom, int horizontalPixelDecimation, int verticalPixelDecimation) + : _imageResampler() + , _useXGetImage(useXGetImage) + , _cropLeft(cropLeft) + , _cropRight(cropRight) + , _cropTop(cropTop) + , _cropBottom(cropBottom) + , _x11Display(nullptr) + , _pixmap(None) + , _srcFormat(nullptr) + , _dstFormat(nullptr) + , _srcPicture(None) + , _dstPicture(None) + , _horizontalDecimation(horizontalPixelDecimation) + , _verticalDecimation(verticalPixelDecimation) + , _screenWidth(0) + , _screenHeight(0) + , _croppedWidth(0) + , _croppedHeight(0) + , _image(0,0) + , _log(Logger::getInstance("X11GRABBER")) { - _imageResampler.setHorizontalPixelDecimation(horizontalPixelDecimation); - _imageResampler.setVerticalPixelDecimation(verticalPixelDecimation); - _imageResampler.setCropping(0, 0, 0, 0); // cropping is performed by XShmGetImage or XGetImage + _imageResampler.setCropping(0, 0, 0, 0); // cropping is performed by XRender, XShmGetImage or XGetImage memset(&_pictAttr, 0, sizeof(_pictAttr)); _pictAttr.repeat = RepeatNone; } @@ -51,12 +51,14 @@ void X11Grabber::freeResources() { // Cleanup allocated resources of the X11 grab XDestroyImage(_xImage); - if(_XShmAvailable && !_useXGetImage) { + if(_XShmAvailable && !_useXGetImage) + { XShmDetach(_x11Display, &_shminfo); shmdt(_shminfo.shmaddr); shmctl(_shminfo.shmid, IPC_RMID, 0); } - if (_XRenderAvailable && !_useXGetImage) { + if (_XRenderAvailable && !_useXGetImage) + { XRenderFreePicture(_x11Display, _srcPicture); XRenderFreePicture(_x11Display, _dstPicture); XFreePixmap(_x11Display, _pixmap); @@ -65,29 +67,31 @@ void X11Grabber::freeResources() void X11Grabber::setupResources() { - if(_XShmAvailable && !_useXGetImage) { + if(_XShmAvailable && !_useXGetImage) + { _xImage = XShmCreateImage(_x11Display, _windowAttr.visual, _windowAttr.depth, ZPixmap, NULL, &_shminfo, _croppedWidth, _croppedHeight); - _shminfo.shmid = shmget(IPC_PRIVATE, _xImage->bytes_per_line * _xImage->height, IPC_CREAT|0777); _xImage->data = (char*)shmat(_shminfo.shmid,0,0); _shminfo.shmaddr = _xImage->data; _shminfo.readOnly = False; - - XShmAttach(_x11Display, &_shminfo); + XShmAttach(_x11Display, &_shminfo); } - if (_XRenderAvailable && !_useXGetImage) { - if(_XShmPixmapAvailable) { + if (_XRenderAvailable && !_useXGetImage) + { + if(_XShmPixmapAvailable) + { _pixmap = XShmCreatePixmap(_x11Display, _window, _xImage->data, &_shminfo, _croppedWidth, _croppedHeight, _windowAttr.depth); - } else { + } + else + { _pixmap = XCreatePixmap(_x11Display, _window, _croppedWidth, _croppedHeight, _windowAttr.depth); } _srcFormat = XRenderFindVisualFormat(_x11Display, _windowAttr.visual); _dstFormat = XRenderFindVisualFormat(_x11Display, _windowAttr.visual); _srcPicture = XRenderCreatePicture(_x11Display, _window, _srcFormat, CPRepeat, &_pictAttr); _dstPicture = XRenderCreatePicture(_x11Display, _pixmap, _dstFormat, CPRepeat, &_pictAttr); - XRenderSetPictureFilter(_x11Display, _srcPicture, "bilinear", NULL, 0); } } @@ -97,9 +101,12 @@ bool X11Grabber::Setup() if (_x11Display == nullptr) { Error(_log, "Unable to open display"); - if (getenv("DISPLAY")) { + if (getenv("DISPLAY")) + { Error(_log, "%s",getenv("DISPLAY")); - } else { + } + else + { Error(_log, "DISPLAY environment variable not set"); } return false; @@ -113,6 +120,10 @@ bool X11Grabber::Setup() _XShmAvailable = XShmQueryExtension(_x11Display); XShmQueryVersion(_x11Display, &dummy, &dummy, &pixmaps_supported); _XShmPixmapAvailable = pixmaps_supported && XShmPixmapFormat(_x11Display) == ZPixmap; + + // Image scaling is performed by XRender when available, otherwise by ImageResampler + _imageResampler.setHorizontalPixelDecimation(_XRenderAvailable ? 1 : _horizontalDecimation); + _imageResampler.setVerticalPixelDecimation(_XRenderAvailable ? 1 : _verticalDecimation); return true; } @@ -121,32 +132,68 @@ Image & X11Grabber::grab() { updateScreenDimensions(); - if (_XRenderAvailable && !_useXGetImage) { - XRenderComposite( _x11Display, // *dpy, - PictOpSrc, // op, - _srcPicture, // src - None, // mask - _dstPicture, // dst - _cropLeft, // src_x - _cropTop, // src_y - 0, // mask_x - 0, // mask_y - 0, // dst_x - 0, // dst_y - _croppedWidth, // width - _croppedHeight); // height - + if (_XRenderAvailable && !_useXGetImage) + { + double scale_x = static_cast(_windowAttr.width / _horizontalDecimation) / static_cast(_windowAttr.width); + double scale_y = static_cast(_windowAttr.height / _verticalDecimation) / static_cast(_windowAttr.height); + double scale = std::min(scale_y, scale_x); + + _transform = + { + { + { + XDoubleToFixed(1), + XDoubleToFixed(0), + XDoubleToFixed(0) + }, + { + XDoubleToFixed(0), + XDoubleToFixed(1), + XDoubleToFixed(0) + }, + { + XDoubleToFixed(0), + XDoubleToFixed(0), + XDoubleToFixed(scale) + } + } + }; + + XRenderSetPictureTransform (_x11Display, _srcPicture, &_transform); + XRenderSetPictureFilter(_x11Display, _srcPicture, FilterBilinear, NULL, 0); + + XRenderComposite( _x11Display, // dpy + PictOpSrc, // op + _srcPicture, // src + None, // mask + _dstPicture, // dst + _cropLeft / _horizontalDecimation, // src_x _cropLeft + _cropTop / _verticalDecimation, // src_y _cropTop + 0, // mask_x + 0, // mask_y + 0, // dst_x + 0, // dst_y + _croppedWidth, // width + _croppedHeight); // height + XSync(_x11Display, False); - - if (_XShmAvailable) { + + if (!_XShmAvailable) + { XShmGetImage(_x11Display, _pixmap, _xImage, 0, 0, AllPlanes); - } else { + } + else + { _xImage = XGetImage(_x11Display, _pixmap, 0, 0, _croppedWidth, _croppedHeight, AllPlanes, ZPixmap); } - } else { + } + else + { if (_XShmAvailable && !_useXGetImage) { XShmGetImage(_x11Display, _window, _xImage, _cropLeft, _cropTop, AllPlanes); - } else { + } + else + { _xImage = XGetImage(_x11Display, _window, _cropLeft, _cropTop, _croppedWidth, _croppedHeight, AllPlanes, ZPixmap); } } @@ -164,32 +211,68 @@ Image & X11Grabber::grab() int X11Grabber::grabFrame(Image & image) { - if (_XRenderAvailable && !_useXGetImage) { - XRenderComposite( _x11Display, // *dpy, - PictOpSrc, // op, - _srcPicture, // src - None, // mask - _dstPicture, // dst - _cropLeft, // src_x - _cropTop, // src_y - 0, // mask_x - 0, // mask_y - 0, // dst_x - 0, // dst_y - _croppedWidth, // width - _croppedHeight); // height - + if (_XRenderAvailable && !_useXGetImage) + { + double scale_x = static_cast(_windowAttr.width / _horizontalDecimation) / static_cast(_windowAttr.width); + double scale_y = static_cast(_windowAttr.height / _verticalDecimation) / static_cast(_windowAttr.height); + double scale = std::min(scale_y, scale_x); + + _transform = + { + { + { + XDoubleToFixed(1), + XDoubleToFixed(0), + XDoubleToFixed(0) + }, + { + XDoubleToFixed(0), + XDoubleToFixed(1), + XDoubleToFixed(0) + }, + { + XDoubleToFixed(0), + XDoubleToFixed(0), + XDoubleToFixed(scale) + } + } + }; + + XRenderSetPictureTransform (_x11Display, _srcPicture, &_transform); + XRenderSetPictureFilter(_x11Display, _srcPicture, FilterBilinear, NULL, 0); + + XRenderComposite( _x11Display, // dpy + PictOpSrc, // op + _srcPicture, // src + None, // mask + _dstPicture, // dst + _cropLeft / _horizontalDecimation, // src_x _cropLeft + _cropTop / _verticalDecimation, // src_y _cropTop + 0, // mask_x + 0, // mask_y + 0, // dst_x + 0, // dst_y + _croppedWidth, // width + _croppedHeight); // height + XSync(_x11Display, False); - - if (_XShmAvailable) { + + if (!_XShmAvailable) + { XShmGetImage(_x11Display, _pixmap, _xImage, 0, 0, AllPlanes); - } else { + } + else + { _xImage = XGetImage(_x11Display, _pixmap, 0, 0, _croppedWidth, _croppedHeight, AllPlanes, ZPixmap); } - } else { + } + else + { if (_XShmAvailable && !_useXGetImage) { XShmGetImage(_x11Display, _window, _xImage, _cropLeft, _cropTop, AllPlanes); - } else { + } + else + { _xImage = XGetImage(_x11Display, _window, _cropLeft, _cropTop, _croppedWidth, _croppedHeight, AllPlanes, ZPixmap); } } @@ -220,7 +303,8 @@ int X11Grabber::updateScreenDimensions() return 0; } - if (_screenWidth || _screenHeight) { + if (_screenWidth || _screenHeight) + { freeResources(); } @@ -228,17 +312,29 @@ int X11Grabber::updateScreenDimensions() _screenWidth = _windowAttr.width; _screenHeight = _windowAttr.height; - _croppedWidth = (_screenWidth > unsigned(_cropLeft + _cropRight)) - ? (_screenWidth - _cropLeft - _cropRight) - : _screenWidth; - - _croppedHeight = (_screenHeight > unsigned(_cropTop + _cropBottom)) - ? (_screenHeight - _cropTop - _cropBottom) - : _screenHeight; - - if (_XRenderAvailable && !_useXGetImage) { + // Image scaling is performed by XRender when available, otherwise by ImageResampler + if (_XRenderAvailable && !_useXGetImage) + { + _croppedWidth = (_screenWidth > unsigned(_cropLeft + _cropRight)) + ? ((_screenWidth - _cropLeft - _cropRight) / _horizontalDecimation) + : _screenWidth / _horizontalDecimation; + + _croppedHeight = (_screenHeight > unsigned(_cropTop + _cropBottom)) + ? ((_screenHeight - _cropTop - _cropBottom) / _verticalDecimation) + : _screenHeight / _verticalDecimation; + Info(_log, "Using XRender for grabbing"); - } else { + } + else + { + _croppedWidth = (_screenWidth > unsigned(_cropLeft + _cropRight)) + ? (_screenWidth - _cropLeft - _cropRight) + : _screenWidth; + + _croppedHeight = (_screenHeight > unsigned(_cropTop + _cropBottom)) + ? (_screenHeight - _cropTop - _cropBottom) + : _screenHeight; + Info(_log, "Using XGetImage for grabbing"); } From 62a24348f962372aa62f71f387c4197befced31f Mon Sep 17 00:00:00 2001 From: Paulchen-Panther Date: Tue, 23 Aug 2016 07:04:57 +0200 Subject: [PATCH 006/133] Fix "if" statement in XShmGetImage check and other things (#192) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix "if" statement Nach dem testen des Codes, leider übersehen und nicht rückgängig gemacht. Entschuldigung. * Move XRenderSetPictureFilter from "grab" to "setupResources" part * Resize destination image to target screen dimension once * Fix coding style and add check for image resize --- libsrc/grabber/x11/X11Grabber.cpp | 8 +-- libsrc/utils/ImageResampler.cpp | 115 +++++++++++++++--------------- 2 files changed, 62 insertions(+), 61 deletions(-) diff --git a/libsrc/grabber/x11/X11Grabber.cpp b/libsrc/grabber/x11/X11Grabber.cpp index e7066e9a..feae804b 100755 --- a/libsrc/grabber/x11/X11Grabber.cpp +++ b/libsrc/grabber/x11/X11Grabber.cpp @@ -92,6 +92,7 @@ void X11Grabber::setupResources() _dstFormat = XRenderFindVisualFormat(_x11Display, _windowAttr.visual); _srcPicture = XRenderCreatePicture(_x11Display, _window, _srcFormat, CPRepeat, &_pictAttr); _dstPicture = XRenderCreatePicture(_x11Display, _pixmap, _dstFormat, CPRepeat, &_pictAttr); + XRenderSetPictureFilter(_x11Display, _srcPicture, FilterBilinear, NULL, 0); } } @@ -160,7 +161,6 @@ Image & X11Grabber::grab() }; XRenderSetPictureTransform (_x11Display, _srcPicture, &_transform); - XRenderSetPictureFilter(_x11Display, _srcPicture, FilterBilinear, NULL, 0); XRenderComposite( _x11Display, // dpy PictOpSrc, // op @@ -178,7 +178,7 @@ Image & X11Grabber::grab() XSync(_x11Display, False); - if (!_XShmAvailable) + if (_XShmAvailable) { XShmGetImage(_x11Display, _pixmap, _xImage, 0, 0, AllPlanes); } @@ -239,7 +239,6 @@ int X11Grabber::grabFrame(Image & image) }; XRenderSetPictureTransform (_x11Display, _srcPicture, &_transform); - XRenderSetPictureFilter(_x11Display, _srcPicture, FilterBilinear, NULL, 0); XRenderComposite( _x11Display, // dpy PictOpSrc, // op @@ -257,7 +256,7 @@ int X11Grabber::grabFrame(Image & image) XSync(_x11Display, False); - if (!_XShmAvailable) + if (_XShmAvailable) { XShmGetImage(_x11Display, _pixmap, _xImage, 0, 0, AllPlanes); } @@ -338,6 +337,7 @@ int X11Grabber::updateScreenDimensions() Info(_log, "Using XGetImage for grabbing"); } + _image.resize(_croppedWidth, _croppedHeight); setupResources(); return 1; diff --git a/libsrc/utils/ImageResampler.cpp b/libsrc/utils/ImageResampler.cpp index 0e17101c..d8df181c 100755 --- a/libsrc/utils/ImageResampler.cpp +++ b/libsrc/utils/ImageResampler.cpp @@ -1,14 +1,14 @@ #include "utils/ImageResampler.h" #include -ImageResampler::ImageResampler() : - _horizontalDecimation(1), - _verticalDecimation(1), - _cropLeft(0), - _cropRight(0), - _cropTop(0), - _cropBottom(0), - _videoMode(VIDEO_2D) +ImageResampler::ImageResampler() + : _horizontalDecimation(1) + , _verticalDecimation(1) + , _cropLeft(0) + , _cropRight(0) + , _cropTop(0) + , _cropBottom(0) + , _videoMode(VIDEO_2D) { } @@ -25,15 +25,15 @@ void ImageResampler::setHorizontalPixelDecimation(int decimator) void ImageResampler::setVerticalPixelDecimation(int decimator) { - _verticalDecimation = decimator; + _verticalDecimation = decimator; } void ImageResampler::setCropping(int cropLeft, int cropRight, int cropTop, int cropBottom) { - _cropLeft = cropLeft; - _cropRight = cropRight; - _cropTop = cropTop; - _cropBottom = cropBottom; + _cropLeft = cropLeft; + _cropRight = cropRight; + _cropTop = cropTop; + _cropBottom = cropBottom; } void ImageResampler::set3D(VideoMode mode) @@ -62,70 +62,71 @@ void ImageResampler::processImage(const uint8_t * data, int width, int height, i } // calculate the output size - int outputWidth = (width - cropLeft - cropRight - _horizontalDecimation/2 + _horizontalDecimation - 1) / _horizontalDecimation; - int outputHeight = (height - cropTop - cropBottom - _verticalDecimation/2 + _verticalDecimation - 1) / _verticalDecimation; - outputImage.resize(outputWidth, outputHeight); + int outputWidth = (width - cropLeft - cropRight - _horizontalDecimation/2 + _horizontalDecimation - 1) / _horizontalDecimation; + int outputHeight = (height - cropTop - cropBottom - _verticalDecimation/2 + _verticalDecimation - 1) / _verticalDecimation; + if ((outputImage.height() != unsigned(outputHeight)) && (outputImage.width() != unsigned(outputWidth))) + outputImage.resize(outputWidth, outputHeight); for (int yDest = 0, ySource = cropTop + _verticalDecimation/2; yDest < outputHeight; ySource += _verticalDecimation, ++yDest) { - for (int xDest = 0, xSource = cropLeft + _horizontalDecimation/2; xDest < outputWidth; xSource += _horizontalDecimation, ++xDest) + for (int xDest = 0, xSource = cropLeft + _horizontalDecimation/2; xDest < outputWidth; xSource += _horizontalDecimation, ++xDest) { ColorRgb & rgb = outputImage(xDest, yDest); - + switch (pixelFormat) { - case PIXELFORMAT_UYVY: + case PIXELFORMAT_UYVY: { - int index = lineLength * ySource + xSource * 2; + int index = lineLength * ySource + xSource * 2; uint8_t y = data[index+1]; uint8_t u = ((xSource&1) == 0) ? data[index ] : data[index-2]; uint8_t v = ((xSource&1) == 0) ? data[index+2] : data[index ]; yuv2rgb(y, u, v, rgb.red, rgb.green, rgb.blue); } break; - case PIXELFORMAT_YUYV: + case PIXELFORMAT_YUYV: { - int index = lineLength * ySource + xSource * 2; + int index = lineLength * ySource + xSource * 2; uint8_t y = data[index]; uint8_t u = ((xSource&1) == 0) ? data[index+1] : data[index-1]; uint8_t v = ((xSource&1) == 0) ? data[index+3] : data[index+1]; yuv2rgb(y, u, v, rgb.red, rgb.green, rgb.blue); } break; - case PIXELFORMAT_BGR16: - { - int index = lineLength * ySource + xSource * 2; - rgb.blue = (data[index] & 0x1f) << 3; - rgb.green = (((data[index+1] & 0x7) << 3) | (data[index] & 0xE0) >> 5) << 2; - rgb.red = (data[index+1] & 0xF8); - } - break; - case PIXELFORMAT_BGR24: - { - int index = lineLength * ySource + xSource * 3; - rgb.blue = data[index ]; - rgb.green = data[index+1]; - rgb.red = data[index+2]; - } - break; - case PIXELFORMAT_RGB32: - { - int index = lineLength * ySource + xSource * 4; - rgb.red = data[index ]; - rgb.green = data[index+1]; - rgb.blue = data[index+2]; - } - break; - case PIXELFORMAT_BGR32: - { - int index = lineLength * ySource + xSource * 4; - rgb.blue = data[index ]; - rgb.green = data[index+1]; - rgb.red = data[index+2]; - } - break; - case PIXELFORMAT_NO_CHANGE: - Error(Logger::getInstance("ImageResampler"), "Invalid pixel format given"); + case PIXELFORMAT_BGR16: + { + int index = lineLength * ySource + xSource * 2; + rgb.blue = (data[index] & 0x1f) << 3; + rgb.green = (((data[index+1] & 0x7) << 3) | (data[index] & 0xE0) >> 5) << 2; + rgb.red = (data[index+1] & 0xF8); + } + break; + case PIXELFORMAT_BGR24: + { + int index = lineLength * ySource + xSource * 3; + rgb.blue = data[index ]; + rgb.green = data[index+1]; + rgb.red = data[index+2]; + } + break; + case PIXELFORMAT_RGB32: + { + int index = lineLength * ySource + xSource * 4; + rgb.red = data[index ]; + rgb.green = data[index+1]; + rgb.blue = data[index+2]; + } + break; + case PIXELFORMAT_BGR32: + { + int index = lineLength * ySource + xSource * 4; + rgb.blue = data[index ]; + rgb.green = data[index+1]; + rgb.red = data[index+2]; + } + break; + case PIXELFORMAT_NO_CHANGE: + Error(Logger::getInstance("ImageResampler"), "Invalid pixel format given"); break; } } @@ -143,7 +144,7 @@ void ImageResampler::yuv2rgb(uint8_t y, uint8_t u, uint8_t v, uint8_t &r, uint8_ int c = y - 16; int d = u - 128; int e = v - 128; - + r = clamp((298 * c + 409 * e + 128) >> 8); g = clamp((298 * c - 100 * d - 208 * e + 128) >> 8); b = clamp((298 * c + 516 * d + 128) >> 8); From c207828069d5f16ef7c94c624c5fc092871bcabf Mon Sep 17 00:00:00 2001 From: b1rdhous3 Date: Tue, 23 Aug 2016 19:42:16 +0200 Subject: [PATCH 007/133] WebUI: Several File adjustments (#195) * Example JSON Form Example with General setting I have created a new Category "General" with several Settings for Hyperion. For now the Submit Button only console.log's the values. Known Bug: For some reason it seems to do not load the bootstrap correctly or maybe the Lib isn't compatible with the newest version of bootstrap. * Reorganize files --- .../webconfig/css/bootstrap-colorpicker.css | 222 ---- .../css/bootstrap-colorpicker.min.css | 10 + .../css/bootstrap-colorpicker.min.css.map | 1 + assets/webconfig/index.html | 27 +- assets/webconfig/js/bootstrap-colorpicker.js | 1106 ----------------- .../js/lib/bootstrap-colorpicker.min.js | 5 + .../js/{ => lib}/bootstrap-switch.min.js | 0 .../webconfig/js/{ => lib}/bootstrap.min.js | 0 assets/webconfig/js/{ => lib}/jquery-lang.js | 0 assets/webconfig/js/{ => lib}/jquery.min.js | 0 assets/webconfig/js/{ => lib}/js.cookie.js | 0 assets/webconfig/js/{ => lib}/jsonform.js | 0 .../webconfig/js/{ => lib}/metisMenu.min.js | 0 assets/webconfig/js/{ => lib}/sb-admin-2.js | 0 assets/webconfig/js/{ => lib}/underscore.js | 0 assets/webconfig/lighttest.html | 3 - 16 files changed, 32 insertions(+), 1342 deletions(-) delete mode 100644 assets/webconfig/css/bootstrap-colorpicker.css create mode 100644 assets/webconfig/css/bootstrap-colorpicker.min.css create mode 100644 assets/webconfig/css/bootstrap-colorpicker.min.css.map delete mode 100644 assets/webconfig/js/bootstrap-colorpicker.js create mode 100644 assets/webconfig/js/lib/bootstrap-colorpicker.min.js rename assets/webconfig/js/{ => lib}/bootstrap-switch.min.js (100%) rename assets/webconfig/js/{ => lib}/bootstrap.min.js (100%) rename assets/webconfig/js/{ => lib}/jquery-lang.js (100%) rename assets/webconfig/js/{ => lib}/jquery.min.js (100%) rename assets/webconfig/js/{ => lib}/js.cookie.js (100%) rename assets/webconfig/js/{ => lib}/jsonform.js (100%) rename assets/webconfig/js/{ => lib}/metisMenu.min.js (100%) rename assets/webconfig/js/{ => lib}/sb-admin-2.js (100%) rename assets/webconfig/js/{ => lib}/underscore.js (100%) diff --git a/assets/webconfig/css/bootstrap-colorpicker.css b/assets/webconfig/css/bootstrap-colorpicker.css deleted file mode 100644 index 74ed8970..00000000 --- a/assets/webconfig/css/bootstrap-colorpicker.css +++ /dev/null @@ -1,222 +0,0 @@ -/*! - * Bootstrap Colorpicker v2.3.3 - * http://mjolnic.github.io/bootstrap-colorpicker/ - * - * Originally written by (c) 2012 Stefan Petre - * Licensed under the Apache License v2.0 - * http://www.apache.org/licenses/LICENSE-2.0.txt - * - */ -.colorpicker-saturation { - width: 100px; - height: 100px; - background-image: url("../img/bootstrap-colorpicker/saturation.png"); - cursor: crosshair; - float: left; -} -.colorpicker-saturation i { - display: block; - height: 5px; - width: 5px; - border: 1px solid #000; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; - position: absolute; - top: 0; - left: 0; - margin: -4px 0 0 -4px; -} -.colorpicker-saturation i b { - display: block; - height: 5px; - width: 5px; - border: 1px solid #fff; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; -} -.colorpicker-hue, -.colorpicker-alpha { - width: 15px; - height: 100px; - float: left; - cursor: row-resize; - margin-left: 4px; - margin-bottom: 4px; -} -.colorpicker-hue i, -.colorpicker-alpha i { - display: block; - height: 1px; - background: #000; - border-top: 1px solid #fff; - position: absolute; - top: 0; - left: 0; - width: 100%; - margin-top: -1px; -} -.colorpicker-hue { - background-image: url("../img/bootstrap-colorpicker/hue.png"); -} -.colorpicker-alpha { - background-image: url("../img/bootstrap-colorpicker/alpha.png"); - display: none; -} -.colorpicker-saturation, -.colorpicker-hue, -.colorpicker-alpha { - background-size: contain; -} -.colorpicker { - padding: 4px; - min-width: 130px; - margin-top: 1px; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - z-index: 2500; -} -.colorpicker:before, -.colorpicker:after { - display: table; - content: ""; - line-height: 0; -} -.colorpicker:after { - clear: both; -} -.colorpicker:before { - content: ''; - display: inline-block; - border-left: 7px solid transparent; - border-right: 7px solid transparent; - border-bottom: 7px solid #ccc; - border-bottom-color: rgba(0, 0, 0, 0.2); - position: absolute; - top: -7px; - left: 6px; -} -.colorpicker:after { - content: ''; - display: inline-block; - border-left: 6px solid transparent; - border-right: 6px solid transparent; - border-bottom: 6px solid #ffffff; - position: absolute; - top: -6px; - left: 7px; -} -.colorpicker div { - position: relative; -} -.colorpicker.colorpicker-with-alpha { - min-width: 140px; -} -.colorpicker.colorpicker-with-alpha .colorpicker-alpha { - display: block; -} -.colorpicker-color { - height: 10px; - margin-top: 5px; - clear: both; - background-image: url("../img/bootstrap-colorpicker/alpha.png"); - background-position: 0 100%; -} -.colorpicker-color div { - height: 10px; -} -.colorpicker-selectors { - display: none; - height: 10px; - margin-top: 5px; - clear: both; -} -.colorpicker-selectors i { - cursor: pointer; - float: left; - height: 10px; - width: 10px; -} -.colorpicker-selectors i + i { - margin-left: 3px; -} -.colorpicker-element .input-group-addon i, -.colorpicker-element .add-on i { - display: inline-block; - cursor: pointer; - height: 16px; - vertical-align: text-top; - width: 16px; -} -.colorpicker.colorpicker-inline { - position: relative; - display: inline-block; - float: none; - z-index: auto; -} -.colorpicker.colorpicker-horizontal { - width: 110px; - min-width: 110px; - height: auto; -} -.colorpicker.colorpicker-horizontal .colorpicker-saturation { - margin-bottom: 4px; -} -.colorpicker.colorpicker-horizontal .colorpicker-color { - width: 100px; -} -.colorpicker.colorpicker-horizontal .colorpicker-hue, -.colorpicker.colorpicker-horizontal .colorpicker-alpha { - width: 100px; - height: 15px; - float: left; - cursor: col-resize; - margin-left: 0px; - margin-bottom: 4px; -} -.colorpicker.colorpicker-horizontal .colorpicker-hue i, -.colorpicker.colorpicker-horizontal .colorpicker-alpha i { - display: block; - height: 15px; - background: #ffffff; - position: absolute; - top: 0; - left: 0; - width: 1px; - border: none; - margin-top: 0px; -} -.colorpicker.colorpicker-horizontal .colorpicker-hue { - background-image: url("../img/bootstrap-colorpicker/hue-horizontal.png"); -} -.colorpicker.colorpicker-horizontal .colorpicker-alpha { - background-image: url("../img/bootstrap-colorpicker/alpha-horizontal.png"); -} -.colorpicker.colorpicker-hidden { - display: none; -} -.colorpicker.colorpicker-visible { - display: block; -} -.colorpicker-inline.colorpicker-visible { - display: inline-block; -} -.colorpicker-right:before { - left: auto; - right: 6px; -} -.colorpicker-right:after { - left: auto; - right: 7px; -} -.colorpicker-no-arrow:before { - border-right: 0; - border-left: 0; -} -.colorpicker-no-arrow:after { - border-right: 0; - border-left: 0; -} -/*# sourceMappingURL=bootstrap-colorpicker.css.map */ \ No newline at end of file diff --git a/assets/webconfig/css/bootstrap-colorpicker.min.css b/assets/webconfig/css/bootstrap-colorpicker.min.css new file mode 100644 index 00000000..22e5c37a --- /dev/null +++ b/assets/webconfig/css/bootstrap-colorpicker.min.css @@ -0,0 +1,10 @@ +/*! + * Bootstrap Colorpicker v2.3.3 + * http://mjolnic.github.io/bootstrap-colorpicker/ + * + * Originally written by (c) 2012 Stefan Petre + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0.txt + * + */.colorpicker-saturation{width:100px;height:100px;background-image:url(../img/bootstrap-colorpicker/saturation.png);cursor:crosshair;float:left}.colorpicker-saturation i{display:block;height:5px;width:5px;border:1px solid #000;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;position:absolute;top:0;left:0;margin:-4px 0 0 -4px}.colorpicker-saturation i b{display:block;height:5px;width:5px;border:1px solid #fff;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.colorpicker-alpha,.colorpicker-hue{width:15px;height:100px;float:left;cursor:row-resize;margin-left:4px;margin-bottom:4px}.colorpicker-alpha i,.colorpicker-hue i{display:block;height:1px;background:#000;border-top:1px solid #fff;position:absolute;top:0;left:0;width:100%;margin-top:-1px}.colorpicker-hue{background-image:url(../img/bootstrap-colorpicker/hue.png)}.colorpicker-alpha{background-image:url(../img/bootstrap-colorpicker/alpha.png);display:none}.colorpicker-alpha,.colorpicker-hue,.colorpicker-saturation{background-size:contain}.colorpicker{padding:4px;min-width:130px;margin-top:1px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;z-index:2500}.colorpicker:after,.colorpicker:before{display:table;content:"";line-height:0}.colorpicker:after{clear:both}.colorpicker:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:rgba(0,0,0,.2);position:absolute;top:-7px;left:6px}.colorpicker:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;position:absolute;top:-6px;left:7px}.colorpicker div{position:relative}.colorpicker.colorpicker-with-alpha{min-width:140px}.colorpicker.colorpicker-with-alpha .colorpicker-alpha{display:block}.colorpicker-color{height:10px;margin-top:5px;clear:both;background-image:url(../img/bootstrap-colorpicker/alpha.png);background-position:0 100%}.colorpicker-color div{height:10px}.colorpicker-selectors{display:none;height:10px;margin-top:5px;clear:both}.colorpicker-selectors i{cursor:pointer;float:left;height:10px;width:10px}.colorpicker-selectors i+i{margin-left:3px}.colorpicker-element .add-on i,.colorpicker-element .input-group-addon i{display:inline-block;cursor:pointer;height:16px;vertical-align:text-top;width:16px}.colorpicker.colorpicker-inline{position:relative;display:inline-block;float:none;z-index:auto}.colorpicker.colorpicker-horizontal{width:110px;min-width:110px;height:auto}.colorpicker.colorpicker-horizontal .colorpicker-saturation{margin-bottom:4px}.colorpicker.colorpicker-horizontal .colorpicker-color{width:100px}.colorpicker.colorpicker-horizontal .colorpicker-alpha,.colorpicker.colorpicker-horizontal .colorpicker-hue{width:100px;height:15px;float:left;cursor:col-resize;margin-left:0;margin-bottom:4px}.colorpicker.colorpicker-horizontal .colorpicker-alpha i,.colorpicker.colorpicker-horizontal .colorpicker-hue i{display:block;height:15px;background:#fff;position:absolute;top:0;left:0;width:1px;border:none;margin-top:0}.colorpicker.colorpicker-horizontal .colorpicker-hue{background-image:url(../img/bootstrap-colorpicker/hue-horizontal.png)}.colorpicker.colorpicker-horizontal .colorpicker-alpha{background-image:url(../img/bootstrap-colorpicker/alpha-horizontal.png)}.colorpicker.colorpicker-hidden{display:none}.colorpicker.colorpicker-visible{display:block}.colorpicker-inline.colorpicker-visible{display:inline-block}.colorpicker-right:before{left:auto;right:6px}.colorpicker-right:after{left:auto;right:7px}.colorpicker-no-arrow:before{border-right:0;border-left:0}.colorpicker-no-arrow:after{border-right:0;border-left:0} +/*# sourceMappingURL=bootstrap-colorpicker.min.css.map */ \ No newline at end of file diff --git a/assets/webconfig/css/bootstrap-colorpicker.min.css.map b/assets/webconfig/css/bootstrap-colorpicker.min.css.map new file mode 100644 index 00000000..f61ccb3e --- /dev/null +++ b/assets/webconfig/css/bootstrap-colorpicker.min.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["src/less/colorpicker.less"],"names":[],"mappings":";;;;;;;;AAqBA,wBACE,MAAA,MACA,OAAA,MAXA,iBAAsB,iDAatB,OAAA,UACA,MAAA,KACA,0BACE,QAAA,MACA,OAAA,IACA,MAAA,IACA,OAAA,IAAA,MAAA,KAfF,sBAAA,IACA,mBAAA,IACA,cAAA,IAeE,SAAA,SACA,IAAA,EACA,KAAA,EACA,OAAA,KAAA,EAAA,EAAA,KACA,4BACE,QAAA,MACA,OAAA,IACA,MAAA,IACA,OAAA,IAAA,MAAA,KAzBJ,sBAAA,IACA,mBAAA,IACA,cAAA,IA8BF,mBADA,iBAEE,MAAA,KACA,OAAA,MACA,MAAA,KACA,OAAA,WACA,YAAA,IACA,cAAA,IAIiB,qBADF,mBAEf,QAAA,MACA,OAAA,IACA,WAAA,KACA,WAAA,IAAA,MAAA,KACA,SAAA,SACA,IAAA,EACA,KAAA,EACA,MAAA,KACA,WAAA,KAGF,iBA1DE,iBAAsB,0CA8DxB,mBA9DE,iBAAsB,4CAgEtB,QAAA,KAKF,mBADA,iBADA,wBAGE,gBAAA,QAGF,aACE,QAAA,IACA,UAAA,MACA,WAAA,IAxEA,sBAAA,IACA,mBAAA,IACA,cAAA,IAwEA,QAAA,KAIU,mBADA,oBAEV,QAAA,MACA,QAAA,GACA,YAAA,EAGU,mBACV,MAAA,KAGU,oBACV,QAAA,GACA,QAAA,aACA,YAAA,IAAA,MAAA,YACA,aAAA,IAAA,MAAA,YACA,cAAA,IAAA,MAAA,KACA,oBAAA,eACA,SAAA,SACA,IAAA,KACA,KAAA,IAGU,mBACV,QAAA,GACA,QAAA,aACA,YAAA,IAAA,MAAA,YACA,aAAA,IAAA,MAAA,YACA,cAAA,IAAA,MAAA,KACA,SAAA,SACA,IAAA,KACA,KAAA,IAGW,iBACX,SAAA,SAGU,oCACV,UAAA,MAGkC,uDAClC,QAAA,MAGF,mBACE,OAAA,KACA,WAAA,IACA,MAAA,KAlIA,iBAAsB,4CAoItB,oBAAA,EAAA,KAGiB,uBACjB,OAAA,KAGF,uBACE,QAAA,KACA,OAAA,KACA,WAAA,IACA,MAAA,KAGqB,yBACrB,OAAA,QACA,MAAA,KACA,OAAA,KACA,MAAA,KAGuB,2BACvB,YAAA,IAI2B,+BADW,0CAEtC,QAAA,aACA,OAAA,QACA,OAAA,KACA,eAAA,SACA,MAAA,KAGU,gCACV,SAAA,SACA,QAAA,aACA,MAAA,KACA,QAAA,KAGU,oCACV,MAAA,MACA,UAAA,MACA,OAAA,KAGkC,4DAClC,cAAA,IAGkC,uDAClC,MAAA,MAIkC,uDADA,qDAElC,MAAA,MACA,OAAA,KACA,MAAA,KACA,OAAA,WACA,YAAA,EACA,cAAA,IAIqD,yDADF,uDAEnD,QAAA,MACA,OAAA,KACA,WAAA,KACA,SAAA,SACA,IAAA,EACA,KAAA,EACA,MAAA,IACA,OAAA,KACA,WAAA,EAGkC,qDAlNlC,iBAAsB,qDAsNY,uDAtNlC,iBAAsB,uDA0NZ,gCACV,QAAA,KAGU,iCACV,QAAA,MAGiB,wCACjB,QAAA,aAGgB,0BAChB,KAAA,KACA,MAAA,IAGgB,yBAChB,KAAA,KACA,MAAA,IAGmB,6BACnB,aAAA,EACA,YAAA,EAGmB,4BACnB,aAAA,EACA,YAAA"} \ No newline at end of file diff --git a/assets/webconfig/index.html b/assets/webconfig/index.html index 17db80a2..04e53284 100644 --- a/assets/webconfig/index.html +++ b/assets/webconfig/index.html @@ -12,20 +12,25 @@ Hyperion - WebUI - + + + + + + - + - - + + - - + + + - + - + - -
From d679affeb43791e6f5dcc8d930c61885508cdc86 Mon Sep 17 00:00:00 2001 From: redPanther Date: Tue, 23 Aug 2016 20:07:12 +0200 Subject: [PATCH 008/133] Leddevice rework2 (#193) * commit debug code to save it due to merge * migrate first devices to new device registry and configure on runtime * fadecandy and rs232 resets device if config is set * try to hunt crash on osx * test commit if this works with osx * refactor spi devices * cleanup * refactor leddevices file, tinkerforge and ws2812b * refactor raw usb devices * refactor udp devices * - add tpm2net driver - remove old udp driver from build (files left in place for reference for new udp driver) - json serverinfo shows available leddevices * finish rework part 2 of leddevices * add schemas for leddevices. currently only compiled in, but not usedx --- .travis/travis_build.sh | 4 +- .travis/travis_install.sh | 7 +- CODING_STYLE.md | 2 +- include/leddevice/LedDevice.h | 15 +- libsrc/hyperion/Hyperion.cpp | 2 +- libsrc/jsonserver/JsonClientConnection.cpp | 23 +- libsrc/leddevice/CMakeLists.txt | 14 +- libsrc/leddevice/LedDevice.cpp | 21 +- libsrc/leddevice/LedDeviceAPA102.cpp | 10 +- libsrc/leddevice/LedDeviceAPA102.h | 13 +- libsrc/leddevice/LedDeviceAdalight.cpp | 10 +- libsrc/leddevice/LedDeviceAdalight.h | 11 +- libsrc/leddevice/LedDeviceAdalightApa102.cpp | 10 +- libsrc/leddevice/LedDeviceAdalightApa102.h | 6 +- libsrc/leddevice/LedDeviceAtmo.cpp | 10 +- libsrc/leddevice/LedDeviceAtmo.h | 11 +- libsrc/leddevice/LedDeviceAtmoOrb.cpp | 56 ++- libsrc/leddevice/LedDeviceAtmoOrb.h | 23 +- libsrc/leddevice/LedDeviceFactory.cpp | 324 ++++-------------- libsrc/leddevice/LedDeviceFadeCandy.cpp | 23 +- libsrc/leddevice/LedDeviceFadeCandy.h | 6 +- libsrc/leddevice/LedDeviceFile.cpp | 24 +- libsrc/leddevice/LedDeviceFile.h | 16 +- libsrc/leddevice/LedDeviceHyperionUsbasp.cpp | 23 +- libsrc/leddevice/LedDeviceHyperionUsbasp.h | 18 +- libsrc/leddevice/LedDeviceLightpack.cpp | 18 + libsrc/leddevice/LedDeviceLightpack.h | 16 + libsrc/leddevice/LedDeviceLpd6803.cpp | 9 +- libsrc/leddevice/LedDeviceLpd6803.h | 10 +- libsrc/leddevice/LedDeviceLpd8806.cpp | 10 +- libsrc/leddevice/LedDeviceLpd8806.h | 10 +- libsrc/leddevice/LedDeviceMultiLightpack.cpp | 7 +- libsrc/leddevice/LedDeviceMultiLightpack.h | 9 +- libsrc/leddevice/LedDeviceP9813.cpp | 10 +- libsrc/leddevice/LedDeviceP9813.h | 10 +- libsrc/leddevice/LedDevicePaintpack.cpp | 10 +- libsrc/leddevice/LedDevicePaintpack.h | 13 +- libsrc/leddevice/LedDevicePhilipsHue.cpp | 29 +- libsrc/leddevice/LedDevicePhilipsHue.h | 21 +- libsrc/leddevice/LedDevicePiBlaster.cpp | 42 ++- libsrc/leddevice/LedDevicePiBlaster.h | 21 +- libsrc/leddevice/LedDeviceRawHID.cpp | 11 +- libsrc/leddevice/LedDeviceRawHID.h | 9 +- libsrc/leddevice/LedDeviceSchemas.qrc | 31 ++ libsrc/leddevice/LedDeviceSedu.cpp | 9 +- libsrc/leddevice/LedDeviceSedu.h | 10 +- libsrc/leddevice/LedDeviceSk6812SPI.cpp | 22 +- libsrc/leddevice/LedDeviceSk6812SPI.h | 17 +- libsrc/leddevice/LedDeviceTinkerforge.cpp | 23 +- libsrc/leddevice/LedDeviceTinkerforge.h | 26 +- libsrc/leddevice/LedDeviceTpm2.cpp | 11 +- libsrc/leddevice/LedDeviceTpm2.h | 11 +- libsrc/leddevice/LedDeviceTpm2net.cpp | 63 ++++ libsrc/leddevice/LedDeviceTpm2net.h | 53 +++ libsrc/leddevice/LedDeviceUdpE131.cpp | 21 +- libsrc/leddevice/LedDeviceUdpE131.h | 16 +- libsrc/leddevice/LedDeviceUdpRaw.cpp | 19 +- libsrc/leddevice/LedDeviceUdpRaw.h | 16 +- libsrc/leddevice/LedDeviceWS2812b.cpp | 5 + libsrc/leddevice/LedDeviceWS2812b.h | 16 +- libsrc/leddevice/LedDeviceWS281x.cpp | 56 +-- libsrc/leddevice/LedDeviceWS281x.h | 24 +- libsrc/leddevice/LedDeviceWs2801.cpp | 11 +- libsrc/leddevice/LedDeviceWs2801.h | 13 +- libsrc/leddevice/LedDeviceWs2812SPI.cpp | 10 +- libsrc/leddevice/LedDeviceWs2812SPI.h | 11 +- libsrc/leddevice/LedHIDDevice.cpp | 22 +- libsrc/leddevice/LedHIDDevice.h | 31 +- libsrc/leddevice/LedRs232Device.cpp | 24 +- libsrc/leddevice/LedRs232Device.h | 20 +- libsrc/leddevice/LedSpiDevice.cpp | 20 +- libsrc/leddevice/LedSpiDevice.h | 23 +- libsrc/leddevice/LedUdpDevice.cpp | 33 +- libsrc/leddevice/LedUdpDevice.h | 21 +- libsrc/leddevice/schemas/schema-adalight.json | 7 + .../schemas/schema-adalightapa102.json | 7 + libsrc/leddevice/schemas/schema-apa102.json | 7 + libsrc/leddevice/schemas/schema-atmo.json | 7 + libsrc/leddevice/schemas/schema-atmoorb.json | 7 + libsrc/leddevice/schemas/schema-e131.json | 7 + .../leddevice/schemas/schema-fadecandy.json | 7 + libsrc/leddevice/schemas/schema-file.json | 7 + .../schemas/schema-hyperion-usbasp.json | 7 + .../leddevice/schemas/schema-lightpack.json | 7 + libsrc/leddevice/schemas/schema-lpd6803.json | 7 + libsrc/leddevice/schemas/schema-lpd8806.json | 7 + .../schemas/schema-multi-lightpack.json | 7 + libsrc/leddevice/schemas/schema-p9813.json | 7 + .../leddevice/schemas/schema-paintpack.json | 7 + .../leddevice/schemas/schema-philipshue.json | 7 + .../leddevice/schemas/schema-piblaster.json | 7 + libsrc/leddevice/schemas/schema-rawhid.json | 7 + libsrc/leddevice/schemas/schema-sedu.json | 7 + .../schemas/schema-sk6812rgbw-spi.json | 7 + .../leddevice/schemas/schema-tinkerforge.json | 7 + libsrc/leddevice/schemas/schema-tmp2net.json | 7 + libsrc/leddevice/schemas/schema-tpm2.json | 7 + libsrc/leddevice/schemas/schema-udpraw.json | 7 + libsrc/leddevice/schemas/schema-ws2801.json | 7 + .../leddevice/schemas/schema-ws2812spi.json | 7 + libsrc/leddevice/schemas/schema-ws281x.json | 7 + test/TestSpi.cpp | 13 +- test/testrunner.sh | 3 + 103 files changed, 1244 insertions(+), 596 deletions(-) create mode 100644 libsrc/leddevice/LedDeviceSchemas.qrc create mode 100644 libsrc/leddevice/LedDeviceTpm2net.cpp create mode 100644 libsrc/leddevice/LedDeviceTpm2net.h create mode 100644 libsrc/leddevice/schemas/schema-adalight.json create mode 100644 libsrc/leddevice/schemas/schema-adalightapa102.json create mode 100644 libsrc/leddevice/schemas/schema-apa102.json create mode 100644 libsrc/leddevice/schemas/schema-atmo.json create mode 100644 libsrc/leddevice/schemas/schema-atmoorb.json create mode 100644 libsrc/leddevice/schemas/schema-e131.json create mode 100644 libsrc/leddevice/schemas/schema-fadecandy.json create mode 100644 libsrc/leddevice/schemas/schema-file.json create mode 100644 libsrc/leddevice/schemas/schema-hyperion-usbasp.json create mode 100644 libsrc/leddevice/schemas/schema-lightpack.json create mode 100644 libsrc/leddevice/schemas/schema-lpd6803.json create mode 100644 libsrc/leddevice/schemas/schema-lpd8806.json create mode 100644 libsrc/leddevice/schemas/schema-multi-lightpack.json create mode 100644 libsrc/leddevice/schemas/schema-p9813.json create mode 100644 libsrc/leddevice/schemas/schema-paintpack.json create mode 100644 libsrc/leddevice/schemas/schema-philipshue.json create mode 100644 libsrc/leddevice/schemas/schema-piblaster.json create mode 100644 libsrc/leddevice/schemas/schema-rawhid.json create mode 100644 libsrc/leddevice/schemas/schema-sedu.json create mode 100644 libsrc/leddevice/schemas/schema-sk6812rgbw-spi.json create mode 100644 libsrc/leddevice/schemas/schema-tinkerforge.json create mode 100644 libsrc/leddevice/schemas/schema-tmp2net.json create mode 100644 libsrc/leddevice/schemas/schema-tpm2.json create mode 100644 libsrc/leddevice/schemas/schema-udpraw.json create mode 100644 libsrc/leddevice/schemas/schema-ws2801.json create mode 100644 libsrc/leddevice/schemas/schema-ws2812spi.json create mode 100644 libsrc/leddevice/schemas/schema-ws281x.json diff --git a/.travis/travis_build.sh b/.travis/travis_build.sh index e5f514eb..d274d8ff 100755 --- a/.travis/travis_build.sh +++ b/.travis/travis_build.sh @@ -15,7 +15,7 @@ then mkdir build || exit 1 cd build - cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTS=ON -Wno-dev .. || exit 2 + cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_TESTS=ON -Wno-dev .. || exit 2 make -j$procs || exit 3 # make -j$(nproc) package || exit 4 # currently osx(dmg) package creation not implemented fi @@ -25,7 +25,7 @@ if [[ $TRAVIS_OS_NAME == 'linux' ]] then mkdir build || exit 1 cd build - cmake -DPLATFORM=x86-dev -DCMAKE_BUILD_TYPE=Release .. || exit 2 + cmake -DPLATFORM=x86-dev -DCMAKE_BUILD_TYPE=Debug .. || exit 2 make -j$(nproc) || exit 3 make -j$(nproc) package || exit 4 fi diff --git a/.travis/travis_install.sh b/.travis/travis_install.sh index ae7735b4..cb013543 100755 --- a/.travis/travis_install.sh +++ b/.travis/travis_install.sh @@ -1,6 +1,8 @@ #!/bin/bash + # install osx deps for hyperion compile -if [[ $TRAVIS_OS_NAME == 'osx' ]]; then +if [[ $TRAVIS_OS_NAME == 'osx' ]] +then echo "Install OSX deps" time brew update time brew install qt5 || true @@ -10,7 +12,8 @@ if [[ $TRAVIS_OS_NAME == 'osx' ]]; then fi # install linux deps for hyperion compile -if [[ $TRAVIS_OS_NAME == 'linux' ]]; then +if [[ $TRAVIS_OS_NAME == 'linux' ]] +then echo "Install linux deps" sudo apt-get -qq update sudo apt-get install -qq -y qtbase5-dev libqt5serialport5-dev libusb-1.0-0-dev python-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev doxygen diff --git a/CODING_STYLE.md b/CODING_STYLE.md index a22773c6..1a5d5f07 100644 --- a/CODING_STYLE.md +++ b/CODING_STYLE.md @@ -41,7 +41,7 @@ MyClass::MyClass() : myVarA(0), good: MyClass::MyClass() - : myVarA(0), + : myVarA(0) , myVarB("eee") , myVarC(true) { diff --git a/include/leddevice/LedDevice.h b/include/leddevice/LedDevice.h index f40e809f..f253591c 100644 --- a/include/leddevice/LedDevice.h +++ b/include/leddevice/LedDevice.h @@ -2,14 +2,21 @@ // STL incldues #include - #include +#include // Utility includes #include #include #include #include +#include +#include + +class LedDevice; + +typedef LedDevice* ( *LedDeviceCreateFuncType ) ( const Json::Value& ); +typedef std::map LedDeviceRegistry; /// /// Interface (pure virtual base class) for LedDevices. @@ -44,6 +51,10 @@ public: /// virtual int open(); + static int addToDeviceMap(std::string name, LedDeviceCreateFuncType funcPtr); + static const LedDeviceRegistry& getDeviceMap(); + static void setActiveDevice(std::string dev); + static std::string activeDevice() { return _activeDevice; }; protected: /// The common Logger instance for all LedDevices Logger * _log; @@ -53,4 +64,6 @@ protected: /// The buffer containing the packed RGB values std::vector _ledBuffer; + static std::string _activeDevice; + static LedDeviceRegistry _ledDeviceMap; }; diff --git a/libsrc/hyperion/Hyperion.cpp b/libsrc/hyperion/Hyperion.cpp index aa4cae2a..9cbaf376 100644 --- a/libsrc/hyperion/Hyperion.cpp +++ b/libsrc/hyperion/Hyperion.cpp @@ -565,7 +565,6 @@ Hyperion::Hyperion(const Json::Value &jsonConfig, const std::string configFile) , _raw2ledTransform(createLedColorsTransform(_ledString.leds().size(), jsonConfig["color"])) , _raw2ledTemperature(createLedColorsTemperature(_ledString.leds().size(), jsonConfig["color"])) , _raw2ledAdjustment(createLedColorsAdjustment(_ledString.leds().size(), jsonConfig["color"])) - , _device(LedDeviceFactory::construct(jsonConfig["device"])) , _effectEngine(nullptr) , _messageForwarder(createMessageForwarder(jsonConfig["forwarder"])) , _jsonConfig(jsonConfig) @@ -575,6 +574,7 @@ Hyperion::Hyperion(const Json::Value &jsonConfig, const std::string configFile) , _hwLedCount(_ledString.leds().size()) , _sourceAutoSelectEnabled(true) { + _device = LedDeviceFactory::construct(jsonConfig["device"]); registerPriority("Off", PriorityMuxer::LOWEST_PRIORITY); if (!_raw2ledAdjustment->verifyAdjustments()) diff --git a/libsrc/jsonserver/JsonClientConnection.cpp b/libsrc/jsonserver/JsonClientConnection.cpp index ab497bd4..605b0c6e 100644 --- a/libsrc/jsonserver/JsonClientConnection.cpp +++ b/libsrc/jsonserver/JsonClientConnection.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -624,21 +625,31 @@ void JsonClientConnection::handleServerInfoCommand(const Json::Value &, const st << std::hex << unsigned(priorityInfo.ledColors.begin()->blue); LEDcolor["HEX Value"].append(hex.str()); - + activeLedColors.append(LEDcolor); } } } + // get available led devices + info["ledDevices"]["active"] = LedDevice::activeDevice(); + info["ledDevices"]["available"] = Json::Value(Json::arrayValue); + for ( auto dev: LedDevice::getDeviceMap()) + { + info["ledDevices"]["available"].append(dev.first); + } + + // Add Hyperion Version, build time - Json::Value & version = info["hyperion"] = Json::Value(Json::arrayValue); + //Json::Value & version = + info["hyperion"] = Json::Value(Json::arrayValue); Json::Value ver; ver["jsonrpc_version"] = HYPERION_JSON_VERSION; ver["version"] = HYPERION_VERSION; - ver["build"] = HYPERION_BUILD_ID; - ver["time"] = __DATE__ " " __TIME__; + ver["build"] = HYPERION_BUILD_ID; + ver["time"] = __DATE__ " " __TIME__; - version.append(ver); + info["hyperion"].append(ver); // send the result sendMessage(result); @@ -941,7 +952,7 @@ void JsonClientConnection::handleConfigSetCommand(const Json::Value &message, co sendSuccessReply(command, tan); } } else - sendErrorReply("Error while parsing json: Message size " + message.size(), command, tan); + sendErrorReply("Error while parsing json: Message size " + std::to_string(message.size()), command, tan); } void JsonClientConnection::handleComponentStateCommand(const Json::Value& message, const std::string &command, const int tan) diff --git a/libsrc/leddevice/CMakeLists.txt b/libsrc/leddevice/CMakeLists.txt index 2efcca56..2061f34f 100755 --- a/libsrc/leddevice/CMakeLists.txt +++ b/libsrc/leddevice/CMakeLists.txt @@ -34,13 +34,12 @@ SET(Leddevice_HEADERS ${CURRENT_SOURCE_DIR}/LedDevicePiBlaster.h ${CURRENT_SOURCE_DIR}/LedDeviceSedu.h ${CURRENT_SOURCE_DIR}/LedDeviceFile.h - ${CURRENT_SOURCE_DIR}/LedDeviceFadeCandy.h - ${CURRENT_SOURCE_DIR}/LedDeviceUdp.h ${CURRENT_SOURCE_DIR}/LedDeviceUdpRaw.h ${CURRENT_SOURCE_DIR}/LedDeviceUdpE131.h ${CURRENT_SOURCE_DIR}/LedUdpDevice.h ${CURRENT_SOURCE_DIR}/LedDeviceHyperionUsbasp.h ${CURRENT_SOURCE_DIR}/LedDeviceTpm2.h + ${CURRENT_SOURCE_DIR}/LedDeviceTpm2net.h ${CURRENT_SOURCE_DIR}/LedDeviceAtmo.h ) @@ -62,13 +61,13 @@ SET(Leddevice_SOURCES ${CURRENT_SOURCE_DIR}/LedDeviceSedu.cpp ${CURRENT_SOURCE_DIR}/LedDeviceFile.cpp ${CURRENT_SOURCE_DIR}/LedDeviceFadeCandy.cpp - ${CURRENT_SOURCE_DIR}/LedDeviceUdp.cpp ${CURRENT_SOURCE_DIR}/LedDeviceUdpRaw.cpp ${CURRENT_SOURCE_DIR}/LedDeviceUdpE131.cpp ${CURRENT_SOURCE_DIR}/LedUdpDevice.cpp ${CURRENT_SOURCE_DIR}/LedDeviceHyperionUsbasp.cpp ${CURRENT_SOURCE_DIR}/LedDevicePhilipsHue.cpp ${CURRENT_SOURCE_DIR}/LedDeviceTpm2.cpp + ${CURRENT_SOURCE_DIR}/LedDeviceTpm2net.cpp ${CURRENT_SOURCE_DIR}/LedDeviceAtmo.cpp ) @@ -131,7 +130,13 @@ if(ENABLE_TINKERFORGE) ) endif() +set(LedDevice_RESOURCES + ${CURRENT_SOURCE_DIR}/LedDeviceSchemas.qrc +) + QT5_WRAP_CPP(Leddevice_HEADERS_MOC ${Leddevice_QT_HEADERS}) +qt5_add_resources(LedDevice_RESOURCES_RCC ${LedDevice_RESOURCES} OPTIONS "-no-compress") + add_library(leddevice @@ -139,13 +144,14 @@ add_library(leddevice ${Leddevice_QT_HEADERS} ${Leddevice_HEADERS_MOC} ${Leddevice_SOURCES} + ${LedDevice_RESOURCES} + ${LedDevice_RESOURCES_RCC} ) qt5_use_modules(leddevice Network SerialPort) target_link_libraries(leddevice hyperion-utils -# serialport ${LIBUSB_1_LIBRARIES} #apt-get install libusb-1.0-0-dev ${CMAKE_THREAD_LIBS_INIT} ${QT_LIBRARIES} diff --git a/libsrc/leddevice/LedDevice.cpp b/libsrc/leddevice/LedDevice.cpp index 11381238..e38a7d81 100644 --- a/libsrc/leddevice/LedDevice.cpp +++ b/libsrc/leddevice/LedDevice.cpp @@ -1,5 +1,8 @@ #include +LedDeviceRegistry LedDevice::_ledDeviceMap = LedDeviceRegistry(); +std::string LedDevice::_activeDevice = ""; + LedDevice::LedDevice() : QObject() , _log(Logger::getInstance("LedDevice")) @@ -9,8 +12,24 @@ LedDevice::LedDevice() { } +// dummy implemention int LedDevice::open() { - //dummy implemention return 0; } + +int LedDevice::addToDeviceMap(std::string name, LedDeviceCreateFuncType funcPtr) +{ + _ledDeviceMap.emplace(name,funcPtr); + return 0; +} + +const LedDeviceRegistry& LedDevice::getDeviceMap() +{ + return _ledDeviceMap; +} + +void LedDevice::setActiveDevice(std::string dev) +{ + _activeDevice = dev; +} \ No newline at end of file diff --git a/libsrc/leddevice/LedDeviceAPA102.cpp b/libsrc/leddevice/LedDeviceAPA102.cpp index 0b2bb1b1..3f2ff87e 100644 --- a/libsrc/leddevice/LedDeviceAPA102.cpp +++ b/libsrc/leddevice/LedDeviceAPA102.cpp @@ -12,9 +12,15 @@ // hyperion local includes #include "LedDeviceAPA102.h" -LedDeviceAPA102::LedDeviceAPA102(const std::string& outputDevice, const unsigned baudrate) - : LedSpiDevice(outputDevice, baudrate, 500000) +LedDeviceAPA102::LedDeviceAPA102(const Json::Value &deviceConfig) + : LedSpiDevice(deviceConfig) { + _latchTime_ns = 500000; +} + +LedDevice* LedDeviceAPA102::construct(const Json::Value &deviceConfig) +{ + return new LedDeviceAPA102(deviceConfig); } int LedDeviceAPA102::write(const std::vector &ledValues) diff --git a/libsrc/leddevice/LedDeviceAPA102.h b/libsrc/leddevice/LedDeviceAPA102.h index 5eb00514..07271696 100644 --- a/libsrc/leddevice/LedDeviceAPA102.h +++ b/libsrc/leddevice/LedDeviceAPA102.h @@ -5,22 +5,23 @@ // hyperion incluse #include "LedSpiDevice.h" +#include /// /// Implementation of the LedDevice interface for writing to APA102 led device. /// -/// APA102 is -/// class LedDeviceAPA102 : public LedSpiDevice { public: /// - /// Constructs the LedDevice for a string containing leds of the type APA102 + /// Constructs specific LedDevice /// - /// @param outputDevice The name of the output device (eg '/dev/spidev.0.0') - /// @param baudrate The used baudrate for writing to the output device + /// @param deviceConfig json device config /// - LedDeviceAPA102(const std::string& outputDevice, const unsigned baudrate ); + LedDeviceAPA102(const Json::Value &deviceConfig); + + /// constructs leddevice + static LedDevice* construct(const Json::Value &deviceConfig); /// diff --git a/libsrc/leddevice/LedDeviceAdalight.cpp b/libsrc/leddevice/LedDeviceAdalight.cpp index 880f6690..880417cc 100644 --- a/libsrc/leddevice/LedDeviceAdalight.cpp +++ b/libsrc/leddevice/LedDeviceAdalight.cpp @@ -10,9 +10,10 @@ // hyperion local includes #include "LedDeviceAdalight.h" +#include -LedDeviceAdalight::LedDeviceAdalight(const std::string& outputDevice, const unsigned baudrate, int delayAfterConnect_ms) - : LedRs232Device(outputDevice, baudrate, delayAfterConnect_ms) +LedDeviceAdalight::LedDeviceAdalight(const Json::Value &deviceConfig) + : LedRs232Device(deviceConfig) , _timer() { // setup the timer @@ -24,6 +25,11 @@ LedDeviceAdalight::LedDeviceAdalight(const std::string& outputDevice, const unsi _timer.start(); } +LedDevice* LedDeviceAdalight::construct(const Json::Value &deviceConfig) +{ + return new LedDeviceAdalight(deviceConfig); +} + int LedDeviceAdalight::write(const std::vector & ledValues) { if (_ledBuffer.size() == 0) diff --git a/libsrc/leddevice/LedDeviceAdalight.h b/libsrc/leddevice/LedDeviceAdalight.h index 2f8aab60..e3f647a5 100644 --- a/libsrc/leddevice/LedDeviceAdalight.h +++ b/libsrc/leddevice/LedDeviceAdalight.h @@ -18,12 +18,14 @@ class LedDeviceAdalight : public LedRs232Device public: /// - /// Constructs the LedDevice for attached Adalight device + /// Constructs specific LedDevice /// - /// @param outputDevice The name of the output device (eg '/dev/ttyS0') - /// @param baudrate The used baudrate for writing to the output device + /// @param deviceConfig json device config /// - LedDeviceAdalight(const std::string& outputDevice, const unsigned baudrate, int delayAfterConnect_ms); + LedDeviceAdalight(const Json::Value &deviceConfig); + + /// constructs leddevice + static LedDevice* construct(const Json::Value &deviceConfig); /// /// Writes the led color values to the led-device @@ -46,3 +48,4 @@ protected: /// every 15 seconds QTimer _timer; }; + diff --git a/libsrc/leddevice/LedDeviceAdalightApa102.cpp b/libsrc/leddevice/LedDeviceAdalightApa102.cpp index c72cbc3b..ccc273a2 100644 --- a/libsrc/leddevice/LedDeviceAdalightApa102.cpp +++ b/libsrc/leddevice/LedDeviceAdalightApa102.cpp @@ -11,11 +11,17 @@ // hyperion local includes #include "LedDeviceAdalightApa102.h" -LedDeviceAdalightApa102::LedDeviceAdalightApa102(const std::string& outputDevice, const unsigned baudrate, int delayAfterConnect_ms) - : LedDeviceAdalight(outputDevice, baudrate, delayAfterConnect_ms) +LedDeviceAdalightApa102::LedDeviceAdalightApa102(const Json::Value &deviceConfig) + : LedDeviceAdalight(deviceConfig) { } +LedDevice* LedDeviceAdalightApa102::construct(const Json::Value &deviceConfig) +{ + return new LedDeviceAdalightApa102(deviceConfig); +} + + //comparing to ws2801 adalight, the following changes were needed: // 1- differnt data frame (4 bytes instead of 3) // 2 - in order to accomodate point 1 above, number of leds sent to adalight is increased by 1/3rd diff --git a/libsrc/leddevice/LedDeviceAdalightApa102.h b/libsrc/leddevice/LedDeviceAdalightApa102.h index dfdd99c2..d452d771 100644 --- a/libsrc/leddevice/LedDeviceAdalightApa102.h +++ b/libsrc/leddevice/LedDeviceAdalightApa102.h @@ -20,7 +20,10 @@ public: /// @param outputDevice The name of the output device (eg '/dev/ttyS0') /// @param baudrate The used baudrate for writing to the output device /// - LedDeviceAdalightApa102(const std::string& outputDevice, const unsigned baudrate, int delayAfterConnect_ms); + LedDeviceAdalightApa102(const Json::Value &deviceConfig); + + /// create leddevice when type in config is set to this type + static LedDevice* construct(const Json::Value &deviceConfig); /// /// Writes the led color values to the led-device @@ -33,3 +36,4 @@ public: /// Switch the leds off virtual int switchOff(); }; + diff --git a/libsrc/leddevice/LedDeviceAtmo.cpp b/libsrc/leddevice/LedDeviceAtmo.cpp index 74d7f044..d4878aff 100644 --- a/libsrc/leddevice/LedDeviceAtmo.cpp +++ b/libsrc/leddevice/LedDeviceAtmo.cpp @@ -1,8 +1,8 @@ // hyperion local includes #include "LedDeviceAtmo.h" -LedDeviceAtmo::LedDeviceAtmo(const std::string& outputDevice, const unsigned baudrate) - : LedRs232Device(outputDevice, baudrate) +LedDeviceAtmo::LedDeviceAtmo(const Json::Value &deviceConfig) + : LedRs232Device(deviceConfig) { _ledBuffer.resize(4 + 5*3); // 4-byte header, 5 RGB values _ledBuffer[0] = 0xFF; // Startbyte @@ -11,6 +11,12 @@ LedDeviceAtmo::LedDeviceAtmo(const std::string& outputDevice, const unsigned bau _ledBuffer[3] = 0x0F; // Number of Databytes send (always! 15) } +LedDevice* LedDeviceAtmo::construct(const Json::Value &deviceConfig) +{ + return new LedDeviceAtmo(deviceConfig); +} + + int LedDeviceAtmo::write(const std::vector &ledValues) { // The protocol is shomehow limited. we always need to send exactly 5 channels + header diff --git a/libsrc/leddevice/LedDeviceAtmo.h b/libsrc/leddevice/LedDeviceAtmo.h index 85f05c6e..18ccfd5d 100644 --- a/libsrc/leddevice/LedDeviceAtmo.h +++ b/libsrc/leddevice/LedDeviceAtmo.h @@ -13,13 +13,14 @@ class LedDeviceAtmo : public LedRs232Device { public: /// - /// Constructs the LedDevice for attached serial device using supporting tpm2 protocol - /// All LEDs in the stripe are handled as one frame + /// Constructs specific LedDevice /// - /// @param outputDevice The name of the output device (eg '/dev/ttyAMA0') - /// @param baudrate The used baudrate for writing to the output device + /// @param deviceConfig json device config /// - LedDeviceAtmo(const std::string& outputDevice, const unsigned baudrate); + LedDeviceAtmo(const Json::Value &deviceConfig); + + /// constructs leddevice + static LedDevice* construct(const Json::Value &deviceConfig); /// /// Writes the led color values to the led-device diff --git a/libsrc/leddevice/LedDeviceAtmoOrb.cpp b/libsrc/leddevice/LedDeviceAtmoOrb.cpp index 28fc48d1..79c339a1 100644 --- a/libsrc/leddevice/LedDeviceAtmoOrb.cpp +++ b/libsrc/leddevice/LedDeviceAtmoOrb.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include @@ -15,23 +16,10 @@ AtmoOrbLight::AtmoOrbLight(unsigned int id) { // Not implemented } -LedDeviceAtmoOrb::LedDeviceAtmoOrb( - const std::string &output, - bool useOrbSmoothing, - int transitiontime, - int skipSmoothingDiff, - int port, - int numLeds, - std::vector orbIds) +LedDeviceAtmoOrb::LedDeviceAtmoOrb(const Json::Value &deviceConfig) : LedDevice() - , _multicastGroup(output.c_str()) - , _useOrbSmoothing(useOrbSmoothing) - , _transitiontime(transitiontime) - , _skipSmoothingDiff(skipSmoothingDiff) - , _multiCastGroupPort(port) - , _numLeds(numLeds) - , _orbIds(orbIds) { + setConfig(deviceConfig); _manager = new QNetworkAccessManager(); _groupAddress = QHostAddress(_multicastGroup); @@ -41,6 +29,44 @@ LedDeviceAtmoOrb::LedDeviceAtmoOrb( joinedMulticastgroup = _udpSocket->joinMulticastGroup(_groupAddress); } +bool LedDeviceAtmoOrb::setConfig(const Json::Value &deviceConfig) +{ + _multicastGroup = deviceConfig["output"].asString().c_str(); + _useOrbSmoothing = deviceConfig.get("useOrbSmoothing", false).asBool(); + _transitiontime = deviceConfig.get("transitiontime", 0).asInt(); + _skipSmoothingDiff = deviceConfig.get("skipSmoothingDiff", 0).asInt(); + _multiCastGroupPort = deviceConfig.get("port", 49692).asInt(); + _numLeds = deviceConfig.get("numLeds", 24).asInt(); + + const std::string orbId = deviceConfig["orbIds"].asString(); + _orbIds.clear(); + + // If we find multiple Orb ids separate them and add to list + const std::string separator (","); + if (orbId.find(separator) != std::string::npos) + { + std::stringstream ss(orbId); + std::vector output; + unsigned int i; + while (ss >> i) + { + _orbIds.push_back(i); + if (ss.peek() == ',' || ss.peek() == ' ') ss.ignore(); + } + } + else + { + _orbIds.push_back(atoi(orbId.c_str())); + } + + return true; +} + +LedDevice* LedDeviceAtmoOrb::construct(const Json::Value &deviceConfig) +{ + return new LedDeviceAtmoOrb(deviceConfig); +} + int LedDeviceAtmoOrb::write(const std::vector &ledValues) { // If not in multicast group return diff --git a/libsrc/leddevice/LedDeviceAtmoOrb.h b/libsrc/leddevice/LedDeviceAtmoOrb.h index d11127f1..e76fe067 100644 --- a/libsrc/leddevice/LedDeviceAtmoOrb.h +++ b/libsrc/leddevice/LedDeviceAtmoOrb.h @@ -45,20 +45,21 @@ public: bool joinedMulticastgroup; /// - /// Constructs the device. + /// Constructs specific LedDevice /// - /// @param output is the multicast address of Orbs - /// @param transitiontime is optional and not used at the moment - /// @param useOrbSmoothing use Orbs own (external) smoothing algorithm (default: false) - /// @param skipSmoothingDiff minimal color (0-255) difference to override smoothing so that if current and previously received colors are higher than set dif we override smoothing - /// @param port is the multicast port. - /// @param numLeds is the total amount of leds per Orb - /// @param array containing orb ids + /// @param deviceConfig json device config /// - LedDeviceAtmoOrb(const std::string &output, bool useOrbSmoothing = - false, int transitiontime = 0, int skipSmoothingDiff = 0, int port = 49692, int numLeds = 24, - std::vector orbIds = std::vector()); + LedDeviceAtmoOrb(const Json::Value &deviceConfig); + /// + /// Sets configuration + /// + /// @param deviceConfig the json device config + /// @return true if success + bool setConfig(const Json::Value &deviceConfig); + + /// constructs leddevice + static LedDevice* construct(const Json::Value &deviceConfig); /// /// Destructor of this device /// diff --git a/libsrc/leddevice/LedDeviceFactory.cpp b/libsrc/leddevice/LedDeviceFactory.cpp index 3257904e..b4baa439 100755 --- a/libsrc/leddevice/LedDeviceFactory.cpp +++ b/libsrc/leddevice/LedDeviceFactory.cpp @@ -3,6 +3,7 @@ #include #include #include +#include // Build configuration #include @@ -10,6 +11,7 @@ // Leddevice includes #include #include +#include // Local Leddevice includes #ifdef ENABLE_SPIDEV @@ -35,7 +37,7 @@ #include "LedDeviceSedu.h" #include "LedDeviceFile.h" #include "LedDeviceFadeCandy.h" -#include "LedDeviceUdp.h" +#include "LedDeviceTpm2net.h" #include "LedDeviceUdpRaw.h" #include "LedDeviceUdpE131.h" #include "LedDeviceHyperionUsbasp.h" @@ -63,281 +65,81 @@ LedDevice * LedDeviceFactory::construct(const Json::Value & deviceConfig) std::string type = deviceConfig.get("type", "UNSPECIFIED").asString(); std::transform(type.begin(), type.end(), type.begin(), ::tolower); + // rs232 devices + LedDevice::addToDeviceMap("adalight" , LedDeviceAdalight::construct); + LedDevice::addToDeviceMap("adalightapa102", LedDeviceAdalightApa102::construct); + LedDevice::addToDeviceMap("sedu" , LedDeviceSedu::construct); + LedDevice::addToDeviceMap("tpm2" , LedDeviceTpm2::construct); + LedDevice::addToDeviceMap("atmo" , LedDeviceAtmo::construct); + LedDevice::addToDeviceMap("fadecandy" , LedDeviceFadeCandy::construct); + + // spi devices + #ifdef ENABLE_SPIDEV + LedDevice::addToDeviceMap("apa102" , LedDeviceAPA102::construct); + LedDevice::addToDeviceMap("lpd6803" , LedDeviceLpd6803::construct); + LedDevice::addToDeviceMap("lpd8806" , LedDeviceLpd8806::construct); + LedDevice::addToDeviceMap("p9813" , LedDeviceP9813::construct); + LedDevice::addToDeviceMap("ws2801" , LedDeviceWs2801::construct); + LedDevice::addToDeviceMap("ws2812spi" , LedDeviceWs2812SPI::construct); + LedDevice::addToDeviceMap("sk6812rgbw-spi", LedDeviceSk6812SPI::construct); + #endif + + // pwm devices + #ifdef ENABLE_WS2812BPWM + LedDevice::addToDeviceMap("ws2812b", LedDeviceWS2812b::construct); + #endif + #ifdef ENABLE_WS281XPWM + LedDevice::addToDeviceMap("ws281x", LedDeviceWS281x::construct); + #endif + + // network lights + LedDevice::addToDeviceMap("tmp2net", LedDeviceTpm2net::construct); + LedDevice::addToDeviceMap("udpraw", LedDeviceUdpRaw::construct); + LedDevice::addToDeviceMap("e131", LedDeviceUdpE131::construct); + #ifdef ENABLE_TINKERFORGE + LedDevice::addToDeviceMap("tinkerforge", LedDeviceTinkerforge::construct); + #endif + LedDevice::addToDeviceMap("philipshue", LedDevicePhilipsHue::construct); + LedDevice::addToDeviceMap("atmoorb", LedDeviceAtmoOrb::construct); + + // direct usb + LedDevice::addToDeviceMap("hyperion-usbasp", LedDeviceHyperionUsbasp::construct); + LedDevice::addToDeviceMap("rawhid", LedDeviceRawHID::construct); + LedDevice::addToDeviceMap("paintpack", LedDevicePaintpack::construct); + LedDevice::addToDeviceMap("lightpack", LedDeviceLightpack::construct); + LedDevice::addToDeviceMap("multi-lightpack", LedDeviceMultiLightpack::construct); + + // other + LedDevice::addToDeviceMap("file", LedDeviceFile::construct); + LedDevice::addToDeviceMap("piblaster", LedDevicePiBlaster::construct); + + const LedDeviceRegistry& devList = LedDevice::getDeviceMap(); LedDevice* device = nullptr; try { - if (false) {} - else if (type == "adalight") + for ( auto dev: devList) { - device = new LedDeviceAdalight( - deviceConfig["output"].asString(), - deviceConfig["rate"].asInt(), - deviceConfig.get("delayAfterConnect",500).asInt() - ); - } - else if (type == "adalightapa102") - { - device = new LedDeviceAdalightApa102( - deviceConfig["output"].asString(), - deviceConfig["rate"].asInt(), - deviceConfig.get("delayAfterConnect",500).asInt() - ); - } - #ifdef ENABLE_SPIDEV - else if (type == "lpd6803" || type == "ldp6803") - { - device = new LedDeviceLpd6803( - deviceConfig["output"].asString(), - deviceConfig["rate"].asInt() - ); - } - else if (type == "lpd8806" || type == "ldp8806") - { - device = new LedDeviceLpd8806( - deviceConfig["output"].asString(), - deviceConfig["rate"].asInt() - ); - } - else if (type == "p9813") - { - device = new LedDeviceP9813( - deviceConfig["output"].asString(), - deviceConfig["rate"].asInt() - ); - } - else if (type == "apa102") - { - device = new LedDeviceAPA102( - deviceConfig["output"].asString(), - deviceConfig["rate"].asInt() - ); - } - else if (type == "ws2801" || type == "lightberry") - { - device = new LedDeviceWs2801( - deviceConfig["output"].asString(), - deviceConfig["rate"].asInt(), - deviceConfig.get("latchtime",500000).asInt(), - deviceConfig.get("spimode",0).asInt(), - deviceConfig.get("invert",false).asBool() - ); - } - else if (type == "ws2812spi") - { - device = new LedDeviceWs2812SPI( - deviceConfig["output"].asString(), - deviceConfig.get("rate",2857143).asInt(), - deviceConfig.get("spimode",0).asInt(), - deviceConfig.get("invert",false).asBool() - ); - } - else if (type == "sk6812rgbw-spi") - { - device = new LedDeviceSk6812SPI( - deviceConfig["output"].asString(), - deviceConfig.get("rate",2857143).asInt(), - deviceConfig.get("white_algorithm","").asString(), - deviceConfig.get("spimode",0).asInt(), - deviceConfig.get("invert",false).asBool() - ); - } - #endif - #ifdef ENABLE_TINKERFORGE - else if (type=="tinkerforge") - { - device = new LedDeviceTinkerforge( - deviceConfig.get("output", "127.0.0.1").asString(), - deviceConfig.get("port", 4223).asInt(), - deviceConfig["uid"].asString(), - deviceConfig["rate"].asInt() - ); - - } - #endif - else if (type == "rawhid") - { - const int delay_ms = deviceConfig["delayAfterConnect"].asInt(); - auto VendorIdString = deviceConfig.get("VID", "0x2341").asString(); - auto ProductIdString = deviceConfig.get("PID", "0x8036").asString(); - - // Convert HEX values to integer - auto VendorId = std::stoul(VendorIdString, nullptr, 16); - auto ProductId = std::stoul(ProductIdString, nullptr, 16); - - device = new LedDeviceRawHID(VendorId, ProductId, delay_ms); - } - else if (type == "lightpack") - { - device = new LedDeviceLightpack( - deviceConfig.get("output", "").asString() - ); - } - else if (type == "multi-lightpack") - { - device = new LedDeviceMultiLightpack(); - } - else if (type == "paintpack") - { - const int delay_ms = deviceConfig["delayAfterConnect"].asInt(); - auto VendorIdString = deviceConfig.get("VID", "0x0EBF").asString(); - auto ProductIdString = deviceConfig.get("PID", "0x0025").asString(); - - // Convert HEX values to integer - auto VendorId = std::stoul(VendorIdString, nullptr, 16); - auto ProductId = std::stoul(ProductIdString, nullptr, 16); - - device = new LedDevicePaintpack(VendorId, ProductId, delay_ms); - } - else if (type == "piblaster") - { - const std::string output = deviceConfig.get("output", "").asString(); - const std::string assignment = deviceConfig.get("assignment", "").asString(); - const Json::Value gpioMapping = deviceConfig.get("gpiomap", Json::nullValue); - - if (! assignment.empty()) + if (dev.first == type) { - throw std::runtime_error("Piblaster: The piblaster configuration syntax has changed in this version."); + device = dev.second(deviceConfig); + LedDevice::setActiveDevice(dev.first); + Info(log,"LedDevice '%s' configured.", dev.first.c_str()); + break; } - if (gpioMapping.isNull()) - { - throw std::runtime_error("Piblaster: no gpiomap defined."); - } - device = new LedDevicePiBlaster(output, gpioMapping); } - else if (type == "sedu") - { - device = new LedDeviceSedu( - deviceConfig["output"].asString(), - deviceConfig["rate"].asInt() - ); - } - else if (type == "hyperion-usbasp-ws2801") - { - device = new LedDeviceHyperionUsbasp(LedDeviceHyperionUsbasp::CMD_WRITE_WS2801); - } - else if (type == "hyperion-usbasp-ws2812") - { - device = new LedDeviceHyperionUsbasp(LedDeviceHyperionUsbasp::CMD_WRITE_WS2812); - } - else if (type == "philipshue") - { - const std::string output = deviceConfig["output"].asString(); - const std::string username = deviceConfig.get("username", "newdeveloper").asString(); - const bool switchOffOnBlack = deviceConfig.get("switchOffOnBlack", true).asBool(); - const int transitiontime = deviceConfig.get("transitiontime", 1).asInt(); - std::vector lightIds; - for (Json::Value::ArrayIndex i = 0; i < deviceConfig["lightIds"].size(); i++) { - lightIds.push_back(deviceConfig["lightIds"][i].asInt()); - } - device = new LedDevicePhilipsHue(output, username, switchOffOnBlack, transitiontime, lightIds); - } - else if (type == "atmoorb") - { - const std::string output = deviceConfig["output"].asString(); - const bool useOrbSmoothing = deviceConfig.get("useOrbSmoothing", false).asBool(); - const int transitiontime = deviceConfig.get("transitiontime", 1).asInt(); - const int skipSmoothingDiff = deviceConfig.get("skipSmoothingDiff", 0).asInt(); - const int port = deviceConfig.get("port", 1).asInt(); - const int numLeds = deviceConfig.get("numLeds", 1).asInt(); - const std::string orbId = deviceConfig["orbIds"].asString(); - std::vector orbIds; - - // If we find multiple Orb ids separate them and add to list - const std::string separator (","); - if (orbId.find(separator) != std::string::npos) { - std::stringstream ss(orbId); - std::vector output; - unsigned int i; - while (ss >> i) { - orbIds.push_back(i); - if (ss.peek() == ',' || ss.peek() == ' ') - ss.ignore(); - } - } - else - { - orbIds.push_back(atoi(orbId.c_str())); - } - - device = new LedDeviceAtmoOrb(output, useOrbSmoothing, transitiontime, skipSmoothingDiff, port, numLeds, orbIds); - } - else if (type == "fadecandy") - { - device = new LedDeviceFadeCandy(deviceConfig); - } - else if (type == "udp") - { - device = new LedDeviceUdp( - deviceConfig["output"].asString(), - deviceConfig["protocol"].asInt(), - deviceConfig["maxpacket"].asInt() - ); - } - else if (type == "udpraw") - { - device = new LedDeviceUdpRaw( - deviceConfig["output"].asString(), - deviceConfig.get("latchtime",500000).asInt() - ); - } - else if (type == "e131") - { - device = new LedDeviceUdpE131( - deviceConfig["output"].asString(), - deviceConfig.get("latchtime",104000).asInt(), - deviceConfig.get("universe",1).asInt() - ); - } - else if (type == "tpm2") - { - device = new LedDeviceTpm2( - deviceConfig["output"].asString(), - deviceConfig["rate"].asInt() - ); - } - else if (type == "atmo") - { - device = new LedDeviceAtmo( - deviceConfig["output"].asString(), - 38400 - ); - } - #ifdef ENABLE_WS2812BPWM - else if (type == "ws2812b") - { - device = new LedDeviceWS2812b(); - } - #endif - #ifdef ENABLE_WS281XPWM - else if (type == "ws281x") - { - device = new LedDeviceWS281x( - deviceConfig.get("gpio", 18).asInt(), - deviceConfig.get("leds", 256).asInt(), - deviceConfig.get("freq", (Json::UInt)800000ul).asInt(), - deviceConfig.get("dmanum", 5).asInt(), - deviceConfig.get("pwmchannel", 0).asInt(), - deviceConfig.get("invert", 0).asInt(), - deviceConfig.get("rgbw", 0).asInt(), - deviceConfig.get("white_algorithm","").asString() - ); - } - #endif - else if (type == "file") - { - device = new LedDeviceFile( deviceConfig.get("output", "/dev/null").asString() ); - } - else + + if (device == nullptr) { Error(log, "Dummy device used, because configured device '%s' is unknown", type.c_str() ); throw std::runtime_error("unknown device"); } } - catch(std::exception e) + catch(std::exception& e) { Error(log, "Dummy device used, because configured device '%s' throws error '%s'", type.c_str(), e.what()); - device = new LedDeviceFile( "/dev/null" ); + const Json::Value dummyDeviceConfig; + device = LedDeviceFile::construct(Json::nullValue); } device->open(); diff --git a/libsrc/leddevice/LedDeviceFadeCandy.cpp b/libsrc/leddevice/LedDeviceFadeCandy.cpp index f71d02c9..671bde35 100644 --- a/libsrc/leddevice/LedDeviceFadeCandy.cpp +++ b/libsrc/leddevice/LedDeviceFadeCandy.cpp @@ -1,6 +1,6 @@ #include "LedDeviceFadeCandy.h" -static const signed MAX_NUM_LEDS = 10000; // OPC can handle 21845 leds - in theory, fadecandy device should handle 10000 leds +static const signed MAX_NUM_LEDS = 10000; // OPC can handle 21845 leds - in theory, fadecandy device should handle 10000 leds static const unsigned OPC_SET_PIXELS = 0; // OPC command codes static const unsigned OPC_SYS_EX = 255; // OPC command codes static const unsigned OPC_HEADER_SIZE = 4; // OPC header size @@ -10,13 +10,6 @@ LedDeviceFadeCandy::LedDeviceFadeCandy(const Json::Value &deviceConfig) : LedDevice() { setConfig(deviceConfig); - _opc_data.resize( OPC_HEADER_SIZE ); - _opc_data[0] = _channel; - _opc_data[1] = OPC_SET_PIXELS; - _opc_data[2] = 0; - _opc_data[3] = 0; - - } @@ -25,8 +18,16 @@ LedDeviceFadeCandy::~LedDeviceFadeCandy() _client.close(); } +LedDevice* LedDeviceFadeCandy::construct(const Json::Value &deviceConfig) +{ + return new LedDeviceFadeCandy(deviceConfig); +} + + bool LedDeviceFadeCandy::setConfig(const Json::Value &deviceConfig) { + _client.close(); + _host = deviceConfig.get("output", "127.0.0.1").asString(); _port = deviceConfig.get("port", 7890).asInt(); _channel = deviceConfig.get("channel", 0).asInt(); @@ -49,6 +50,12 @@ bool LedDeviceFadeCandy::setConfig(const Json::Value &deviceConfig) _whitePoint_b = whitePointConfig[2].asDouble(); } + _opc_data.resize( OPC_HEADER_SIZE ); + _opc_data[0] = _channel; + _opc_data[1] = OPC_SET_PIXELS; + _opc_data[2] = 0; + _opc_data[3] = 0; + return true; } diff --git a/libsrc/leddevice/LedDeviceFadeCandy.h b/libsrc/leddevice/LedDeviceFadeCandy.h index 7a534cee..cd55958c 100644 --- a/libsrc/leddevice/LedDeviceFadeCandy.h +++ b/libsrc/leddevice/LedDeviceFadeCandy.h @@ -7,7 +7,6 @@ // Leddevice includes #include -#include /// /// Implementation of the LedDevice interface for sending to @@ -48,6 +47,9 @@ public: /// virtual ~LedDeviceFadeCandy(); + /// constructs leddevice + static LedDevice* construct(const Json::Value &deviceConfig); + /// /// Sets configuration /// @@ -66,7 +68,6 @@ public: /// Switch the leds off virtual int switchOff(); - private: QTcpSocket _client; std::string _host; @@ -115,3 +116,4 @@ private: void sendFadeCandyConfiguration(); }; + diff --git a/libsrc/leddevice/LedDeviceFile.cpp b/libsrc/leddevice/LedDeviceFile.cpp index 3f60b40b..93ad3022 100644 --- a/libsrc/leddevice/LedDeviceFile.cpp +++ b/libsrc/leddevice/LedDeviceFile.cpp @@ -2,16 +2,32 @@ // Local-Hyperion includes #include "LedDeviceFile.h" -LedDeviceFile::LedDeviceFile(const std::string& output) +LedDeviceFile::LedDeviceFile(const Json::Value &deviceConfig) : LedDevice() - , _ofs( output.empty() ? "/dev/null" : output.c_str()) { - // empty + setConfig(deviceConfig); } LedDeviceFile::~LedDeviceFile() { - // empty +} + +LedDevice* LedDeviceFile::construct(const Json::Value &deviceConfig) +{ + return new LedDeviceFile(deviceConfig); +} + +bool LedDeviceFile::setConfig(const Json::Value &deviceConfig) +{ + if ( _ofs.is_open() ) + { + _ofs.close(); + } + + std::string fileName = deviceConfig.get("output","/dev/null").asString(); + _ofs.open( fileName.c_str() ); + + return true; } int LedDeviceFile::write(const std::vector & ledValues) diff --git a/libsrc/leddevice/LedDeviceFile.h b/libsrc/leddevice/LedDeviceFile.h index ef7a54f7..282a7110 100644 --- a/libsrc/leddevice/LedDeviceFile.h +++ b/libsrc/leddevice/LedDeviceFile.h @@ -14,15 +14,27 @@ class LedDeviceFile : public LedDevice { public: /// - /// Constructs the test-device, which opens an output stream to the file + /// Constructs specific LedDevice /// - LedDeviceFile(const std::string& output); + /// @param deviceConfig json device config + /// + LedDeviceFile(const Json::Value &deviceConfig); /// /// Destructor of this test-device /// virtual ~LedDeviceFile(); + /// constructs leddevice + static LedDevice* construct(const Json::Value &deviceConfig); + + /// + /// Sets configuration + /// + /// @param deviceConfig the json device config + /// @return true if success + virtual bool setConfig(const Json::Value &deviceConfig); + /// /// Writes the given led-color values to the output stream /// diff --git a/libsrc/leddevice/LedDeviceHyperionUsbasp.cpp b/libsrc/leddevice/LedDeviceHyperionUsbasp.cpp index add361a9..f3aa6aaa 100644 --- a/libsrc/leddevice/LedDeviceHyperionUsbasp.cpp +++ b/libsrc/leddevice/LedDeviceHyperionUsbasp.cpp @@ -11,12 +11,12 @@ uint16_t LedDeviceHyperionUsbasp::_usbProductId = 0x05dc; std::string LedDeviceHyperionUsbasp::_usbProductDescription = "Hyperion led controller"; -LedDeviceHyperionUsbasp::LedDeviceHyperionUsbasp(uint8_t writeLedsCommand) +LedDeviceHyperionUsbasp::LedDeviceHyperionUsbasp(const Json::Value &deviceConfig) : LedDevice() - , _writeLedsCommand(writeLedsCommand) , _libusbContext(nullptr) , _deviceHandle(nullptr) { + setConfig(deviceConfig); } LedDeviceHyperionUsbasp::~LedDeviceHyperionUsbasp() @@ -37,6 +37,25 @@ LedDeviceHyperionUsbasp::~LedDeviceHyperionUsbasp() } } +bool LedDeviceHyperionUsbasp::setConfig(const Json::Value &deviceConfig) +{ + std::string ledType = deviceConfig.get("output", "ws2801").asString(); + if (ledType != "ws2801" && ledType != "ws2812") + { + throw std::runtime_error("HyperionUsbasp: invalid output; must be 'ws2801' or 'ws2812'."); + } + + _writeLedsCommand = (ledType == "ws2801") ? CMD_WRITE_WS2801 : CMD_WRITE_WS2812; + + return true; +} + +LedDevice* LedDeviceHyperionUsbasp::construct(const Json::Value &deviceConfig) +{ + return new LedDeviceHyperionUsbasp(deviceConfig); +} + + int LedDeviceHyperionUsbasp::open() { int error; diff --git a/libsrc/leddevice/LedDeviceHyperionUsbasp.h b/libsrc/leddevice/LedDeviceHyperionUsbasp.h index 1471f1bd..7e9d0da2 100644 --- a/libsrc/leddevice/LedDeviceHyperionUsbasp.h +++ b/libsrc/leddevice/LedDeviceHyperionUsbasp.h @@ -24,9 +24,21 @@ public: }; /// - /// Constructs the LedDeviceLightpack + /// Constructs specific LedDevice /// - LedDeviceHyperionUsbasp(uint8_t writeLedsCommand); + /// @param deviceConfig json device config + /// + LedDeviceHyperionUsbasp(const Json::Value &deviceConfig); + + /// + /// Sets configuration + /// + /// @param deviceConfig the json device config + /// @return true if success + bool setConfig(const Json::Value &deviceConfig); + + /// constructs leddevice + static LedDevice* construct(const Json::Value &deviceConfig); /// /// Destructor of the LedDevice; closes the output device if it is open @@ -70,7 +82,7 @@ private: private: /// command to write the leds - const uint8_t _writeLedsCommand; + uint8_t _writeLedsCommand; /// libusb context libusb_context * _libusbContext; diff --git a/libsrc/leddevice/LedDeviceLightpack.cpp b/libsrc/leddevice/LedDeviceLightpack.cpp index 43fc6fd3..80677244 100644 --- a/libsrc/leddevice/LedDeviceLightpack.cpp +++ b/libsrc/leddevice/LedDeviceLightpack.cpp @@ -45,6 +45,12 @@ LedDeviceLightpack::LedDeviceLightpack(const std::string & serialNumber) _ledCount = -1; } +LedDeviceLightpack::LedDeviceLightpack(const Json::Value &deviceConfig) + : LedDeviceLightpack() +{ + setConfig(deviceConfig); +} + LedDeviceLightpack::~LedDeviceLightpack() { if (_deviceHandle != nullptr) @@ -63,6 +69,18 @@ LedDeviceLightpack::~LedDeviceLightpack() } } +bool LedDeviceLightpack::setConfig(const Json::Value &deviceConfig) +{ + _serialNumber = deviceConfig.get("output", "").asString(); + + return true; +} + +LedDevice* LedDeviceLightpack::construct(const Json::Value &deviceConfig) +{ + return new LedDeviceLightpack(deviceConfig); +} + int LedDeviceLightpack::open() { int error; diff --git a/libsrc/leddevice/LedDeviceLightpack.h b/libsrc/leddevice/LedDeviceLightpack.h index 9c2f48b6..8c530094 100644 --- a/libsrc/leddevice/LedDeviceLightpack.h +++ b/libsrc/leddevice/LedDeviceLightpack.h @@ -23,6 +23,22 @@ public: /// @param serialNumber serial output device /// LedDeviceLightpack(const std::string & serialNumber = ""); + /// + /// Constructs specific LedDevice + /// + /// @param deviceConfig json device config + /// + LedDeviceLightpack(const Json::Value &deviceConfig); + + /// + /// Sets configuration + /// + /// @param deviceConfig the json device config + /// @return true if success + bool setConfig(const Json::Value &deviceConfig); + + /// constructs leddevice + static LedDevice* construct(const Json::Value &deviceConfig); /// /// Destructor of the LedDevice; closes the output device if it is open diff --git a/libsrc/leddevice/LedDeviceLpd6803.cpp b/libsrc/leddevice/LedDeviceLpd6803.cpp index 53f26950..13ca4d93 100644 --- a/libsrc/leddevice/LedDeviceLpd6803.cpp +++ b/libsrc/leddevice/LedDeviceLpd6803.cpp @@ -10,11 +10,16 @@ // hyperion local includes #include "LedDeviceLpd6803.h" -LedDeviceLpd6803::LedDeviceLpd6803(const std::string& outputDevice, const unsigned baudrate) - : LedSpiDevice(outputDevice, baudrate) +LedDeviceLpd6803::LedDeviceLpd6803(const Json::Value &deviceConfig) + : LedSpiDevice(deviceConfig) { } +LedDevice* LedDeviceLpd6803::construct(const Json::Value &deviceConfig) +{ + return new LedDeviceLpd6803(deviceConfig); +} + int LedDeviceLpd6803::write(const std::vector &ledValues) { unsigned messageLength = 4 + 2*ledValues.size() + ledValues.size()/8 + 1; diff --git a/libsrc/leddevice/LedDeviceLpd6803.h b/libsrc/leddevice/LedDeviceLpd6803.h index 3ec28ed5..9ed64125 100644 --- a/libsrc/leddevice/LedDeviceLpd6803.h +++ b/libsrc/leddevice/LedDeviceLpd6803.h @@ -18,12 +18,14 @@ class LedDeviceLpd6803 : public LedSpiDevice { public: /// - /// Constructs the LedDevice for a string containing leds of the type LDP6803 + /// Constructs specific LedDevice /// - /// @param[in] outputDevice The name of the output device (eg '/dev/spidev0.0') - /// @param[in] baudrate The used baudrate for writing to the output device + /// @param deviceConfig json device config /// - LedDeviceLpd6803(const std::string& outputDevice, const unsigned baudrate); + LedDeviceLpd6803(const Json::Value &deviceConfig); + + /// constructs leddevice + static LedDevice* construct(const Json::Value &deviceConfig); /// /// Writes the led color values to the led-device diff --git a/libsrc/leddevice/LedDeviceLpd8806.cpp b/libsrc/leddevice/LedDeviceLpd8806.cpp index 62cc8e36..ba096c98 100644 --- a/libsrc/leddevice/LedDeviceLpd8806.cpp +++ b/libsrc/leddevice/LedDeviceLpd8806.cpp @@ -10,10 +10,14 @@ // hyperion local includes #include "LedDeviceLpd8806.h" -LedDeviceLpd8806::LedDeviceLpd8806(const std::string& outputDevice, const unsigned baudrate) - : LedSpiDevice(outputDevice, baudrate) +LedDeviceLpd8806::LedDeviceLpd8806(const Json::Value &deviceConfig) + : LedSpiDevice(deviceConfig) { - // empty +} + +LedDevice* LedDeviceLpd8806::construct(const Json::Value &deviceConfig) +{ + return new LedDeviceLpd8806(deviceConfig); } int LedDeviceLpd8806::write(const std::vector &ledValues) diff --git a/libsrc/leddevice/LedDeviceLpd8806.h b/libsrc/leddevice/LedDeviceLpd8806.h index 114747b3..ca87f3e2 100644 --- a/libsrc/leddevice/LedDeviceLpd8806.h +++ b/libsrc/leddevice/LedDeviceLpd8806.h @@ -79,12 +79,14 @@ class LedDeviceLpd8806 : public LedSpiDevice { public: /// - /// Constructs the LedDevice for a string containing leds of the type LPD8806 + /// Constructs specific LedDevice /// - /// @param[in] outputDevice The name of the output device (eg '/dev/spidev0.0') - /// @param[in] baudrate The used baudrate for writing to the output device + /// @param deviceConfig json device config /// - LedDeviceLpd8806(const std::string& outputDevice, const unsigned baudrate); + LedDeviceLpd8806(const Json::Value &deviceConfig); + + /// constructs leddevice + static LedDevice* construct(const Json::Value &deviceConfig); /// /// Writes the led color values to the led-device diff --git a/libsrc/leddevice/LedDeviceMultiLightpack.cpp b/libsrc/leddevice/LedDeviceMultiLightpack.cpp index 1104f5bf..2092bcb1 100644 --- a/libsrc/leddevice/LedDeviceMultiLightpack.cpp +++ b/libsrc/leddevice/LedDeviceMultiLightpack.cpp @@ -17,7 +17,7 @@ bool compareLightpacks(LedDeviceLightpack * lhs, LedDeviceLightpack * rhs) return lhs->getSerialNumber() < rhs->getSerialNumber(); } -LedDeviceMultiLightpack::LedDeviceMultiLightpack() +LedDeviceMultiLightpack::LedDeviceMultiLightpack(const Json::Value &) : LedDevice() , _lightpacks() { @@ -31,6 +31,11 @@ LedDeviceMultiLightpack::~LedDeviceMultiLightpack() } } +LedDevice* LedDeviceMultiLightpack::construct(const Json::Value &deviceConfig) +{ + return new LedDeviceMultiLightpack(deviceConfig); +} + int LedDeviceMultiLightpack::open() { // retrieve a list with Lightpack serials diff --git a/libsrc/leddevice/LedDeviceMultiLightpack.h b/libsrc/leddevice/LedDeviceMultiLightpack.h index 65e0d1d6..858e9cd9 100644 --- a/libsrc/leddevice/LedDeviceMultiLightpack.h +++ b/libsrc/leddevice/LedDeviceMultiLightpack.h @@ -20,15 +20,20 @@ class LedDeviceMultiLightpack : public LedDevice { public: /// - /// Constructs the LedDeviceMultiLightpack + /// Constructs specific LedDevice /// - LedDeviceMultiLightpack(); + /// @param deviceConfig json device config + /// + LedDeviceMultiLightpack(const Json::Value &); /// /// Destructor of the LedDevice; closes the output device if it is open /// virtual ~LedDeviceMultiLightpack(); + /// constructs leddevice + static LedDevice* construct(const Json::Value &deviceConfig); + /// /// Opens and configures the output device7 /// diff --git a/libsrc/leddevice/LedDeviceP9813.cpp b/libsrc/leddevice/LedDeviceP9813.cpp index d3142465..9e3e5a40 100644 --- a/libsrc/leddevice/LedDeviceP9813.cpp +++ b/libsrc/leddevice/LedDeviceP9813.cpp @@ -11,10 +11,14 @@ // hyperion local includes #include "LedDeviceP9813.h" -LedDeviceP9813::LedDeviceP9813(const std::string& outputDevice, const unsigned baudrate) - : LedSpiDevice(outputDevice, baudrate, 0) +LedDeviceP9813::LedDeviceP9813(const Json::Value &deviceConfig) + : LedSpiDevice(deviceConfig) { - // empty +} + +LedDevice* LedDeviceP9813::construct(const Json::Value &deviceConfig) +{ + return new LedDeviceP9813(deviceConfig); } int LedDeviceP9813::write(const std::vector &ledValues) diff --git a/libsrc/leddevice/LedDeviceP9813.h b/libsrc/leddevice/LedDeviceP9813.h index 97fba0e0..54236d2e 100644 --- a/libsrc/leddevice/LedDeviceP9813.h +++ b/libsrc/leddevice/LedDeviceP9813.h @@ -13,12 +13,14 @@ class LedDeviceP9813 : public LedSpiDevice { public: /// - /// Constructs the LedDevice for a string containing leds of the type P9813 + /// Constructs specific LedDevice /// - /// @param outputDevice The name of the output device (eg '/etc/SpiDev.0.0') - /// @param baudrate The used baudrate for writing to the output device + /// @param deviceConfig json device config /// - LedDeviceP9813(const std::string& outputDevice, const unsigned baudrate); + LedDeviceP9813(const Json::Value &deviceConfig); + + /// constructs leddevice + static LedDevice* construct(const Json::Value &deviceConfig); /// /// Writes the led color values to the led-device diff --git a/libsrc/leddevice/LedDevicePaintpack.cpp b/libsrc/leddevice/LedDevicePaintpack.cpp index b97665e8..b27126f5 100644 --- a/libsrc/leddevice/LedDevicePaintpack.cpp +++ b/libsrc/leddevice/LedDevicePaintpack.cpp @@ -3,12 +3,16 @@ #include "LedDevicePaintpack.h" // Use out report HID device -LedDevicePaintpack::LedDevicePaintpack(const unsigned short VendorId, const unsigned short ProductId, int delayAfterConnect_ms) - : LedHIDDevice(VendorId, ProductId, delayAfterConnect_ms, false) +LedDevicePaintpack::LedDevicePaintpack(const Json::Value &deviceConfig) + : LedHIDDevice(deviceConfig) { - // empty + _useFeature = false; } +LedDevice* LedDevicePaintpack::construct(const Json::Value &deviceConfig) +{ + return new LedDevicePaintpack(deviceConfig); +} int LedDevicePaintpack::write(const std::vector & ledValues) { diff --git a/libsrc/leddevice/LedDevicePaintpack.h b/libsrc/leddevice/LedDevicePaintpack.h index d535c262..cdfaac83 100644 --- a/libsrc/leddevice/LedDevicePaintpack.h +++ b/libsrc/leddevice/LedDevicePaintpack.h @@ -12,10 +12,15 @@ class LedDevicePaintpack : public LedHIDDevice { public: - /** - * Constructs the paintpack device - */ - LedDevicePaintpack(const unsigned short VendorId, const unsigned short ProductId, int delayAfterConnect_ms); + /// + /// Constructs specific LedDevice + /// + /// @param deviceConfig json device config + /// + LedDevicePaintpack(const Json::Value &deviceConfig); + + /// constructs leddevice + static LedDevice* construct(const Json::Value &deviceConfig); /// /// Writes the RGB-Color values to the leds. diff --git a/libsrc/leddevice/LedDevicePhilipsHue.cpp b/libsrc/leddevice/LedDevicePhilipsHue.cpp index c5db336b..66652946 100755 --- a/libsrc/leddevice/LedDevicePhilipsHue.cpp +++ b/libsrc/leddevice/LedDevicePhilipsHue.cpp @@ -164,14 +164,11 @@ CiColor PhilipsHueLight::rgbToCiColor(float red, float green, float blue) return xy; } -LedDevicePhilipsHue::LedDevicePhilipsHue(const std::string& output, const std::string& username, bool switchOffOnBlack, int transitiontime, std::vector lightIds) +LedDevicePhilipsHue::LedDevicePhilipsHue(const Json::Value &deviceConfig) : LedDevice() - , host(output.c_str()) - , username(username.c_str()) - , switchOffOnBlack(switchOffOnBlack) - , transitiontime(transitiontime) - , lightIds(lightIds) { + setConfig(deviceConfig); + manager = new QNetworkAccessManager(); timer.setInterval(3000); timer.setSingleShot(true); @@ -183,6 +180,26 @@ LedDevicePhilipsHue::~LedDevicePhilipsHue() delete manager; } +bool LedDevicePhilipsHue::setConfig(const Json::Value &deviceConfig) +{ + host = deviceConfig["output"].asString().c_str(); + username = deviceConfig.get("username", "newdeveloper").asString().c_str(); + switchOffOnBlack = deviceConfig.get("switchOffOnBlack", true).asBool(); + transitiontime = deviceConfig.get("transitiontime", 1).asInt(); + lightIds.clear(); + for (Json::Value::ArrayIndex i = 0; i < deviceConfig["lightIds"].size(); i++) + { + lightIds.push_back(deviceConfig["lightIds"][i].asInt()); + } + + return true; +} + +LedDevice* LedDevicePhilipsHue::construct(const Json::Value &deviceConfig) +{ + return new LedDevicePhilipsHue(deviceConfig); +} + int LedDevicePhilipsHue::write(const std::vector & ledValues) { // Save light states if not done before. diff --git a/libsrc/leddevice/LedDevicePhilipsHue.h b/libsrc/leddevice/LedDevicePhilipsHue.h index 3b60bb69..5d374a24 100755 --- a/libsrc/leddevice/LedDevicePhilipsHue.h +++ b/libsrc/leddevice/LedDevicePhilipsHue.h @@ -115,22 +115,27 @@ class LedDevicePhilipsHue: public LedDevice { public: /// - /// Constructs the device. + /// Constructs specific LedDevice /// - /// @param output the ip address of the bridge - /// @param username username of the hue bridge (default: newdeveloper) - /// @param switchOffOnBlack kill lights for black (default: false) - /// @param transitiontime the time duration a light change takes in multiples of 100 ms (default: 400 ms). - /// @param lightIds light ids of the lights to control if not starting at one in ascending order. + /// @param deviceConfig json device config /// - LedDevicePhilipsHue(const std::string& output, const std::string& username = "newdeveloper", bool switchOffOnBlack = - false, int transitiontime = 1, std::vector lightIds = std::vector()); + LedDevicePhilipsHue(const Json::Value &deviceConfig); /// /// Destructor of this device /// virtual ~LedDevicePhilipsHue(); + /// + /// Sets configuration + /// + /// @param deviceConfig the json device config + /// @return true if success + bool setConfig(const Json::Value &deviceConfig); + + /// constructs leddevice + static LedDevice* construct(const Json::Value &deviceConfig); + /// /// Sends the given led-color values via put request to the hue system /// diff --git a/libsrc/leddevice/LedDevicePiBlaster.cpp b/libsrc/leddevice/LedDevicePiBlaster.cpp index 072a5be8..b4775ee0 100644 --- a/libsrc/leddevice/LedDevicePiBlaster.cpp +++ b/libsrc/leddevice/LedDevicePiBlaster.cpp @@ -13,11 +13,9 @@ // Local LedDevice includes #include "LedDevicePiBlaster.h" -LedDevicePiBlaster::LedDevicePiBlaster(const std::string & deviceName, const Json::Value & gpioMapping) - : _deviceName(deviceName) - , _fid(nullptr) +LedDevicePiBlaster::LedDevicePiBlaster(const Json::Value &deviceConfig) + : _fid(nullptr) { - signal(SIGPIPE, SIG_IGN); // initialise the mapping tables @@ -32,7 +30,31 @@ LedDevicePiBlaster::LedDevicePiBlaster(const std::string & deviceName, const Jso _gpio_to_color[i] = 'z'; } -// walk through the json config and populate the mapping tables + setConfig(deviceConfig); +} + +LedDevicePiBlaster::~LedDevicePiBlaster() +{ + // Close the device (if it is opened) + if (_fid != nullptr) + { + fclose(_fid); + _fid = nullptr; + } +} + + +bool LedDevicePiBlaster::setConfig(const Json::Value &deviceConfig) +{ + _deviceName = deviceConfig.get("output", "").asString(); + Json::Value gpioMapping = deviceConfig.get("gpiomap", Json::nullValue); + + if (gpioMapping.isNull()) + { + throw std::runtime_error("Piblaster: no gpiomap defined."); + } + + // walk through the json config and populate the mapping tables for (const Json::Value& gpioMap : gpioMapping) { const int gpio = gpioMap.get("gpio",-1).asInt(); @@ -47,16 +69,12 @@ LedDevicePiBlaster::LedDevicePiBlaster(const std::string & deviceName, const Jso Warning( _log, "IGNORING gpio %d ledindex %d color %c", gpio,ledindex, ledcolor[0]); } } + return true; } -LedDevicePiBlaster::~LedDevicePiBlaster() +LedDevice* LedDevicePiBlaster::construct(const Json::Value &deviceConfig) { - // Close the device (if it is opened) - if (_fid != nullptr) - { - fclose(_fid); - _fid = nullptr; - } + return new LedDevicePiBlaster(deviceConfig); } int LedDevicePiBlaster::open() diff --git a/libsrc/leddevice/LedDevicePiBlaster.h b/libsrc/leddevice/LedDevicePiBlaster.h index b61bc0b3..d1189e5b 100644 --- a/libsrc/leddevice/LedDevicePiBlaster.h +++ b/libsrc/leddevice/LedDevicePiBlaster.h @@ -14,15 +14,24 @@ class LedDevicePiBlaster : public LedDevice { public: /// - /// Constructs the PiBlaster device which writes to the indicated device and for the assigned - /// channels - /// @param deviceName The name of the output device - /// @param gpioMapping The RGB-Channel assignment json object + /// Constructs specific LedDevice /// - LedDevicePiBlaster(const std::string & deviceName, const Json::Value & gpioMapping); + /// @param deviceConfig json device config + /// + LedDevicePiBlaster(const Json::Value &deviceConfig); virtual ~LedDevicePiBlaster(); + /// + /// Sets configuration + /// + /// @param deviceConfig the json device config + /// @return true if success + bool setConfig(const Json::Value &deviceConfig); + + /// constructs leddevice + static LedDevice* construct(const Json::Value &deviceConfig); + /// /// Attempts to open the piblaster-device. This will only succeed if the device is not yet open /// and the device is available. @@ -50,7 +59,7 @@ public: private: /// The name of the output device (very likely '/dev/pi-blaster') - const std::string _deviceName; + std::string _deviceName; int _gpio_to_led[64]; char _gpio_to_color[64]; diff --git a/libsrc/leddevice/LedDeviceRawHID.cpp b/libsrc/leddevice/LedDeviceRawHID.cpp index 5fd1b5ba..13a4b10d 100644 --- a/libsrc/leddevice/LedDeviceRawHID.cpp +++ b/libsrc/leddevice/LedDeviceRawHID.cpp @@ -12,10 +12,12 @@ #include "LedDeviceRawHID.h" // Use feature report HID device -LedDeviceRawHID::LedDeviceRawHID(const unsigned short VendorId, const unsigned short ProductId, int delayAfterConnect_ms) - : LedHIDDevice(VendorId, ProductId, delayAfterConnect_ms, true) +LedDeviceRawHID::LedDeviceRawHID(const Json::Value &deviceConfig) + : LedHIDDevice(deviceConfig) , _timer() { + _useFeature = true; + // setup the timer _timer.setSingleShot(false); _timer.setInterval(5000); @@ -25,6 +27,11 @@ LedDeviceRawHID::LedDeviceRawHID(const unsigned short VendorId, const unsigned s _timer.start(); } +LedDevice* LedDeviceRawHID::construct(const Json::Value &deviceConfig) +{ + return new LedDeviceRawHID(deviceConfig); +} + int LedDeviceRawHID::write(const std::vector & ledValues) { // Resize buffer if required diff --git a/libsrc/leddevice/LedDeviceRawHID.h b/libsrc/leddevice/LedDeviceRawHID.h index d0a8e04c..6e2d63ae 100644 --- a/libsrc/leddevice/LedDeviceRawHID.h +++ b/libsrc/leddevice/LedDeviceRawHID.h @@ -18,9 +18,14 @@ class LedDeviceRawHID : public LedHIDDevice public: /// - /// Constructs the LedDevice for attached RawHID device + /// Constructs specific LedDevice /// - LedDeviceRawHID(const unsigned short VendorId, const unsigned short ProductId, int delayAfterConnect_ms); + /// @param deviceConfig json device config + /// + LedDeviceRawHID(const Json::Value &deviceConfig); + + /// constructs leddevice + static LedDevice* construct(const Json::Value &deviceConfig); /// /// Writes the led color values to the led-device diff --git a/libsrc/leddevice/LedDeviceSchemas.qrc b/libsrc/leddevice/LedDeviceSchemas.qrc new file mode 100644 index 00000000..4e7f956d --- /dev/null +++ b/libsrc/leddevice/LedDeviceSchemas.qrc @@ -0,0 +1,31 @@ + + + schemas/schema-adalightapa102.json + schemas/schema-adalight.json + schemas/schema-apa102.json + schemas/schema-atmo.json + schemas/schema-atmoorb.json + schemas/schema-e131.json + schemas/schema-fadecandy.json + schemas/schema-file.json + schemas/schema-hyperion-usbasp.json + schemas/schema-lightpack.json + schemas/schema-lpd6803.json + schemas/schema-lpd8806.json + schemas/schema-multi-lightpack.json + schemas/schema-p9813.json + schemas/schema-paintpack.json + schemas/schema-philipshue.json + schemas/schema-piblaster.json + schemas/schema-rawhid.json + schemas/schema-sedu.json + schemas/schema-sk6812rgbw-spi.json + schemas/schema-tinkerforge.json + schemas/schema-tmp2net.json + schemas/schema-tpm2.json + schemas/schema-udpraw.json + schemas/schema-ws2801.json + schemas/schema-ws2812spi.json + schemas/schema-ws281x.json + + diff --git a/libsrc/leddevice/LedDeviceSedu.cpp b/libsrc/leddevice/LedDeviceSedu.cpp index 7293dd27..54a4e216 100644 --- a/libsrc/leddevice/LedDeviceSedu.cpp +++ b/libsrc/leddevice/LedDeviceSedu.cpp @@ -17,12 +17,17 @@ struct FrameSpec size_t size; }; -LedDeviceSedu::LedDeviceSedu(const std::string& outputDevice, const unsigned baudrate) - : LedRs232Device(outputDevice, baudrate) +LedDeviceSedu::LedDeviceSedu(const Json::Value &deviceConfig) + : LedRs232Device(deviceConfig) { // empty } +LedDevice* LedDeviceSedu::construct(const Json::Value &deviceConfig) +{ + return new LedDeviceSedu(deviceConfig); +} + int LedDeviceSedu::write(const std::vector &ledValues) { if (_ledBuffer.size() == 0) diff --git a/libsrc/leddevice/LedDeviceSedu.h b/libsrc/leddevice/LedDeviceSedu.h index dda0a58d..e83ccceb 100644 --- a/libsrc/leddevice/LedDeviceSedu.h +++ b/libsrc/leddevice/LedDeviceSedu.h @@ -13,12 +13,14 @@ class LedDeviceSedu : public LedRs232Device { public: /// - /// Constructs the LedDevice for attached via SEDU device + /// Constructs specific LedDevice /// - /// @param outputDevice The name of the output device (eg '/dev/ttyS0') - /// @param baudrate The used baudrate for writing to the output device + /// @param deviceConfig json device config /// - LedDeviceSedu(const std::string& outputDevice, const unsigned baudrate); + LedDeviceSedu(const Json::Value &deviceConfig); + + /// constructs leddevice + static LedDevice* construct(const Json::Value &deviceConfig); /// /// Writes the led color values to the led-device diff --git a/libsrc/leddevice/LedDeviceSk6812SPI.cpp b/libsrc/leddevice/LedDeviceSk6812SPI.cpp index 0c5dc3c2..6e25a69d 100644 --- a/libsrc/leddevice/LedDeviceSk6812SPI.cpp +++ b/libsrc/leddevice/LedDeviceSk6812SPI.cpp @@ -11,10 +11,8 @@ // hyperion local includes #include "LedDeviceSk6812SPI.h" -LedDeviceSk6812SPI::LedDeviceSk6812SPI(const std::string& outputDevice, const unsigned baudrate, const std::string& whiteAlgorithm, - const int spiMode, const bool spiDataInvert) - : LedSpiDevice(outputDevice, baudrate, 0, spiMode, spiDataInvert) - , _whiteAlgorithm(whiteAlgorithm) +LedDeviceSk6812SPI::LedDeviceSk6812SPI(const Json::Value &deviceConfig) + : LedSpiDevice(deviceConfig) , bitpair_to_byte { 0b10001000, 0b10001100, @@ -23,7 +21,21 @@ LedDeviceSk6812SPI::LedDeviceSk6812SPI(const std::string& outputDevice, const un } { - Debug( _log, "whiteAlgorithm : %s", whiteAlgorithm.c_str()); + setConfig(deviceConfig); + Debug( _log, "whiteAlgorithm : %s", _whiteAlgorithm.c_str()); +} + +LedDevice* LedDeviceSk6812SPI::construct(const Json::Value &deviceConfig) +{ + return new LedDeviceSk6812SPI(deviceConfig); +} + +bool LedDeviceSk6812SPI::setConfig(const Json::Value &deviceConfig) +{ + LedSpiDevice::setConfig(deviceConfig); + _whiteAlgorithm = deviceConfig.get("white_algorithm","").asString(); + + return true; } int LedDeviceSk6812SPI::write(const std::vector &ledValues) diff --git a/libsrc/leddevice/LedDeviceSk6812SPI.h b/libsrc/leddevice/LedDeviceSk6812SPI.h index d547d367..2f79d26d 100644 --- a/libsrc/leddevice/LedDeviceSk6812SPI.h +++ b/libsrc/leddevice/LedDeviceSk6812SPI.h @@ -13,15 +13,22 @@ class LedDeviceSk6812SPI : public LedSpiDevice { public: /// - /// Constructs the LedDevice for a string containing leds of the type Sk6812SPI + /// Constructs specific LedDevice /// - /// @param outputDevice The name of the output device (eg '/etc/SpiDev.0.0') - /// @param baudrate The used baudrate for writing to the output device + /// @param deviceConfig json device config /// + LedDeviceSk6812SPI(const Json::Value &deviceConfig); - LedDeviceSk6812SPI(const std::string& outputDevice, const unsigned baudrate, - const std::string& whiteAlgorithm, const int spiMode, const bool spiDataInvert); + /// constructs leddevice + static LedDevice* construct(const Json::Value &deviceConfig); + /// + /// Sets configuration + /// + /// @param deviceConfig the json device config + /// @return true if success + bool setConfig(const Json::Value &deviceConfig); + /// /// Writes the led color values to the led-device /// diff --git a/libsrc/leddevice/LedDeviceTinkerforge.cpp b/libsrc/leddevice/LedDeviceTinkerforge.cpp index 972762eb..59ffaf37 100644 --- a/libsrc/leddevice/LedDeviceTinkerforge.cpp +++ b/libsrc/leddevice/LedDeviceTinkerforge.cpp @@ -9,17 +9,13 @@ static const unsigned MAX_NUM_LEDS = 320; static const unsigned MAX_NUM_LEDS_SETTABLE = 16; -LedDeviceTinkerforge::LedDeviceTinkerforge(const std::string & host, uint16_t port, const std::string & uid, const unsigned interval) +LedDeviceTinkerforge::LedDeviceTinkerforge(const Json::Value &deviceConfig) : LedDevice() - , _host(host) - , _port(port) - , _uid(uid) - , _interval(interval) , _ipConnection(nullptr) , _ledStrip(nullptr) , _colorChannelSize(0) { - // empty + setConfig(deviceConfig); } LedDeviceTinkerforge::~LedDeviceTinkerforge() @@ -35,6 +31,21 @@ LedDeviceTinkerforge::~LedDeviceTinkerforge() delete _ledStrip; } +bool LedDeviceTinkerforge::setConfig(const Json::Value &deviceConfig) +{ + _host = deviceConfig.get("output", "127.0.0.1").asString(); + _port = deviceConfig.get("port", 4223).asInt(); + _uid = deviceConfig["uid"].asString(); + _interval = deviceConfig["rate"].asInt(); + + return true; +} + +LedDevice* LedDeviceTinkerforge::construct(const Json::Value &deviceConfig) +{ + return new LedDeviceTinkerforge(deviceConfig); +} + int LedDeviceTinkerforge::open() { // Check if connection is already createds diff --git a/libsrc/leddevice/LedDeviceTinkerforge.h b/libsrc/leddevice/LedDeviceTinkerforge.h index 95f43332..4f3c6dc7 100644 --- a/libsrc/leddevice/LedDeviceTinkerforge.h +++ b/libsrc/leddevice/LedDeviceTinkerforge.h @@ -16,11 +16,25 @@ extern "C" { class LedDeviceTinkerforge : public LedDevice { public: - - LedDeviceTinkerforge(const std::string &host, uint16_t port, const std::string &uid, const unsigned interval); + /// + /// Constructs specific LedDevice + /// + /// @param deviceConfig json device config + /// + LedDeviceTinkerforge(const Json::Value &deviceConfig); virtual ~LedDeviceTinkerforge(); + /// + /// Sets configuration + /// + /// @param deviceConfig the json device config + /// @return true if success + bool setConfig(const Json::Value &deviceConfig); + + /// constructs leddevice + static LedDevice* construct(const Json::Value &deviceConfig); + /// /// Attempts to open a connection to the master bricklet and the led strip bricklet. /// @@ -50,16 +64,16 @@ private: int transferLedData(LEDStrip *ledstrip, unsigned int index, unsigned int length, uint8_t *redChannel, uint8_t *greenChannel, uint8_t *blueChannel); /// The host of the master brick - const std::string _host; + std::string _host; /// The port of the master brick - const uint16_t _port; + uint16_t _port; /// The uid of the led strip bricklet - const std::string _uid; + std::string _uid; /// The interval/rate - const unsigned _interval; + unsigned _interval; /// ip connection handle IPConnection *_ipConnection; diff --git a/libsrc/leddevice/LedDeviceTpm2.cpp b/libsrc/leddevice/LedDeviceTpm2.cpp index bf816a5c..ab5d9c80 100644 --- a/libsrc/leddevice/LedDeviceTpm2.cpp +++ b/libsrc/leddevice/LedDeviceTpm2.cpp @@ -6,11 +6,16 @@ // hyperion local includes #include "LedDeviceTpm2.h" +#include -LedDeviceTpm2::LedDeviceTpm2(const std::string& outputDevice, const unsigned baudrate) - : LedRs232Device(outputDevice, baudrate) +LedDeviceTpm2::LedDeviceTpm2(const Json::Value &deviceConfig) + : LedRs232Device(deviceConfig) { - // empty +} + +LedDevice* LedDeviceTpm2::construct(const Json::Value &deviceConfig) +{ + return new LedDeviceTpm2(deviceConfig); } int LedDeviceTpm2::write(const std::vector &ledValues) diff --git a/libsrc/leddevice/LedDeviceTpm2.h b/libsrc/leddevice/LedDeviceTpm2.h index f6ff7340..dab57be9 100644 --- a/libsrc/leddevice/LedDeviceTpm2.h +++ b/libsrc/leddevice/LedDeviceTpm2.h @@ -13,13 +13,14 @@ class LedDeviceTpm2 : public LedRs232Device { public: /// - /// Constructs the LedDevice for attached serial device using supporting tpm2 protocol - /// All LEDs in the stripe are handled as one frame + /// Constructs specific LedDevice /// - /// @param outputDevice The name of the output device (eg '/dev/ttyAMA0') - /// @param baudrate The used baudrate for writing to the output device + /// @param deviceConfig json device config /// - LedDeviceTpm2(const std::string& outputDevice, const unsigned baudrate); + LedDeviceTpm2(const Json::Value &deviceConfig); + + /// constructs leddevice + static LedDevice* construct(const Json::Value &deviceConfig); /// /// Writes the led color values to the led-device diff --git a/libsrc/leddevice/LedDeviceTpm2net.cpp b/libsrc/leddevice/LedDeviceTpm2net.cpp new file mode 100644 index 00000000..5075f188 --- /dev/null +++ b/libsrc/leddevice/LedDeviceTpm2net.cpp @@ -0,0 +1,63 @@ +// STL includes +#include +#include +#include +#include + +// Local-Hyperion includes +#include "LedDeviceTpm2net.h" + + +LedDeviceTpm2net::LedDeviceTpm2net(const Json::Value &deviceConfig) + : LedDevice() + , _socket(this) +{ + setConfig(deviceConfig); +} + +LedDeviceTpm2net::~LedDeviceTpm2net() +{ +} + +bool LedDeviceTpm2net::setConfig(const Json::Value &deviceConfig) +{ + _host = QHostAddress(QString::fromStdString(deviceConfig.get("output", "127.0.0.1").asString())); + _port = deviceConfig.get("port", 65506).asInt(); + + return true; +} + +LedDevice* LedDeviceTpm2net::construct(const Json::Value &deviceConfig) +{ + return new LedDeviceTpm2net(deviceConfig); +} + +int LedDeviceTpm2net::write(const std::vector & ledValues) +{ + if (_ledBuffer.size() == 0) + { + _ledBuffer.resize(7 + 3*ledValues.size()); + _ledBuffer[0] = 0x9c; // block-start byte TPM.NET + _ledBuffer[1] = 0xDA; + _ledBuffer[2] = ((3 * ledValues.size()) >> 8) & 0xFF; // frame size high byte + _ledBuffer[3] = (3 * ledValues.size()) & 0xFF; // frame size low byte + _ledBuffer[4] = 1; // packets number + _ledBuffer[5] = 1; // Number of packets + _ledBuffer[(int)(7 + 3*ledValues.size()-1)] = 0x36; // block-end byte + } + + // write data + memcpy(6 + _ledBuffer.data(), ledValues.data() /*Max 1,490 bytes*/, ledValues.size() * 3); + + _socket.connectToHost(_host, _port); + _socket.write((const char *)_ledBuffer.data()); + _socket.close(); + + return 0; +} + +int LedDeviceTpm2net::switchOff() +{ + memset(6 + _ledBuffer.data(), 0, _ledBuffer.size() - 5); + return 0; +} diff --git a/libsrc/leddevice/LedDeviceTpm2net.h b/libsrc/leddevice/LedDeviceTpm2net.h new file mode 100644 index 00000000..1f3ec05f --- /dev/null +++ b/libsrc/leddevice/LedDeviceTpm2net.h @@ -0,0 +1,53 @@ +#pragma once + +// STL includes +#include +#include +#include +#include +// Leddevice includes +#include + +/// +class LedDeviceTpm2net : public LedDevice +{ +public: + /// + /// Constructs specific LedDevice + /// + /// @param deviceConfig json device config + /// + LedDeviceTpm2net(const Json::Value &deviceConfig); + + virtual ~LedDeviceTpm2net(); + + /// + /// Sets configuration + /// + /// @param deviceConfig the json device config + /// @return true if success + bool setConfig(const Json::Value &deviceConfig); + + /// constructs leddevice + static LedDevice* construct(const Json::Value &deviceConfig); + + /// + /// Writes the given led-color values to the output stream + /// + /// @param ledValues The color-value per led + /// + /// @return Zero on success else negative + /// + virtual int write(const std::vector & ledValues); + + /// Switch the leds off + virtual int switchOff(); + +private: + /// The host of the master brick + QHostAddress _host; + + /// The port of the master brick + uint16_t _port; + QUdpSocket _socket; +}; diff --git a/libsrc/leddevice/LedDeviceUdpE131.cpp b/libsrc/leddevice/LedDeviceUdpE131.cpp index 813a7382..043a5bb4 100644 --- a/libsrc/leddevice/LedDeviceUdpE131.cpp +++ b/libsrc/leddevice/LedDeviceUdpE131.cpp @@ -12,12 +12,25 @@ // hyperion local includes #include "LedDeviceUdpE131.h" -LedDeviceUdpE131::LedDeviceUdpE131(const std::string& outputDevice, const unsigned latchTime, const unsigned universe) - : LedUdpDevice(outputDevice, latchTime) - , _e131_universe(universe) +LedDeviceUdpE131::LedDeviceUdpE131(const Json::Value &deviceConfig) + : LedUdpDevice(deviceConfig) { - // empty + setConfig(deviceConfig); +} + +bool LedDeviceUdpE131::setConfig(const Json::Value &deviceConfig) +{ + LedUdpDevice::setConfig(deviceConfig); + _LatchTime_ns = deviceConfig.get("latchtime",104000).asInt(); + _e131_universe = deviceConfig.get("universe",1).asInt(); + + return true; +} + +LedDevice* LedDeviceUdpE131::construct(const Json::Value &deviceConfig) +{ + return new LedDeviceUdpE131(deviceConfig); } #define CID "hyperion!\0" diff --git a/libsrc/leddevice/LedDeviceUdpE131.h b/libsrc/leddevice/LedDeviceUdpE131.h index 01a6c04f..700adf29 100644 --- a/libsrc/leddevice/LedDeviceUdpE131.h +++ b/libsrc/leddevice/LedDeviceUdpE131.h @@ -100,13 +100,21 @@ class LedDeviceUdpE131 : public LedUdpDevice { public: /// - /// Constructs the LedDevice for sending led colors via udp + /// Constructs specific LedDevice /// - /// @param outputDevice hostname:port - /// @param latchTime + /// @param deviceConfig json device config /// + LedDeviceUdpE131(const Json::Value &deviceConfig); - LedDeviceUdpE131(const std::string& outputDevice, const unsigned latchTime, const unsigned universe); + /// + /// Sets configuration + /// + /// @param deviceConfig the json device config + /// @return true if success + bool setConfig(const Json::Value &deviceConfig); + + /// constructs leddevice + static LedDevice* construct(const Json::Value &deviceConfig); /// diff --git a/libsrc/leddevice/LedDeviceUdpRaw.cpp b/libsrc/leddevice/LedDeviceUdpRaw.cpp index 3fcb1a64..cbc75bd1 100644 --- a/libsrc/leddevice/LedDeviceUdpRaw.cpp +++ b/libsrc/leddevice/LedDeviceUdpRaw.cpp @@ -11,10 +11,23 @@ // hyperion local includes #include "LedDeviceUdpRaw.h" -LedDeviceUdpRaw::LedDeviceUdpRaw(const std::string& outputDevice, const unsigned latchTime) - : LedUdpDevice(outputDevice, latchTime) +LedDeviceUdpRaw::LedDeviceUdpRaw(const Json::Value &deviceConfig) + : LedUdpDevice(deviceConfig) { - // empty + setConfig(deviceConfig); +} + +bool LedDeviceUdpRaw::setConfig(const Json::Value &deviceConfig) +{ + LedUdpDevice::setConfig(deviceConfig); + _LatchTime_ns = deviceConfig.get("latchtime",500000).asInt(); + + return true; +} + +LedDevice* LedDeviceUdpRaw::construct(const Json::Value &deviceConfig) +{ + return new LedDeviceUdpRaw(deviceConfig); } int LedDeviceUdpRaw::write(const std::vector &ledValues) diff --git a/libsrc/leddevice/LedDeviceUdpRaw.h b/libsrc/leddevice/LedDeviceUdpRaw.h index f56aac01..81f8439b 100644 --- a/libsrc/leddevice/LedDeviceUdpRaw.h +++ b/libsrc/leddevice/LedDeviceUdpRaw.h @@ -13,13 +13,21 @@ class LedDeviceUdpRaw : public LedUdpDevice { public: /// - /// Constructs the LedDevice for sending led colors via udp + /// Constructs specific LedDevice /// - /// @param outputDevice hostname:port - /// @param latchTime + /// @param deviceConfig json device config /// + LedDeviceUdpRaw(const Json::Value &deviceConfig); - LedDeviceUdpRaw(const std::string& outputDevice, const unsigned latchTime); + /// + /// Sets configuration + /// + /// @param deviceConfig the json device config + /// @return true if success + bool setConfig(const Json::Value &deviceConfig); + + /// constructs leddevice + static LedDevice* construct(const Json::Value &deviceConfig); /// /// Writes the led color values to the led-device diff --git a/libsrc/leddevice/LedDeviceWS2812b.cpp b/libsrc/leddevice/LedDeviceWS2812b.cpp index ca7b8ffa..8df215bf 100644 --- a/libsrc/leddevice/LedDeviceWS2812b.cpp +++ b/libsrc/leddevice/LedDeviceWS2812b.cpp @@ -258,6 +258,11 @@ LedDeviceWS2812b::LedDeviceWS2812b() printf("WS2812b init finished \n"); } +LedDevice* LedDeviceWS2812b::construct(const Json::Value &) +{ + return new LedDeviceWS2812b(); +} + #ifdef WS2812_ASM_OPTI // rotate register, used to move the 1 around :-) diff --git a/libsrc/leddevice/LedDeviceWS2812b.h b/libsrc/leddevice/LedDeviceWS2812b.h index c477296d..041a58e3 100644 --- a/libsrc/leddevice/LedDeviceWS2812b.h +++ b/libsrc/leddevice/LedDeviceWS2812b.h @@ -133,10 +133,24 @@ class LedDeviceWS2812b : public LedDevice { public: /// - /// Constructs the LedDevice for a string containing leds of the type WS2812 + /// Constructs specific LedDevice + /// + /// @param deviceConfig json device config + /// LedDeviceWS2812b(); ~LedDeviceWS2812b(); + + /// + /// Sets configuration + /// + /// @param deviceConfig the json device config + /// @return true if success + bool setConfig(const Json::Value&) {}; + + /// constructs leddevice + static LedDevice* construct(const Json::Value &); + /// /// Writes the led color values to the led-device /// diff --git a/libsrc/leddevice/LedDeviceWS281x.cpp b/libsrc/leddevice/LedDeviceWS281x.cpp index 7e49ff39..98e03e11 100644 --- a/libsrc/leddevice/LedDeviceWS281x.cpp +++ b/libsrc/leddevice/LedDeviceWS281x.cpp @@ -4,31 +4,13 @@ #include "LedDeviceWS281x.h" // Constructor -LedDeviceWS281x::LedDeviceWS281x(const int gpio, const int leds, const uint32_t freq, const int dmanum, const int pwmchannel, const int invert, const int rgbw, const std::string& whiteAlgorithm) +LedDeviceWS281x::LedDeviceWS281x(const Json::Value &deviceConfig) : LedDevice() - , _channel(pwmchannel) , _initialized(false) - , _whiteAlgorithm(whiteAlgorithm) { - Debug( _log, "whiteAlgorithm : %s", whiteAlgorithm.c_str()); + setConfig(deviceConfig); + Debug( _log, "whiteAlgorithm : %s", _whiteAlgorithm.c_str()); - _led_string.freq = freq; - _led_string.dmanum = dmanum; - if (pwmchannel != 0 && pwmchannel != 1) - { - throw std::runtime_error("WS281x: invalid PWM channel; must be 0 or 1."); - } - _led_string.channel[_channel].gpionum = gpio; - _led_string.channel[_channel].invert = invert; - _led_string.channel[_channel].count = leds; - _led_string.channel[_channel].brightness = 255; - _led_string.channel[_channel].strip_type = ((rgbw == 1) ? SK6812_STRIP_GRBW : WS2811_STRIP_RGB); - - _led_string.channel[!_channel].gpionum = 0; - _led_string.channel[!_channel].invert = invert; - _led_string.channel[!_channel].count = 0; - _led_string.channel[!_channel].brightness = 0; - _led_string.channel[!_channel].strip_type = WS2811_STRIP_RGB; if (ws2811_init(&_led_string) < 0) { throw std::runtime_error("Unable to initialize ws281x library."); @@ -36,6 +18,38 @@ LedDeviceWS281x::LedDeviceWS281x(const int gpio, const int leds, const uint32_t _initialized = true; } +bool LedDeviceWS281x::setConfig(const Json::Value &deviceConfig) +{ + _whiteAlgorithm = deviceConfig.get("white_algorithm","").asString(); + _channel = deviceConfig.get("pwmchannel", 0).asInt(); + if (_channel != 0 && _channel != 1) + { + throw std::runtime_error("WS281x: invalid PWM channel; must be 0 or 1."); + } + + _led_string.freq = deviceConfig.get("freq", (Json::UInt)800000ul).asInt(); + _led_string.dmanum = deviceConfig.get("dmanum", 5).asInt(); + _led_string.channel[_channel].gpionum = deviceConfig.get("gpio", 18).asInt(); + _led_string.channel[_channel].count = deviceConfig.get("leds", 256).asInt(); + _led_string.channel[_channel].invert = deviceConfig.get("invert", 0).asInt(); + _led_string.channel[_channel].strip_type = ((deviceConfig.get("rgbw", 0).asInt() == 1) ? SK6812_STRIP_GRBW : WS2811_STRIP_RGB); + _led_string.channel[_channel].brightness = 255; + + _led_string.channel[!_channel].gpionum = 0; + _led_string.channel[!_channel].invert = _led_string.channel[_channel].invert; + _led_string.channel[!_channel].count = 0; + _led_string.channel[!_channel].brightness = 0; + _led_string.channel[!_channel].strip_type = WS2811_STRIP_RGB; + + return true; +} + +LedDevice* LedDeviceWS281x::construct(const Json::Value &deviceConfig) +{ + return new LedDeviceWS281x(deviceConfig); +} + + // Send new values down the LED chain int LedDeviceWS281x::write(const std::vector &ledValues) { diff --git a/libsrc/leddevice/LedDeviceWS281x.h b/libsrc/leddevice/LedDeviceWS281x.h index 4cb9a0d2..b622981b 100644 --- a/libsrc/leddevice/LedDeviceWS281x.h +++ b/libsrc/leddevice/LedDeviceWS281x.h @@ -7,24 +7,26 @@ class LedDeviceWS281x : public LedDevice { public: /// - /// Constructs the LedDevice for WS281x (one wire 800kHz) + /// Constructs specific LedDevice /// - /// @param gpio The gpio pin to use (BCM chip counting, default is 18) - /// @param leds The number of leds attached to the gpio pin - /// @param freq The target frequency for the data line, default is 800000 - /// @param dmanum The DMA channel to use, default is 5 - /// @param pwmchannel The pwm channel to use - /// @param invert Invert the output line to support an inverting level shifter - /// @param rgbw Send 32 bit rgbw colour data for sk6812 - + /// @param deviceConfig json device config /// - LedDeviceWS281x(const int gpio, const int leds, const uint32_t freq, int dmanum, int pwmchannel, int invert, - int rgbw, const std::string& whiteAlgorithm); + LedDeviceWS281x(const Json::Value &deviceConfig); /// /// Destructor of the LedDevice, waits for DMA to complete and then cleans up /// ~LedDeviceWS281x(); + + /// + /// Sets configuration + /// + /// @param deviceConfig the json device config + /// @return true if success + bool setConfig(const Json::Value &deviceConfig); + + /// constructs leddevice + static LedDevice* construct(const Json::Value &deviceConfig); /// /// Writes the led color values to the led-device diff --git a/libsrc/leddevice/LedDeviceWs2801.cpp b/libsrc/leddevice/LedDeviceWs2801.cpp index 41f2d661..f34e113d 100644 --- a/libsrc/leddevice/LedDeviceWs2801.cpp +++ b/libsrc/leddevice/LedDeviceWs2801.cpp @@ -11,11 +11,14 @@ // hyperion local includes #include "LedDeviceWs2801.h" -LedDeviceWs2801::LedDeviceWs2801(const std::string& outputDevice, const unsigned baudrate, const unsigned latchTime, - const int spiMode, const bool spiDataInvert) - : LedSpiDevice(outputDevice, baudrate, latchTime, spiMode, spiDataInvert) +LedDeviceWs2801::LedDeviceWs2801(const Json::Value &deviceConfig) + : LedSpiDevice(deviceConfig) { - // empty +} + +LedDevice* LedDeviceWs2801::construct(const Json::Value &deviceConfig) +{ + return new LedDeviceWs2801(deviceConfig); } int LedDeviceWs2801::write(const std::vector &ledValues) diff --git a/libsrc/leddevice/LedDeviceWs2801.h b/libsrc/leddevice/LedDeviceWs2801.h index 0703bdf7..a7afee5f 100644 --- a/libsrc/leddevice/LedDeviceWs2801.h +++ b/libsrc/leddevice/LedDeviceWs2801.h @@ -13,17 +13,14 @@ class LedDeviceWs2801 : public LedSpiDevice { public: /// - /// Constructs the LedDevice for a string containing leds of the type Ws2801 + /// Constructs specific LedDevice /// - /// @param outputDevice The name of the output device (eg '/etc/SpiDev.0.0') - /// @param baudrate The used baudrate for writing to the output device + /// @param deviceConfig json device config /// + LedDeviceWs2801(const Json::Value &deviceConfig); - LedDeviceWs2801(const std::string& outputDevice, - const unsigned baudrate, - const unsigned latchTime, - const int spiMode, - const bool spiDataInvert); + /// constructs leddevice + static LedDevice* construct(const Json::Value &deviceConfig); /// /// Writes the led color values to the led-device diff --git a/libsrc/leddevice/LedDeviceWs2812SPI.cpp b/libsrc/leddevice/LedDeviceWs2812SPI.cpp index 3b3751e3..5fbd2134 100644 --- a/libsrc/leddevice/LedDeviceWs2812SPI.cpp +++ b/libsrc/leddevice/LedDeviceWs2812SPI.cpp @@ -11,8 +11,8 @@ // hyperion local includes #include "LedDeviceWs2812SPI.h" -LedDeviceWs2812SPI::LedDeviceWs2812SPI(const std::string& outputDevice, const unsigned baudrate, const int spiMode, const bool spiDataInvert) - : LedSpiDevice(outputDevice, baudrate, 0, spiMode, spiDataInvert) +LedDeviceWs2812SPI::LedDeviceWs2812SPI(const Json::Value &deviceConfig) + : LedSpiDevice(deviceConfig) , bitpair_to_byte { 0b10001000, 0b10001100, @@ -20,7 +20,11 @@ LedDeviceWs2812SPI::LedDeviceWs2812SPI(const std::string& outputDevice, const un 0b11001100, } { - // empty +} + +LedDevice* LedDeviceWs2812SPI::construct(const Json::Value &deviceConfig) +{ + return new LedDeviceWs2812SPI(deviceConfig); } int LedDeviceWs2812SPI::write(const std::vector &ledValues) diff --git a/libsrc/leddevice/LedDeviceWs2812SPI.h b/libsrc/leddevice/LedDeviceWs2812SPI.h index eed65c3e..bc1f01b1 100644 --- a/libsrc/leddevice/LedDeviceWs2812SPI.h +++ b/libsrc/leddevice/LedDeviceWs2812SPI.h @@ -13,13 +13,14 @@ class LedDeviceWs2812SPI : public LedSpiDevice { public: /// - /// Constructs the LedDevice for a string containing leds of the type Ws2812SPI + /// Constructs specific LedDevice /// - /// @param outputDevice The name of the output device (eg '/etc/SpiDev.0.0') - /// @param baudrate The used baudrate for writing to the output device + /// @param deviceConfig json device config /// - LedDeviceWs2812SPI(const std::string& outputDevice, const unsigned baudrate, - const int spiMode, const bool spiDataInvert); + LedDeviceWs2812SPI(const Json::Value &deviceConfig); + + /// constructs leddevice + static LedDevice* construct(const Json::Value &deviceConfig); /// /// Writes the led color values to the led-device diff --git a/libsrc/leddevice/LedHIDDevice.cpp b/libsrc/leddevice/LedHIDDevice.cpp index bd3a01bf..f3672e2f 100644 --- a/libsrc/leddevice/LedHIDDevice.cpp +++ b/libsrc/leddevice/LedHIDDevice.cpp @@ -9,15 +9,12 @@ // Local Hyperion includes #include "LedHIDDevice.h" -LedHIDDevice::LedHIDDevice(const unsigned short VendorId, const unsigned short ProductId, int delayAfterConnect_ms, const bool useFeature) - : _VendorId(VendorId) - , _ProductId(ProductId) - , _useFeature(useFeature) +LedHIDDevice::LedHIDDevice(const Json::Value &deviceConfig) + : _useFeature(false) , _deviceHandle(nullptr) - , _delayAfterConnect_ms(delayAfterConnect_ms) , _blockedForDelay(false) { - // empty + setConfig(deviceConfig); } LedHIDDevice::~LedHIDDevice() @@ -31,6 +28,19 @@ LedHIDDevice::~LedHIDDevice() hid_exit(); } +bool LedHIDDevice::setConfig(const Json::Value &deviceConfig) +{ + _delayAfterConnect_ms = deviceConfig.get("delayAfterConnect", 0 ).asInt(); + auto VendorIdString = deviceConfig.get("VID", "0x2341").asString(); + auto ProductIdString = deviceConfig.get("PID", "0x8036").asString(); + + // Convert HEX values to integer + _VendorId = std::stoul(VendorIdString, nullptr, 16); + _ProductId = std::stoul(ProductIdString, nullptr, 16); + + return true; +} + int LedHIDDevice::open() { // Initialize the usb context diff --git a/libsrc/leddevice/LedHIDDevice.h b/libsrc/leddevice/LedHIDDevice.h index 65c2595e..6db51ac0 100644 --- a/libsrc/leddevice/LedHIDDevice.h +++ b/libsrc/leddevice/LedHIDDevice.h @@ -17,18 +17,24 @@ class LedHIDDevice : public LedDevice public: /// - /// Constructs the LedDevice attached to an HID-device + /// Constructs specific LedDevice /// - /// @param[in] VendorId The USB VID of the output device - /// @param[in] ProductId The USB PID of the output device + /// @param deviceConfig json device config /// - LedHIDDevice(const unsigned short VendorId, const unsigned short ProductId, int delayAfterConnect_ms = 0, const bool useFeature = false); + LedHIDDevice(const Json::Value &deviceConfig); /// /// Destructor of the LedDevice; closes the output device if it is open /// virtual ~LedHIDDevice(); + /// + /// Sets configuration + /// + /// @param deviceConfig the json device config + /// @return true if success + virtual bool setConfig(const Json::Value &deviceConfig); + /// /// Opens and configures the output device /// @@ -46,21 +52,20 @@ protected: */ int writeBytes(const unsigned size, const uint8_t *data); -private slots: - /// Unblock the device after a connection delay - void unblockAfterDelay(); - -private: // HID VID and PID - const unsigned short _VendorId; - const unsigned short _ProductId; - const bool _useFeature; + unsigned short _VendorId; + unsigned short _ProductId; + bool _useFeature; /// libusb device handle hid_device * _deviceHandle; /// Sleep after the connect before continuing - const int _delayAfterConnect_ms; + int _delayAfterConnect_ms; bool _blockedForDelay; + +private slots: + /// Unblock the device after a connection delay + void unblockAfterDelay(); }; diff --git a/libsrc/leddevice/LedRs232Device.cpp b/libsrc/leddevice/LedRs232Device.cpp index f55ee54b..fea6541f 100644 --- a/libsrc/leddevice/LedRs232Device.cpp +++ b/libsrc/leddevice/LedRs232Device.cpp @@ -9,17 +9,25 @@ // Local Hyperion includes #include "LedRs232Device.h" -LedRs232Device::LedRs232Device(const std::string& outputDevice, const unsigned baudrate, int delayAfterConnect_ms) - : _deviceName(outputDevice) - , _baudRate_Hz(baudrate) - , _delayAfterConnect_ms(delayAfterConnect_ms) - , _rs232Port(this) +LedRs232Device::LedRs232Device(const Json::Value &deviceConfig) + : _rs232Port(this) , _blockedForDelay(false) , _stateChanged(true) { + setConfig(deviceConfig); connect(&_rs232Port, SIGNAL(error(QSerialPort::SerialPortError)), this, SLOT(error(QSerialPort::SerialPortError))); } +bool LedRs232Device::setConfig(const Json::Value &deviceConfig) +{ + closeDevice(); + _deviceName = deviceConfig["output"].asString(); + _baudRate_Hz = deviceConfig["rate"].asInt(); + _delayAfterConnect_ms = deviceConfig.get("delayAfterConnect",250).asInt(); + + return true; +} + void LedRs232Device::error(QSerialPort::SerialPortError error) { if ( error != QSerialPort::NoError ) @@ -59,6 +67,11 @@ void LedRs232Device::error(QSerialPort::SerialPortError error) LedRs232Device::~LedRs232Device() { disconnect(&_rs232Port, SIGNAL(error(QSerialPort::SerialPortError)), this, SLOT(error(QSerialPort::SerialPortError))); + closeDevice(); +} + +void LedRs232Device::closeDevice() +{ if (_rs232Port.isOpen()) { _rs232Port.close(); @@ -66,7 +79,6 @@ LedRs232Device::~LedRs232Device() } } - int LedRs232Device::open() { Info(_log, "Opening UART: %s", _deviceName.c_str()); diff --git a/libsrc/leddevice/LedRs232Device.h b/libsrc/leddevice/LedRs232Device.h index 264c2829..d321835d 100644 --- a/libsrc/leddevice/LedRs232Device.h +++ b/libsrc/leddevice/LedRs232Device.h @@ -15,12 +15,18 @@ class LedRs232Device : public LedDevice public: /// - /// Constructs the LedDevice attached to a RS232-device + /// Constructs specific LedDevice /// - /// @param[in] outputDevice The name of the output device (eg '/etc/ttyS0') - /// @param[in] baudrate The used baudrate for writing to the output device + /// @param deviceConfig json device config /// - LedRs232Device(const std::string& outputDevice, const unsigned baudrate, int delayAfterConnect_ms = 0); + LedRs232Device(const Json::Value &deviceConfig); + + /// + /// Sets configuration + /// + /// @param deviceConfig the json device config + /// @return true if success + virtual bool setConfig(const Json::Value &deviceConfig); /// /// Destructor of the LedDevice; closes the output device if it is open @@ -45,6 +51,8 @@ protected: */ int writeBytes(const unsigned size, const uint8_t *data); + void closeDevice(); + private slots: /// Unblock the device after a connection delay void unblockAfterDelay(); @@ -55,10 +63,10 @@ private: bool tryOpen(); /// The name of the output device - const std::string _deviceName; + std::string _deviceName; /// The used baudrate of the output device - const qint32 _baudRate_Hz; + qint32 _baudRate_Hz; /// Sleep after the connect before continuing int _delayAfterConnect_ms; diff --git a/libsrc/leddevice/LedSpiDevice.cpp b/libsrc/leddevice/LedSpiDevice.cpp index f0ed5b96..7ff12a62 100644 --- a/libsrc/leddevice/LedSpiDevice.cpp +++ b/libsrc/leddevice/LedSpiDevice.cpp @@ -14,14 +14,11 @@ #include -LedSpiDevice::LedSpiDevice(const std::string& outputDevice, const unsigned baudrate, const int latchTime_ns, const int spiMode, const bool spiDataInvert) - : _deviceName(outputDevice) - , _baudRate_Hz(baudrate) - , _latchTime_ns(latchTime_ns) +LedSpiDevice::LedSpiDevice(const Json::Value &deviceConfig) + : LedDevice() , _fid(-1) - , _spiMode(spiMode) - , _spiDataInvert(spiDataInvert) { + setConfig(deviceConfig); memset(&_spi, 0, sizeof(_spi)); Debug(_log, "_spiDataInvert %d, _spiMode %d", _spiDataInvert, _spiMode); } @@ -31,6 +28,17 @@ LedSpiDevice::~LedSpiDevice() // close(_fid); } +bool LedSpiDevice::setConfig(const Json::Value &deviceConfig) +{ + _deviceName = deviceConfig.get("output","/dev/spidev.0.0").asString(); + _baudRate_Hz = deviceConfig.get("rate",1000000).asInt(); + _latchTime_ns = deviceConfig.get("latchtime",0).asInt(); + _spiMode = deviceConfig.get("spimode",SPI_MODE_0).asInt(); + _spiDataInvert = deviceConfig.get("invert",false).asBool(); + + return true; +} + int LedSpiDevice::open() { const int bitsPerWord = 8; diff --git a/libsrc/leddevice/LedSpiDevice.h b/libsrc/leddevice/LedSpiDevice.h index 8e27082b..8bc920c3 100644 --- a/libsrc/leddevice/LedSpiDevice.h +++ b/libsrc/leddevice/LedSpiDevice.h @@ -13,16 +13,18 @@ class LedSpiDevice : public LedDevice { public: /// - /// Constructs the LedDevice attached to a SPI-device + /// Constructs specific LedDevice /// - /// @param[in] outputDevice The name of the output device (eg '/dev/spidev.0.0') - /// @param[in] baudrate The used baudrate for writing to the output device - /// @param[in] latchTime_ns The latch-time to latch in the values across the SPI-device (negative - /// means no latch required) [ns] + /// @param deviceConfig json device config /// - LedSpiDevice(const std::string& outputDevice, const unsigned baudrate, const int latchTime_ns = -1, - const int spiMode = SPI_MODE_0, const bool spiDataInvert = false); + LedSpiDevice(const Json::Value &deviceConfig); + /// + /// Sets configuration + /// + /// @param deviceConfig the json device config + /// @return true if success + virtual bool setConfig(const Json::Value &deviceConfig); /// /// Destructor of the LedDevice; closes the output device if it is open @@ -48,15 +50,14 @@ protected: /// int writeBytes(const unsigned size, const uint8_t *data); -private: /// The name of the output device - const std::string _deviceName; + std::string _deviceName; /// The used baudrate of the output device - const int _baudRate_Hz; + int _baudRate_Hz; /// The time which the device should be untouched after a write - const int _latchTime_ns; + int _latchTime_ns; /// The File Identifier of the opened output device (or -1 if not opened) int _fid; diff --git a/libsrc/leddevice/LedUdpDevice.cpp b/libsrc/leddevice/LedUdpDevice.cpp index da7a9528..25e6d79b 100644 --- a/libsrc/leddevice/LedUdpDevice.cpp +++ b/libsrc/leddevice/LedUdpDevice.cpp @@ -15,24 +15,12 @@ // Local Hyperion includes #include "LedUdpDevice.h" -LedUdpDevice::LedUdpDevice(const std::string& output, const int latchTime_ns) - : _target(output) - , _LatchTime_ns(latchTime_ns) +LedUdpDevice::LedUdpDevice(const Json::Value &deviceConfig) + : LedDevice() + , _LatchTime_ns(-1) { + setConfig(deviceConfig); _udpSocket = new QUdpSocket(); - QString str = QString::fromStdString(_target); - QStringList str_splitted = str.split(":"); - if (str_splitted.size() != 2) - { - throw("Error parsing hostname:port"); - } - QHostInfo info = QHostInfo::fromName(str_splitted.at(0)); - if (!info.addresses().isEmpty()) - { - // use the first IP address - _address = info.addresses().first(); - } - _port = str_splitted.at(1).toInt(); } LedUdpDevice::~LedUdpDevice() @@ -40,6 +28,19 @@ LedUdpDevice::~LedUdpDevice() _udpSocket->close(); } +bool LedUdpDevice::setConfig(const Json::Value &deviceConfig) +{ + QHostInfo info = QHostInfo::fromName( QString::fromStdString(deviceConfig["output"].asString()) ); + if (info.addresses().isEmpty()) + { + throw("invalid target address"); + } + _address = info.addresses().first(); + _port = deviceConfig["port"].asUInt(); + + return true; +} + int LedUdpDevice::open() { QHostAddress localAddress = QHostAddress::Any; diff --git a/libsrc/leddevice/LedUdpDevice.h b/libsrc/leddevice/LedUdpDevice.h index 27ca481b..d1faa366 100644 --- a/libsrc/leddevice/LedUdpDevice.h +++ b/libsrc/leddevice/LedUdpDevice.h @@ -13,19 +13,24 @@ class LedUdpDevice : public LedDevice { public: /// - /// Constructs the LedDevice sendig data via udp + /// Constructs specific LedDevice /// - /// @param[in] outputDevice string hostname:port - /// @param[in] latchTime_ns The latch-time to latch in the values across the SPI-device (negative - /// means no latch required) [ns] + /// @param deviceConfig json device config /// - LedUdpDevice(const std::string& outputDevice, const int latchTime_ns = -1); + LedUdpDevice(const Json::Value &deviceConfig); /// /// Destructor of the LedDevice; closes the output device if it is open /// virtual ~LedUdpDevice(); + /// + /// Sets configuration + /// + /// @param deviceConfig the json device config + /// @return true if success + bool setConfig(const Json::Value &deviceConfig); + /// /// Opens and configures the output device /// @@ -45,12 +50,8 @@ protected: /// int writeBytes(const unsigned size, const uint8_t *data); -private: - /// The UDP destination as "host:port" - const std::string _target; - /// The time which the device should be untouched after a write - const int _LatchTime_ns; + int _LatchTime_ns; /// QUdpSocket * _udpSocket; diff --git a/libsrc/leddevice/schemas/schema-adalight.json b/libsrc/leddevice/schemas/schema-adalight.json new file mode 100644 index 00000000..0bce7984 --- /dev/null +++ b/libsrc/leddevice/schemas/schema-adalight.json @@ -0,0 +1,7 @@ +{ + "type":"object", + "required":true, + "properties":{ + }, + "additionalProperties": true +} diff --git a/libsrc/leddevice/schemas/schema-adalightapa102.json b/libsrc/leddevice/schemas/schema-adalightapa102.json new file mode 100644 index 00000000..0bce7984 --- /dev/null +++ b/libsrc/leddevice/schemas/schema-adalightapa102.json @@ -0,0 +1,7 @@ +{ + "type":"object", + "required":true, + "properties":{ + }, + "additionalProperties": true +} diff --git a/libsrc/leddevice/schemas/schema-apa102.json b/libsrc/leddevice/schemas/schema-apa102.json new file mode 100644 index 00000000..0bce7984 --- /dev/null +++ b/libsrc/leddevice/schemas/schema-apa102.json @@ -0,0 +1,7 @@ +{ + "type":"object", + "required":true, + "properties":{ + }, + "additionalProperties": true +} diff --git a/libsrc/leddevice/schemas/schema-atmo.json b/libsrc/leddevice/schemas/schema-atmo.json new file mode 100644 index 00000000..0bce7984 --- /dev/null +++ b/libsrc/leddevice/schemas/schema-atmo.json @@ -0,0 +1,7 @@ +{ + "type":"object", + "required":true, + "properties":{ + }, + "additionalProperties": true +} diff --git a/libsrc/leddevice/schemas/schema-atmoorb.json b/libsrc/leddevice/schemas/schema-atmoorb.json new file mode 100644 index 00000000..0bce7984 --- /dev/null +++ b/libsrc/leddevice/schemas/schema-atmoorb.json @@ -0,0 +1,7 @@ +{ + "type":"object", + "required":true, + "properties":{ + }, + "additionalProperties": true +} diff --git a/libsrc/leddevice/schemas/schema-e131.json b/libsrc/leddevice/schemas/schema-e131.json new file mode 100644 index 00000000..0bce7984 --- /dev/null +++ b/libsrc/leddevice/schemas/schema-e131.json @@ -0,0 +1,7 @@ +{ + "type":"object", + "required":true, + "properties":{ + }, + "additionalProperties": true +} diff --git a/libsrc/leddevice/schemas/schema-fadecandy.json b/libsrc/leddevice/schemas/schema-fadecandy.json new file mode 100644 index 00000000..0bce7984 --- /dev/null +++ b/libsrc/leddevice/schemas/schema-fadecandy.json @@ -0,0 +1,7 @@ +{ + "type":"object", + "required":true, + "properties":{ + }, + "additionalProperties": true +} diff --git a/libsrc/leddevice/schemas/schema-file.json b/libsrc/leddevice/schemas/schema-file.json new file mode 100644 index 00000000..0bce7984 --- /dev/null +++ b/libsrc/leddevice/schemas/schema-file.json @@ -0,0 +1,7 @@ +{ + "type":"object", + "required":true, + "properties":{ + }, + "additionalProperties": true +} diff --git a/libsrc/leddevice/schemas/schema-hyperion-usbasp.json b/libsrc/leddevice/schemas/schema-hyperion-usbasp.json new file mode 100644 index 00000000..0bce7984 --- /dev/null +++ b/libsrc/leddevice/schemas/schema-hyperion-usbasp.json @@ -0,0 +1,7 @@ +{ + "type":"object", + "required":true, + "properties":{ + }, + "additionalProperties": true +} diff --git a/libsrc/leddevice/schemas/schema-lightpack.json b/libsrc/leddevice/schemas/schema-lightpack.json new file mode 100644 index 00000000..0bce7984 --- /dev/null +++ b/libsrc/leddevice/schemas/schema-lightpack.json @@ -0,0 +1,7 @@ +{ + "type":"object", + "required":true, + "properties":{ + }, + "additionalProperties": true +} diff --git a/libsrc/leddevice/schemas/schema-lpd6803.json b/libsrc/leddevice/schemas/schema-lpd6803.json new file mode 100644 index 00000000..0bce7984 --- /dev/null +++ b/libsrc/leddevice/schemas/schema-lpd6803.json @@ -0,0 +1,7 @@ +{ + "type":"object", + "required":true, + "properties":{ + }, + "additionalProperties": true +} diff --git a/libsrc/leddevice/schemas/schema-lpd8806.json b/libsrc/leddevice/schemas/schema-lpd8806.json new file mode 100644 index 00000000..0bce7984 --- /dev/null +++ b/libsrc/leddevice/schemas/schema-lpd8806.json @@ -0,0 +1,7 @@ +{ + "type":"object", + "required":true, + "properties":{ + }, + "additionalProperties": true +} diff --git a/libsrc/leddevice/schemas/schema-multi-lightpack.json b/libsrc/leddevice/schemas/schema-multi-lightpack.json new file mode 100644 index 00000000..0bce7984 --- /dev/null +++ b/libsrc/leddevice/schemas/schema-multi-lightpack.json @@ -0,0 +1,7 @@ +{ + "type":"object", + "required":true, + "properties":{ + }, + "additionalProperties": true +} diff --git a/libsrc/leddevice/schemas/schema-p9813.json b/libsrc/leddevice/schemas/schema-p9813.json new file mode 100644 index 00000000..0bce7984 --- /dev/null +++ b/libsrc/leddevice/schemas/schema-p9813.json @@ -0,0 +1,7 @@ +{ + "type":"object", + "required":true, + "properties":{ + }, + "additionalProperties": true +} diff --git a/libsrc/leddevice/schemas/schema-paintpack.json b/libsrc/leddevice/schemas/schema-paintpack.json new file mode 100644 index 00000000..0bce7984 --- /dev/null +++ b/libsrc/leddevice/schemas/schema-paintpack.json @@ -0,0 +1,7 @@ +{ + "type":"object", + "required":true, + "properties":{ + }, + "additionalProperties": true +} diff --git a/libsrc/leddevice/schemas/schema-philipshue.json b/libsrc/leddevice/schemas/schema-philipshue.json new file mode 100644 index 00000000..0bce7984 --- /dev/null +++ b/libsrc/leddevice/schemas/schema-philipshue.json @@ -0,0 +1,7 @@ +{ + "type":"object", + "required":true, + "properties":{ + }, + "additionalProperties": true +} diff --git a/libsrc/leddevice/schemas/schema-piblaster.json b/libsrc/leddevice/schemas/schema-piblaster.json new file mode 100644 index 00000000..0bce7984 --- /dev/null +++ b/libsrc/leddevice/schemas/schema-piblaster.json @@ -0,0 +1,7 @@ +{ + "type":"object", + "required":true, + "properties":{ + }, + "additionalProperties": true +} diff --git a/libsrc/leddevice/schemas/schema-rawhid.json b/libsrc/leddevice/schemas/schema-rawhid.json new file mode 100644 index 00000000..0bce7984 --- /dev/null +++ b/libsrc/leddevice/schemas/schema-rawhid.json @@ -0,0 +1,7 @@ +{ + "type":"object", + "required":true, + "properties":{ + }, + "additionalProperties": true +} diff --git a/libsrc/leddevice/schemas/schema-sedu.json b/libsrc/leddevice/schemas/schema-sedu.json new file mode 100644 index 00000000..0bce7984 --- /dev/null +++ b/libsrc/leddevice/schemas/schema-sedu.json @@ -0,0 +1,7 @@ +{ + "type":"object", + "required":true, + "properties":{ + }, + "additionalProperties": true +} diff --git a/libsrc/leddevice/schemas/schema-sk6812rgbw-spi.json b/libsrc/leddevice/schemas/schema-sk6812rgbw-spi.json new file mode 100644 index 00000000..0bce7984 --- /dev/null +++ b/libsrc/leddevice/schemas/schema-sk6812rgbw-spi.json @@ -0,0 +1,7 @@ +{ + "type":"object", + "required":true, + "properties":{ + }, + "additionalProperties": true +} diff --git a/libsrc/leddevice/schemas/schema-tinkerforge.json b/libsrc/leddevice/schemas/schema-tinkerforge.json new file mode 100644 index 00000000..0bce7984 --- /dev/null +++ b/libsrc/leddevice/schemas/schema-tinkerforge.json @@ -0,0 +1,7 @@ +{ + "type":"object", + "required":true, + "properties":{ + }, + "additionalProperties": true +} diff --git a/libsrc/leddevice/schemas/schema-tmp2net.json b/libsrc/leddevice/schemas/schema-tmp2net.json new file mode 100644 index 00000000..0bce7984 --- /dev/null +++ b/libsrc/leddevice/schemas/schema-tmp2net.json @@ -0,0 +1,7 @@ +{ + "type":"object", + "required":true, + "properties":{ + }, + "additionalProperties": true +} diff --git a/libsrc/leddevice/schemas/schema-tpm2.json b/libsrc/leddevice/schemas/schema-tpm2.json new file mode 100644 index 00000000..0bce7984 --- /dev/null +++ b/libsrc/leddevice/schemas/schema-tpm2.json @@ -0,0 +1,7 @@ +{ + "type":"object", + "required":true, + "properties":{ + }, + "additionalProperties": true +} diff --git a/libsrc/leddevice/schemas/schema-udpraw.json b/libsrc/leddevice/schemas/schema-udpraw.json new file mode 100644 index 00000000..0bce7984 --- /dev/null +++ b/libsrc/leddevice/schemas/schema-udpraw.json @@ -0,0 +1,7 @@ +{ + "type":"object", + "required":true, + "properties":{ + }, + "additionalProperties": true +} diff --git a/libsrc/leddevice/schemas/schema-ws2801.json b/libsrc/leddevice/schemas/schema-ws2801.json new file mode 100644 index 00000000..0bce7984 --- /dev/null +++ b/libsrc/leddevice/schemas/schema-ws2801.json @@ -0,0 +1,7 @@ +{ + "type":"object", + "required":true, + "properties":{ + }, + "additionalProperties": true +} diff --git a/libsrc/leddevice/schemas/schema-ws2812spi.json b/libsrc/leddevice/schemas/schema-ws2812spi.json new file mode 100644 index 00000000..0bce7984 --- /dev/null +++ b/libsrc/leddevice/schemas/schema-ws2812spi.json @@ -0,0 +1,7 @@ +{ + "type":"object", + "required":true, + "properties":{ + }, + "additionalProperties": true +} diff --git a/libsrc/leddevice/schemas/schema-ws281x.json b/libsrc/leddevice/schemas/schema-ws281x.json new file mode 100644 index 00000000..0bce7984 --- /dev/null +++ b/libsrc/leddevice/schemas/schema-ws281x.json @@ -0,0 +1,7 @@ +{ + "type":"object", + "required":true, + "properties":{ + }, + "additionalProperties": true +} diff --git a/test/TestSpi.cpp b/test/TestSpi.cpp index c8420d41..47aa6627 100644 --- a/test/TestSpi.cpp +++ b/test/TestSpi.cpp @@ -9,9 +9,13 @@ // Local includes #include +#include #include "../libsrc/leddevice/LedDeviceWs2801.h" +Json::Value deviceConfig; + + void setColor(char* colorStr) { ColorRgb color = ColorRgb::BLACK; @@ -54,7 +58,8 @@ void setColor(char* colorStr) unsigned ledCnt = 50; std::vector buff(ledCnt, color); - LedDeviceWs2801 ledDevice("/dev/spidev0.0", 40000, 500000, 0, 0); + + LedDeviceWs2801 ledDevice(deviceConfig); ledDevice.open(); ledDevice.write(buff); } @@ -68,7 +73,7 @@ void doCircle() unsigned ledCnt = 50; std::vector data(ledCnt, ColorRgb::BLACK); - LedDeviceWs2801 ledDevice("/dev/spidev0.0", 40000, 500000, 0, 0); + LedDeviceWs2801 ledDevice(deviceConfig); ledDevice.open(); timespec loopTime; @@ -142,6 +147,10 @@ int main(int argc, char** argv) return -1; } + deviceConfig["output"] = "/dev/spidev0.0"; + deviceConfig["rate"] = 40000; + deviceConfig["latchtime"] = 500000; + if (strncmp("fixed", argv[1], 5) == 0) { setColor(argv[2]); diff --git a/test/testrunner.sh b/test/testrunner.sh index 8c1afa3f..21503b8c 100644 --- a/test/testrunner.sh +++ b/test/testrunner.sh @@ -16,9 +16,11 @@ function exec_test() then echo -e " ... success" (( STATS_SUCCESS++ )) + return 0 else echo -e " ... failed" (( STATS_FAILED++ )) + return 1 fi echo } @@ -31,6 +33,7 @@ echo echo "Hyperion test execution" echo exec_test "hyperiond is executable and show version" bin/hyperiond --version + for cfg in ../config/*json* do exec_test "test $(basename $cfg)" bin/test_configfile $cfg From 2cc107842ab90f33182d26d3b96fd706a9c9da9c Mon Sep 17 00:00:00 2001 From: brindosch Date: Tue, 23 Aug 2016 20:17:50 +0200 Subject: [PATCH 009/133] Web: Dashboard version comparison (#196) * update version * update version * update * add update echeck --- assets/webconfig/css/hyperion.css | 2 + assets/webconfig/index.html | 66 +++++++++++++++++++++++++++---- assets/webconfig/lang/de.json | 2 + assets/webconfig/update.html | 2 +- version.json | 41 +++++++++---------- 5 files changed, 85 insertions(+), 28 deletions(-) diff --git a/assets/webconfig/css/hyperion.css b/assets/webconfig/css/hyperion.css index 97ef4b98..064f8b54 100644 --- a/assets/webconfig/css/hyperion.css +++ b/assets/webconfig/css/hyperion.css @@ -9,6 +9,8 @@ body{font-family:Roboto,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:15 @media (max-width: 767px){div[class*="col-"] {padding:0;}} /*icon spacing*/ .fa-fw{margin-right:5px;} +/*borderless table*/ +table.borderless td,table.borderless th{border: none !important;} /*Header*/ .navbar-brand{padding: 5px;height:90px;} diff --git a/assets/webconfig/index.html b/assets/webconfig/index.html index 04e53284..555f9470 100644 --- a/assets/webconfig/index.html +++ b/assets/webconfig/index.html @@ -345,10 +345,6 @@

The dashboard give you a quick overview about the status of Hyperion and show you the latest news of the Hyperion Blog.


-
@@ -356,9 +352,24 @@ Information
-

Your Hyperion version:

-

Latest version:

-

Device:

+ + + + + + + + + + + + + + + +
Your Hyperion version:
Latest version:
Device:
+
+
@@ -462,6 +473,47 @@ //Change all Checkboxes to Switches $("[type='checkbox']").bootstrapSwitch(); + // vesion check + var currentVersion; + var cleanCurrentVersion; + var latestVersion; + var cleanLatestVersion; + + webSocket = new WebSocket('ws://'+document.location.hostname+':19444'); + var serverInfo; + + webSocket.onerror = function(event) { + alert(event.data); + }; + + + webSocket.onopen = function(event) { + webSocket.send('{"command":"serverinfo"}'); + }; + + webSocket.onmessage = function(response){ + responseJSON = JSON.parse(response.data ); + currentVersion = responseJSON.info.hyperion[0].version; + cleanCurrentVersion = currentVersion.replace(/\./g, ''); + + $.get( "https://raw.githubusercontent.com/hyperion-project/hyperion.ng/master/version.json", function( data ) { + var responseJSON = JSON.parse(data); + latestVersion = responseJSON[0].versionnr; + cleanLatestVersion = latestVersion.replace(/\./g, ''); + + $('#currentversion').append(' V'+currentVersion); + $('#latestversion').append(' V'+latestVersion); + + if ( cleanCurrentVersion < cleanLatestVersion ) { + $('#versioninforesult').append('
A newer version of Hyperion is available!
'); + } + else{ + $('#versioninforesult').append('
You run the latest version of Hyperion.
'); + } + }); + + }; + }); $(function(){ var sidebar = $('#side-menu'); // cache sidebar to a variable for performance diff --git a/assets/webconfig/lang/de.json b/assets/webconfig/lang/de.json index 9d868d3d..e115d379 100644 --- a/assets/webconfig/lang/de.json +++ b/assets/webconfig/lang/de.json @@ -16,6 +16,8 @@ "dashboard_label_infobox_device" : "Geräteinformation:", "dashboard_label_componentbox_title" : "Komponenten Status", "dashboard_label_newsbox_title" : "Die letzten Blogposts", + "dashboard_message_infobox_updatewarning" : "Eine aktuellere Version von Hyperion ist verfügbar!", + "dashboard_message_infobox_updatesuccess" : "Du nutzt die aktuellste Version von Hyperion.", "main_menu_dashboard_token" : "Dashboard", "main_menu_configuration_token" : "Konfiguration", "main_menu_kodiwatch_token" : "Kodi Überwachung", diff --git a/assets/webconfig/update.html b/assets/webconfig/update.html index b0bcb43d..78b7d6d3 100644 --- a/assets/webconfig/update.html +++ b/assets/webconfig/update.html @@ -18,7 +18,7 @@ $.get( "https://raw.githubusercontent.com/hyperion-project/hyperion.ng/master/ve var vlist = JSON.parse(data); for (key in vlist) { - $('#versionlist').append('
Hyperion V'+key+'

Type: '+ vlist[key].channel +'

Description: '+vlist[key].versiondesc+'


Full changelog
'); + $('#versionlist').append('
Hyperion V'+vlist[key].versionnr+'

Type: '+ vlist[key].channel +'

Description: '+vlist[key].versiondesc+'


Full changelog
'); } }); diff --git a/version.json b/version.json index 2e068234..356934a4 100644 --- a/version.json +++ b/version.json @@ -1,20 +1,21 @@ -{ - "2.1.0": - { - "versiondesc": "This version introduces feature x and some small bugfixes at the web configuration", - "versionchangelog":"https://www.hyperion-project.org/blog/id1", - "channel" : "Stable" - }, -"2.0.1": - { - "versiondesc": "This is a bugfix release for 2.0.0", - "versionchangelog": "https://www.hyperion-project.org/blog/id3", - "channel" : "Stable" - }, -"2.0.0": - { - "versiondesc": "Version 2.0.0 introduces the succesor of Hyperion 1.0 with plenty new features to discover with a entire code rework and a highly extended JSON RPC!", - "versionchangelog": "https://www.hyperion-project.org/blog/id0", - "channel" : "Stable" - } -} +[ + { + "versionnr" : "2.1.0", + "versiondesc": "This version introduces feature x and some small bugfixes at the web configuration", + "versionchangelog":"https://www.hyperion-project.org/blog/id1", + "channel" : "Stable" + }, + { + "versionnr" : "2.0.1", + "versiondesc": "This is a bugfix release for 2.0.0", + "versionchangelog": "https://www.hyperion-project.org/blog/id3", + "channel" : "Stable" + }, + { + "versionnr" : "2.0.0", + "versiondesc": "Version 2.0.0 introduces the succesor of Hyperion 1.0 with plenty new features to discover with a entire code rework and a highly extended JSON RPC!", + "versionchangelog": "https://www.hyperion-project.org/blog/id0", + "channel" : "Stable" + } +] + From cea4db8e60211b4c28c20df9ffd065434c5879c4 Mon Sep 17 00:00:00 2001 From: penfold42 Date: Wed, 24 Aug 2016 14:05:00 +1000 Subject: [PATCH 010/133] Fix throw error in udp, fix default SPI device (#198) * Fix throw error so it correctly fails on invalid output hostnames * Fixed broken default /dev/spidev0.0 string * UDP devices now use "host" and "port" rather than "output" --- libsrc/leddevice/LedSpiDevice.cpp | 2 +- libsrc/leddevice/LedUdpDevice.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libsrc/leddevice/LedSpiDevice.cpp b/libsrc/leddevice/LedSpiDevice.cpp index 7ff12a62..bc2e3b66 100644 --- a/libsrc/leddevice/LedSpiDevice.cpp +++ b/libsrc/leddevice/LedSpiDevice.cpp @@ -30,7 +30,7 @@ LedSpiDevice::~LedSpiDevice() bool LedSpiDevice::setConfig(const Json::Value &deviceConfig) { - _deviceName = deviceConfig.get("output","/dev/spidev.0.0").asString(); + _deviceName = deviceConfig.get("output","/dev/spidev0.0").asString(); _baudRate_Hz = deviceConfig.get("rate",1000000).asInt(); _latchTime_ns = deviceConfig.get("latchtime",0).asInt(); _spiMode = deviceConfig.get("spimode",SPI_MODE_0).asInt(); diff --git a/libsrc/leddevice/LedUdpDevice.cpp b/libsrc/leddevice/LedUdpDevice.cpp index 25e6d79b..b0db9fc9 100644 --- a/libsrc/leddevice/LedUdpDevice.cpp +++ b/libsrc/leddevice/LedUdpDevice.cpp @@ -30,10 +30,10 @@ LedUdpDevice::~LedUdpDevice() bool LedUdpDevice::setConfig(const Json::Value &deviceConfig) { - QHostInfo info = QHostInfo::fromName( QString::fromStdString(deviceConfig["output"].asString()) ); + QHostInfo info = QHostInfo::fromName( QString::fromStdString(deviceConfig["host"].asString()) ); if (info.addresses().isEmpty()) { - throw("invalid target address"); + throw std::runtime_error("invalid target address"); } _address = info.addresses().first(); _port = deviceConfig["port"].asUInt(); From bb94a21c83a7f34aebbdf0607406fd36d72e644c Mon Sep 17 00:00:00 2001 From: brindosch Date: Wed, 24 Aug 2016 20:09:27 +0200 Subject: [PATCH 011/133] Web: Add simple components control (#203) --- assets/webconfig/index.html | 80 +++++++++++++------------ assets/webconfig/lang/de.json | 2 + assets/webconfig/remote_components.html | 42 +++++++++++++ 3 files changed, 87 insertions(+), 37 deletions(-) create mode 100644 assets/webconfig/remote_components.html diff --git a/assets/webconfig/index.html b/assets/webconfig/index.html index 555f9470..6274caa6 100644 --- a/assets/webconfig/index.html +++ b/assets/webconfig/index.html @@ -290,43 +290,45 @@
  • Dashboard
  • -
  • - Configuration - -
  • -
  • - Remote Control - -
  • -
  • - Support -
  • -
  • - System - -
  • - +
  • + Configuration + +
  • +
  • + Remote Control + +
  • +
  • + Support +
  • +
  • + System + +
  • @@ -449,6 +451,10 @@ $("#load_effects").on("click", function() { $("#page-wrapper").load("effects.html"); }); + + $("#load_components").on("click", function() { + $("#page-wrapper").load("remote_components.html"); + }); $("#load_huebridge").on("click", function() { $("#page-wrapper").load("huebridge.html"); diff --git a/assets/webconfig/lang/de.json b/assets/webconfig/lang/de.json index e115d379..f7286ecf 100644 --- a/assets/webconfig/lang/de.json +++ b/assets/webconfig/lang/de.json @@ -25,6 +25,7 @@ "main_menu_remotecontrol_token" : "Fernbedienung", "main_menu_colors_token" : "Farben", "main_menu_effects_token" : "Effekte", + "main_menu_component_token" : "Komponenten", "main_menu_support_token" : "Hilfe", "main_menu_update_token" : "Update", "main_menu_system_token" : "System", @@ -34,6 +35,7 @@ "remote_effects_intro" : "Die Effekt-Fernbedienung ermöglicht es dir Effekte zu starten für Demonstrations- oder Testzwecke. Vergessse nicht den Effekt wieder zu stoppen, wenn du fertig bist.", "remote_effects_label_effects":"Effekte", "remote_effects_label_stopeffect":"Stoppe Effekte", + "remote_components_intro" : "Die Komponenten-Fenbedienung ermöglicht es dir Komponenten von Hyperion zu starten und stoppen. Beachte: Dies ist nur temporär und geht nach einem Neustart verloren. Möchtest du dauerhaft Komponenten aktivieren/deaktivieren benutze die Konfigurationsseiten.", "hue_button_create_user_token":"Benutzer anlegen", "hue_press_link_modal":"Link Taste auf der Hue Bridge drücken und mit Button bestätigen.", "hue_press_link_modal_failure":"Bitte drücke die Link Taste auf deiner Hue Bridge.", diff --git a/assets/webconfig/remote_components.html b/assets/webconfig/remote_components.html new file mode 100644 index 00000000..f362e550 --- /dev/null +++ b/assets/webconfig/remote_components.html @@ -0,0 +1,42 @@ +
    +
    +
    +

    Effects

    +
    +

    The components remote enables you to disable and enable certain components of Hyperion during runtime. Keep in mind this persist just until the next reboot! To enable/disable components permament, use the configuration section.

    +
    +
    +
    +
    +
    +
    +
    + + \ No newline at end of file From 13cc053d993eec45d80e32c0ddb59cfd0c7e1ef4 Mon Sep 17 00:00:00 2001 From: brindosch Date: Thu, 25 Aug 2016 13:52:31 +0200 Subject: [PATCH 012/133] fix jsonrpc (1/2) NO CI no ci [no ci] --- libsrc/jsonserver/JsonClientConnection.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/libsrc/jsonserver/JsonClientConnection.cpp b/libsrc/jsonserver/JsonClientConnection.cpp index 605b0c6e..527aaa34 100644 --- a/libsrc/jsonserver/JsonClientConnection.cpp +++ b/libsrc/jsonserver/JsonClientConnection.cpp @@ -562,13 +562,16 @@ void JsonClientConnection::handleServerInfoCommand(const Json::Value &, const st const std::list & activeEffectsDefinitions = _hyperion->getActiveEffects(); for (const ActiveEffectDefinition & activeEffectDefinition : activeEffectsDefinitions) { - Json::Value activeEffect; - activeEffect["script"] = activeEffectDefinition.script; - activeEffect["priority"] = activeEffectDefinition.priority; - activeEffect["timeout"] = activeEffectDefinition.timeout; - activeEffect["args"] = activeEffectDefinition.args; - - activeEffects.append(activeEffect); + if (activeEffectDefinition.priority != PriorityMuxer::LOWEST_PRIORITY -1) + { + Json::Value activeEffect; + activeEffect["script"] = activeEffectDefinition.script; + activeEffect["priority"] = activeEffectDefinition.priority; + activeEffect["timeout"] = activeEffectDefinition.timeout; + activeEffect["args"] = activeEffectDefinition.args; + + activeEffects.append(activeEffect); + } } //////////////////////////////////// From a6bf58c21e0082bd9c4e1f2644e0ac1515409153 Mon Sep 17 00:00:00 2001 From: brindosch Date: Thu, 25 Aug 2016 13:54:30 +0200 Subject: [PATCH 013/133] fix jsonrpc (2/2) no ci NO CI --- src/hyperiond/hyperiond.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hyperiond/hyperiond.cpp b/src/hyperiond/hyperiond.cpp index 52fb71fb..b47eef18 100644 --- a/src/hyperiond/hyperiond.cpp +++ b/src/hyperiond/hyperiond.cpp @@ -189,7 +189,7 @@ void HyperionDaemon::startInitialEffect() // initial foreground effect/color const QJsonValue fgEffectConfig = effectConfig["foreground-effect"]; int default_fg_duration_ms = 3000; - int fg_duration_ms = effectConfig["foreground-effect-duration_ms"].toInt(default_fg_duration_ms); + int fg_duration_ms = effectConfig["foreground-duration_ms"].toInt(default_fg_duration_ms); if (fg_duration_ms == DURATION_INFINITY) { fg_duration_ms = default_fg_duration_ms; From 9cc3a2de2eeb4cf15b39b272a0ce618b6360bf21 Mon Sep 17 00:00:00 2001 From: penfold42 Date: Sat, 27 Aug 2016 22:05:09 +1000 Subject: [PATCH 014/133] LedUdpDevice now tries to parse the "host" as an IP address before trying to DNS resolve it (#205) --- libsrc/leddevice/LedUdpDevice.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/libsrc/leddevice/LedUdpDevice.cpp b/libsrc/leddevice/LedUdpDevice.cpp index b0db9fc9..5bfbe69b 100644 --- a/libsrc/leddevice/LedUdpDevice.cpp +++ b/libsrc/leddevice/LedUdpDevice.cpp @@ -30,13 +30,24 @@ LedUdpDevice::~LedUdpDevice() bool LedUdpDevice::setConfig(const Json::Value &deviceConfig) { - QHostInfo info = QHostInfo::fromName( QString::fromStdString(deviceConfig["host"].asString()) ); - if (info.addresses().isEmpty()) + if (_address.setAddress( QString::fromStdString(deviceConfig["host"].asString()) ) ) { - throw std::runtime_error("invalid target address"); + Debug( _log, "Successfully parsed %s as an ip address.", deviceConfig["host"].asString().c_str()); + } + else + { + Debug( _log, "Failed to parse %s as an ip address.", deviceConfig["host"].asString().c_str()); + QHostInfo info = QHostInfo::fromName( QString::fromStdString(deviceConfig["host"].asString()) ); + if (info.addresses().isEmpty()) + { + Debug( _log, "Failed to parse %s as a hostname.", deviceConfig["host"].asString().c_str()); + throw std::runtime_error("invalid target address"); + } + Debug( _log, "Successfully parsed %s as a hostname.", deviceConfig["host"].asString().c_str()); + _address = info.addresses().first(); } - _address = info.addresses().first(); _port = deviceConfig["port"].asUInt(); + Debug( _log, "UDP using %s:%d", _address.toString().toStdString().c_str() , _port ); return true; } @@ -46,7 +57,7 @@ int LedUdpDevice::open() QHostAddress localAddress = QHostAddress::Any; quint16 localPort = 0; - WarningIf( !_udpSocket->bind(localAddress, localPort), _log, "Couldnt bind local address: %s", strerror(errno)); + WarningIf( !_udpSocket->bind(localAddress, localPort), _log, "Could not bind local address: %s", strerror(errno)); return 0; } From cc8185691a323a1c7418a860d563f2639ad15a02 Mon Sep 17 00:00:00 2001 From: penfold42 Date: Sun, 28 Aug 2016 15:12:48 +1000 Subject: [PATCH 015/133] Renamed the lowlevel providers from LedXXXDevice to ProviderXXX (#206) %s/LedUdpDevice/ProviderUdp/g git mv LedUdpDevice.cpp ProviderUdp.cpp git mv LedUdpDevice.h ProviderUdp.h vi `grep -l LedHID *` %s/LedHIDDevice/ProviderHID/g git mv LedHIDDevice.cpp ProviderHID.cpp git mv LedHIDDevice.h ProviderHID.h vi `grep -l LedRs *` %s/LedRs232Device/ProviderRs232/g git mv LedRs232Device.cpp ProviderRs232.cpp git mv LedRs232Device.h ProviderRs232.h vi `grep -l LedSpi *` %s/LedSpiDevice/ProviderSpi/g git mv LedSpiDevice.cpp ProviderSpi.cpp git mv LedSpiDevice.h ProviderSpi.h --- libsrc/leddevice/CMakeLists.txt | 16 +++++++-------- libsrc/leddevice/LedDeviceAPA102.cpp | 2 +- libsrc/leddevice/LedDeviceAPA102.h | 4 ++-- libsrc/leddevice/LedDeviceAdalight.cpp | 2 +- libsrc/leddevice/LedDeviceAdalight.h | 4 ++-- libsrc/leddevice/LedDeviceAtmo.cpp | 2 +- libsrc/leddevice/LedDeviceAtmo.h | 4 ++-- libsrc/leddevice/LedDeviceLpd6803.cpp | 2 +- libsrc/leddevice/LedDeviceLpd6803.h | 4 ++-- libsrc/leddevice/LedDeviceLpd8806.cpp | 2 +- libsrc/leddevice/LedDeviceLpd8806.h | 4 ++-- libsrc/leddevice/LedDeviceP9813.cpp | 2 +- libsrc/leddevice/LedDeviceP9813.h | 4 ++-- libsrc/leddevice/LedDevicePaintpack.cpp | 2 +- libsrc/leddevice/LedDevicePaintpack.h | 4 ++-- libsrc/leddevice/LedDeviceRawHID.cpp | 2 +- libsrc/leddevice/LedDeviceRawHID.h | 4 ++-- libsrc/leddevice/LedDeviceSedu.cpp | 2 +- libsrc/leddevice/LedDeviceSedu.h | 4 ++-- libsrc/leddevice/LedDeviceSk6812SPI.cpp | 4 ++-- libsrc/leddevice/LedDeviceSk6812SPI.h | 4 ++-- libsrc/leddevice/LedDeviceTpm2.cpp | 2 +- libsrc/leddevice/LedDeviceTpm2.h | 4 ++-- libsrc/leddevice/LedDeviceUdpE131.cpp | 4 ++-- libsrc/leddevice/LedDeviceUdpE131.h | 4 ++-- libsrc/leddevice/LedDeviceUdpRaw.cpp | 4 ++-- libsrc/leddevice/LedDeviceUdpRaw.h | 4 ++-- libsrc/leddevice/LedDeviceWs2801.cpp | 2 +- libsrc/leddevice/LedDeviceWs2801.h | 4 ++-- libsrc/leddevice/LedDeviceWs2812SPI.cpp | 2 +- libsrc/leddevice/LedDeviceWs2812SPI.h | 4 ++-- .../{LedHIDDevice.cpp => ProviderHID.cpp} | 14 ++++++------- .../{LedHIDDevice.h => ProviderHID.h} | 8 ++++---- .../{LedRs232Device.cpp => ProviderRs232.cpp} | 20 +++++++++---------- .../{LedRs232Device.h => ProviderRs232.h} | 8 ++++---- .../{LedSpiDevice.cpp => ProviderSpi.cpp} | 12 +++++------ .../{LedSpiDevice.h => ProviderSpi.h} | 8 ++++---- .../{LedUdpDevice.cpp => ProviderUdp.cpp} | 12 +++++------ .../{LedUdpDevice.h => ProviderUdp.h} | 8 ++++---- 39 files changed, 101 insertions(+), 101 deletions(-) rename libsrc/leddevice/{LedHIDDevice.cpp => ProviderHID.cpp} (91%) rename libsrc/leddevice/{LedHIDDevice.h => ProviderHID.h} (85%) rename libsrc/leddevice/{LedRs232Device.cpp => ProviderRs232.cpp} (89%) rename libsrc/leddevice/{LedRs232Device.h => ProviderRs232.h} (86%) rename libsrc/leddevice/{LedSpiDevice.cpp => ProviderSpi.cpp} (87%) rename libsrc/leddevice/{LedSpiDevice.h => ProviderSpi.h} (87%) rename libsrc/leddevice/{LedUdpDevice.cpp => ProviderUdp.cpp} (87%) rename libsrc/leddevice/{LedUdpDevice.h => ProviderUdp.h} (84%) diff --git a/libsrc/leddevice/CMakeLists.txt b/libsrc/leddevice/CMakeLists.txt index 2061f34f..4816ccd7 100755 --- a/libsrc/leddevice/CMakeLists.txt +++ b/libsrc/leddevice/CMakeLists.txt @@ -15,12 +15,12 @@ include_directories( # Group the headers that go through the MOC compiler SET(Leddevice_QT_HEADERS ${CURRENT_HEADER_DIR}/LedDevice.h - ${CURRENT_SOURCE_DIR}/LedRs232Device.h + ${CURRENT_SOURCE_DIR}/ProviderRs232.h ${CURRENT_SOURCE_DIR}/LedDeviceAdalight.h ${CURRENT_SOURCE_DIR}/LedDeviceAdalightApa102.h ${CURRENT_SOURCE_DIR}/LedDeviceAtmoOrb.h ${CURRENT_SOURCE_DIR}/LedDevicePhilipsHue.h - ${CURRENT_SOURCE_DIR}/LedHIDDevice.h + ${CURRENT_SOURCE_DIR}/ProviderHID.h ${CURRENT_SOURCE_DIR}/LedDeviceRawHID.h ${CURRENT_SOURCE_DIR}/LedDeviceFadeCandy.h ) @@ -36,7 +36,7 @@ SET(Leddevice_HEADERS ${CURRENT_SOURCE_DIR}/LedDeviceFile.h ${CURRENT_SOURCE_DIR}/LedDeviceUdpRaw.h ${CURRENT_SOURCE_DIR}/LedDeviceUdpE131.h - ${CURRENT_SOURCE_DIR}/LedUdpDevice.h + ${CURRENT_SOURCE_DIR}/ProviderUdp.h ${CURRENT_SOURCE_DIR}/LedDeviceHyperionUsbasp.h ${CURRENT_SOURCE_DIR}/LedDeviceTpm2.h ${CURRENT_SOURCE_DIR}/LedDeviceTpm2net.h @@ -47,8 +47,8 @@ SET(Leddevice_SOURCES ${CURRENT_SOURCE_DIR}/LedDevice.cpp ${CURRENT_SOURCE_DIR}/LedDeviceFactory.cpp - ${CURRENT_SOURCE_DIR}/LedRs232Device.cpp - ${CURRENT_SOURCE_DIR}/LedHIDDevice.cpp + ${CURRENT_SOURCE_DIR}/ProviderRs232.cpp + ${CURRENT_SOURCE_DIR}/ProviderHID.cpp ${CURRENT_SOURCE_DIR}/LedDeviceAdalight.cpp ${CURRENT_SOURCE_DIR}/LedDeviceAdalightApa102.cpp @@ -63,7 +63,7 @@ SET(Leddevice_SOURCES ${CURRENT_SOURCE_DIR}/LedDeviceFadeCandy.cpp ${CURRENT_SOURCE_DIR}/LedDeviceUdpRaw.cpp ${CURRENT_SOURCE_DIR}/LedDeviceUdpE131.cpp - ${CURRENT_SOURCE_DIR}/LedUdpDevice.cpp + ${CURRENT_SOURCE_DIR}/ProviderUdp.cpp ${CURRENT_SOURCE_DIR}/LedDeviceHyperionUsbasp.cpp ${CURRENT_SOURCE_DIR}/LedDevicePhilipsHue.cpp ${CURRENT_SOURCE_DIR}/LedDeviceTpm2.cpp @@ -74,7 +74,7 @@ SET(Leddevice_SOURCES if(ENABLE_SPIDEV) SET(Leddevice_HEADERS ${Leddevice_HEADERS} - ${CURRENT_SOURCE_DIR}/LedSpiDevice.h + ${CURRENT_SOURCE_DIR}/ProviderSpi.h ${CURRENT_SOURCE_DIR}/LedDeviceLpd6803.h ${CURRENT_SOURCE_DIR}/LedDeviceLpd8806.h ${CURRENT_SOURCE_DIR}/LedDeviceP9813.h @@ -85,7 +85,7 @@ if(ENABLE_SPIDEV) ) SET(Leddevice_SOURCES ${Leddevice_SOURCES} - ${CURRENT_SOURCE_DIR}/LedSpiDevice.cpp + ${CURRENT_SOURCE_DIR}/ProviderSpi.cpp ${CURRENT_SOURCE_DIR}/LedDeviceLpd6803.cpp ${CURRENT_SOURCE_DIR}/LedDeviceLpd8806.cpp ${CURRENT_SOURCE_DIR}/LedDeviceP9813.cpp diff --git a/libsrc/leddevice/LedDeviceAPA102.cpp b/libsrc/leddevice/LedDeviceAPA102.cpp index 3f2ff87e..b2314b85 100644 --- a/libsrc/leddevice/LedDeviceAPA102.cpp +++ b/libsrc/leddevice/LedDeviceAPA102.cpp @@ -13,7 +13,7 @@ #include "LedDeviceAPA102.h" LedDeviceAPA102::LedDeviceAPA102(const Json::Value &deviceConfig) - : LedSpiDevice(deviceConfig) + : ProviderSpi(deviceConfig) { _latchTime_ns = 500000; } diff --git a/libsrc/leddevice/LedDeviceAPA102.h b/libsrc/leddevice/LedDeviceAPA102.h index 07271696..d7411429 100644 --- a/libsrc/leddevice/LedDeviceAPA102.h +++ b/libsrc/leddevice/LedDeviceAPA102.h @@ -4,13 +4,13 @@ #include // hyperion incluse -#include "LedSpiDevice.h" +#include "ProviderSpi.h" #include /// /// Implementation of the LedDevice interface for writing to APA102 led device. /// -class LedDeviceAPA102 : public LedSpiDevice +class LedDeviceAPA102 : public ProviderSpi { public: /// diff --git a/libsrc/leddevice/LedDeviceAdalight.cpp b/libsrc/leddevice/LedDeviceAdalight.cpp index 880417cc..a2c6ad71 100644 --- a/libsrc/leddevice/LedDeviceAdalight.cpp +++ b/libsrc/leddevice/LedDeviceAdalight.cpp @@ -13,7 +13,7 @@ #include LedDeviceAdalight::LedDeviceAdalight(const Json::Value &deviceConfig) - : LedRs232Device(deviceConfig) + : ProviderRs232(deviceConfig) , _timer() { // setup the timer diff --git a/libsrc/leddevice/LedDeviceAdalight.h b/libsrc/leddevice/LedDeviceAdalight.h index e3f647a5..35a9f4af 100644 --- a/libsrc/leddevice/LedDeviceAdalight.h +++ b/libsrc/leddevice/LedDeviceAdalight.h @@ -7,12 +7,12 @@ #include // hyperion include -#include "LedRs232Device.h" +#include "ProviderRs232.h" /// /// Implementation of the LedDevice interface for writing to an Adalight led device. /// -class LedDeviceAdalight : public LedRs232Device +class LedDeviceAdalight : public ProviderRs232 { Q_OBJECT diff --git a/libsrc/leddevice/LedDeviceAtmo.cpp b/libsrc/leddevice/LedDeviceAtmo.cpp index d4878aff..b4467a8d 100644 --- a/libsrc/leddevice/LedDeviceAtmo.cpp +++ b/libsrc/leddevice/LedDeviceAtmo.cpp @@ -2,7 +2,7 @@ #include "LedDeviceAtmo.h" LedDeviceAtmo::LedDeviceAtmo(const Json::Value &deviceConfig) - : LedRs232Device(deviceConfig) + : ProviderRs232(deviceConfig) { _ledBuffer.resize(4 + 5*3); // 4-byte header, 5 RGB values _ledBuffer[0] = 0xFF; // Startbyte diff --git a/libsrc/leddevice/LedDeviceAtmo.h b/libsrc/leddevice/LedDeviceAtmo.h index 18ccfd5d..8bb54cdf 100644 --- a/libsrc/leddevice/LedDeviceAtmo.h +++ b/libsrc/leddevice/LedDeviceAtmo.h @@ -4,12 +4,12 @@ #include // hyperion incluse -#include "LedRs232Device.h" +#include "ProviderRs232.h" /// /// Implementation of the LedDevice interface for writing to serial device using tpm2 protocol. /// -class LedDeviceAtmo : public LedRs232Device +class LedDeviceAtmo : public ProviderRs232 { public: /// diff --git a/libsrc/leddevice/LedDeviceLpd6803.cpp b/libsrc/leddevice/LedDeviceLpd6803.cpp index 13ca4d93..37559ef7 100644 --- a/libsrc/leddevice/LedDeviceLpd6803.cpp +++ b/libsrc/leddevice/LedDeviceLpd6803.cpp @@ -11,7 +11,7 @@ #include "LedDeviceLpd6803.h" LedDeviceLpd6803::LedDeviceLpd6803(const Json::Value &deviceConfig) - : LedSpiDevice(deviceConfig) + : ProviderSpi(deviceConfig) { } diff --git a/libsrc/leddevice/LedDeviceLpd6803.h b/libsrc/leddevice/LedDeviceLpd6803.h index 9ed64125..ff228912 100644 --- a/libsrc/leddevice/LedDeviceLpd6803.h +++ b/libsrc/leddevice/LedDeviceLpd6803.h @@ -1,7 +1,7 @@ #pragma once // Local hyperion incluse -#include "LedSpiDevice.h" +#include "ProviderSpi.h" /// /// Implementation of the LedDevice interface for writing to LDP6803 led device. @@ -14,7 +14,7 @@ /// (R, G and B in the above illustration) making 16 bits per led. Total bytes = 4 + (2 x number of /// leds) /// -class LedDeviceLpd6803 : public LedSpiDevice +class LedDeviceLpd6803 : public ProviderSpi { public: /// diff --git a/libsrc/leddevice/LedDeviceLpd8806.cpp b/libsrc/leddevice/LedDeviceLpd8806.cpp index ba096c98..1c95d752 100644 --- a/libsrc/leddevice/LedDeviceLpd8806.cpp +++ b/libsrc/leddevice/LedDeviceLpd8806.cpp @@ -11,7 +11,7 @@ #include "LedDeviceLpd8806.h" LedDeviceLpd8806::LedDeviceLpd8806(const Json::Value &deviceConfig) - : LedSpiDevice(deviceConfig) + : ProviderSpi(deviceConfig) { } diff --git a/libsrc/leddevice/LedDeviceLpd8806.h b/libsrc/leddevice/LedDeviceLpd8806.h index ca87f3e2..e4b7803a 100644 --- a/libsrc/leddevice/LedDeviceLpd8806.h +++ b/libsrc/leddevice/LedDeviceLpd8806.h @@ -1,7 +1,7 @@ #pragma once // Local hyperion incluse -#include "LedSpiDevice.h" +#include "ProviderSpi.h" /// /// Implementation of the LedDevice interface for writing to LPD8806 led device. @@ -75,7 +75,7 @@ /// /// The number of zeroes in the 'clear data' is (#led/32 + 1)bytes (or *8 for bits) /// -class LedDeviceLpd8806 : public LedSpiDevice +class LedDeviceLpd8806 : public ProviderSpi { public: /// diff --git a/libsrc/leddevice/LedDeviceP9813.cpp b/libsrc/leddevice/LedDeviceP9813.cpp index 9e3e5a40..1305aa09 100644 --- a/libsrc/leddevice/LedDeviceP9813.cpp +++ b/libsrc/leddevice/LedDeviceP9813.cpp @@ -12,7 +12,7 @@ #include "LedDeviceP9813.h" LedDeviceP9813::LedDeviceP9813(const Json::Value &deviceConfig) - : LedSpiDevice(deviceConfig) + : ProviderSpi(deviceConfig) { } diff --git a/libsrc/leddevice/LedDeviceP9813.h b/libsrc/leddevice/LedDeviceP9813.h index 54236d2e..06b01b4d 100644 --- a/libsrc/leddevice/LedDeviceP9813.h +++ b/libsrc/leddevice/LedDeviceP9813.h @@ -4,12 +4,12 @@ #include // hyperion include -#include "LedSpiDevice.h" +#include "ProviderSpi.h" /// /// Implementation of the LedDevice interface for writing to P9813 led device. /// -class LedDeviceP9813 : public LedSpiDevice +class LedDeviceP9813 : public ProviderSpi { public: /// diff --git a/libsrc/leddevice/LedDevicePaintpack.cpp b/libsrc/leddevice/LedDevicePaintpack.cpp index b27126f5..15ed5c05 100644 --- a/libsrc/leddevice/LedDevicePaintpack.cpp +++ b/libsrc/leddevice/LedDevicePaintpack.cpp @@ -4,7 +4,7 @@ // Use out report HID device LedDevicePaintpack::LedDevicePaintpack(const Json::Value &deviceConfig) - : LedHIDDevice(deviceConfig) + : ProviderHID(deviceConfig) { _useFeature = false; } diff --git a/libsrc/leddevice/LedDevicePaintpack.h b/libsrc/leddevice/LedDevicePaintpack.h index cdfaac83..8a0c54fa 100644 --- a/libsrc/leddevice/LedDevicePaintpack.h +++ b/libsrc/leddevice/LedDevicePaintpack.h @@ -4,12 +4,12 @@ #include // Hyperion includes -#include "LedHIDDevice.h" +#include "ProviderHID.h" /// /// LedDevice implementation for a paintpack device () /// -class LedDevicePaintpack : public LedHIDDevice +class LedDevicePaintpack : public ProviderHID { public: /// diff --git a/libsrc/leddevice/LedDeviceRawHID.cpp b/libsrc/leddevice/LedDeviceRawHID.cpp index 13a4b10d..3ea3cc37 100644 --- a/libsrc/leddevice/LedDeviceRawHID.cpp +++ b/libsrc/leddevice/LedDeviceRawHID.cpp @@ -13,7 +13,7 @@ // Use feature report HID device LedDeviceRawHID::LedDeviceRawHID(const Json::Value &deviceConfig) - : LedHIDDevice(deviceConfig) + : ProviderHID(deviceConfig) , _timer() { _useFeature = true; diff --git a/libsrc/leddevice/LedDeviceRawHID.h b/libsrc/leddevice/LedDeviceRawHID.h index 6e2d63ae..53a3569f 100644 --- a/libsrc/leddevice/LedDeviceRawHID.h +++ b/libsrc/leddevice/LedDeviceRawHID.h @@ -7,12 +7,12 @@ #include // hyperion include -#include "LedHIDDevice.h" +#include "ProviderHID.h" /// /// Implementation of the LedDevice interface for writing to an RawHID led device. /// -class LedDeviceRawHID : public LedHIDDevice +class LedDeviceRawHID : public ProviderHID { Q_OBJECT diff --git a/libsrc/leddevice/LedDeviceSedu.cpp b/libsrc/leddevice/LedDeviceSedu.cpp index 54a4e216..6bdc70c4 100644 --- a/libsrc/leddevice/LedDeviceSedu.cpp +++ b/libsrc/leddevice/LedDeviceSedu.cpp @@ -18,7 +18,7 @@ struct FrameSpec }; LedDeviceSedu::LedDeviceSedu(const Json::Value &deviceConfig) - : LedRs232Device(deviceConfig) + : ProviderRs232(deviceConfig) { // empty } diff --git a/libsrc/leddevice/LedDeviceSedu.h b/libsrc/leddevice/LedDeviceSedu.h index e83ccceb..9a67f1de 100644 --- a/libsrc/leddevice/LedDeviceSedu.h +++ b/libsrc/leddevice/LedDeviceSedu.h @@ -4,12 +4,12 @@ #include // hyperion incluse -#include "LedRs232Device.h" +#include "ProviderRs232.h" /// /// Implementation of the LedDevice interface for writing to SEDU led device. /// -class LedDeviceSedu : public LedRs232Device +class LedDeviceSedu : public ProviderRs232 { public: /// diff --git a/libsrc/leddevice/LedDeviceSk6812SPI.cpp b/libsrc/leddevice/LedDeviceSk6812SPI.cpp index 6e25a69d..cb6cf412 100644 --- a/libsrc/leddevice/LedDeviceSk6812SPI.cpp +++ b/libsrc/leddevice/LedDeviceSk6812SPI.cpp @@ -12,7 +12,7 @@ #include "LedDeviceSk6812SPI.h" LedDeviceSk6812SPI::LedDeviceSk6812SPI(const Json::Value &deviceConfig) - : LedSpiDevice(deviceConfig) + : ProviderSpi(deviceConfig) , bitpair_to_byte { 0b10001000, 0b10001100, @@ -32,7 +32,7 @@ LedDevice* LedDeviceSk6812SPI::construct(const Json::Value &deviceConfig) bool LedDeviceSk6812SPI::setConfig(const Json::Value &deviceConfig) { - LedSpiDevice::setConfig(deviceConfig); + ProviderSpi::setConfig(deviceConfig); _whiteAlgorithm = deviceConfig.get("white_algorithm","").asString(); return true; diff --git a/libsrc/leddevice/LedDeviceSk6812SPI.h b/libsrc/leddevice/LedDeviceSk6812SPI.h index 2f79d26d..29ab4772 100644 --- a/libsrc/leddevice/LedDeviceSk6812SPI.h +++ b/libsrc/leddevice/LedDeviceSk6812SPI.h @@ -4,12 +4,12 @@ #include // hyperion incluse -#include "LedSpiDevice.h" +#include "ProviderSpi.h" /// /// Implementation of the LedDevice interface for writing to Sk6801 led device. /// -class LedDeviceSk6812SPI : public LedSpiDevice +class LedDeviceSk6812SPI : public ProviderSpi { public: /// diff --git a/libsrc/leddevice/LedDeviceTpm2.cpp b/libsrc/leddevice/LedDeviceTpm2.cpp index ab5d9c80..e15045c4 100644 --- a/libsrc/leddevice/LedDeviceTpm2.cpp +++ b/libsrc/leddevice/LedDeviceTpm2.cpp @@ -9,7 +9,7 @@ #include LedDeviceTpm2::LedDeviceTpm2(const Json::Value &deviceConfig) - : LedRs232Device(deviceConfig) + : ProviderRs232(deviceConfig) { } diff --git a/libsrc/leddevice/LedDeviceTpm2.h b/libsrc/leddevice/LedDeviceTpm2.h index dab57be9..39e0a3ae 100644 --- a/libsrc/leddevice/LedDeviceTpm2.h +++ b/libsrc/leddevice/LedDeviceTpm2.h @@ -4,12 +4,12 @@ #include // hyperion incluse -#include "LedRs232Device.h" +#include "ProviderRs232.h" /// /// Implementation of the LedDevice interface for writing to serial device using tpm2 protocol. /// -class LedDeviceTpm2 : public LedRs232Device +class LedDeviceTpm2 : public ProviderRs232 { public: /// diff --git a/libsrc/leddevice/LedDeviceUdpE131.cpp b/libsrc/leddevice/LedDeviceUdpE131.cpp index 043a5bb4..c1c5506b 100644 --- a/libsrc/leddevice/LedDeviceUdpE131.cpp +++ b/libsrc/leddevice/LedDeviceUdpE131.cpp @@ -13,7 +13,7 @@ #include "LedDeviceUdpE131.h" LedDeviceUdpE131::LedDeviceUdpE131(const Json::Value &deviceConfig) - : LedUdpDevice(deviceConfig) + : ProviderUdp(deviceConfig) { setConfig(deviceConfig); @@ -21,7 +21,7 @@ LedDeviceUdpE131::LedDeviceUdpE131(const Json::Value &deviceConfig) bool LedDeviceUdpE131::setConfig(const Json::Value &deviceConfig) { - LedUdpDevice::setConfig(deviceConfig); + ProviderUdp::setConfig(deviceConfig); _LatchTime_ns = deviceConfig.get("latchtime",104000).asInt(); _e131_universe = deviceConfig.get("universe",1).asInt(); diff --git a/libsrc/leddevice/LedDeviceUdpE131.h b/libsrc/leddevice/LedDeviceUdpE131.h index 700adf29..6ddc8821 100644 --- a/libsrc/leddevice/LedDeviceUdpE131.h +++ b/libsrc/leddevice/LedDeviceUdpE131.h @@ -4,7 +4,7 @@ #include // hyperion includes -#include "LedUdpDevice.h" +#include "ProviderUdp.h" /* * @@ -96,7 +96,7 @@ typedef union { /// /// Implementation of the LedDevice interface for sending led colors via udp/E1.31 packets /// -class LedDeviceUdpE131 : public LedUdpDevice +class LedDeviceUdpE131 : public ProviderUdp { public: /// diff --git a/libsrc/leddevice/LedDeviceUdpRaw.cpp b/libsrc/leddevice/LedDeviceUdpRaw.cpp index cbc75bd1..81cf892f 100644 --- a/libsrc/leddevice/LedDeviceUdpRaw.cpp +++ b/libsrc/leddevice/LedDeviceUdpRaw.cpp @@ -12,14 +12,14 @@ #include "LedDeviceUdpRaw.h" LedDeviceUdpRaw::LedDeviceUdpRaw(const Json::Value &deviceConfig) - : LedUdpDevice(deviceConfig) + : ProviderUdp(deviceConfig) { setConfig(deviceConfig); } bool LedDeviceUdpRaw::setConfig(const Json::Value &deviceConfig) { - LedUdpDevice::setConfig(deviceConfig); + ProviderUdp::setConfig(deviceConfig); _LatchTime_ns = deviceConfig.get("latchtime",500000).asInt(); return true; diff --git a/libsrc/leddevice/LedDeviceUdpRaw.h b/libsrc/leddevice/LedDeviceUdpRaw.h index 81f8439b..980c414c 100644 --- a/libsrc/leddevice/LedDeviceUdpRaw.h +++ b/libsrc/leddevice/LedDeviceUdpRaw.h @@ -4,12 +4,12 @@ #include // hyperion incluse -#include "LedUdpDevice.h" +#include "ProviderUdp.h" /// /// Implementation of the LedDevice interface for sending led colors via udp. /// -class LedDeviceUdpRaw : public LedUdpDevice +class LedDeviceUdpRaw : public ProviderUdp { public: /// diff --git a/libsrc/leddevice/LedDeviceWs2801.cpp b/libsrc/leddevice/LedDeviceWs2801.cpp index f34e113d..b3d5e81a 100644 --- a/libsrc/leddevice/LedDeviceWs2801.cpp +++ b/libsrc/leddevice/LedDeviceWs2801.cpp @@ -12,7 +12,7 @@ #include "LedDeviceWs2801.h" LedDeviceWs2801::LedDeviceWs2801(const Json::Value &deviceConfig) - : LedSpiDevice(deviceConfig) + : ProviderSpi(deviceConfig) { } diff --git a/libsrc/leddevice/LedDeviceWs2801.h b/libsrc/leddevice/LedDeviceWs2801.h index a7afee5f..7961fea3 100644 --- a/libsrc/leddevice/LedDeviceWs2801.h +++ b/libsrc/leddevice/LedDeviceWs2801.h @@ -4,12 +4,12 @@ #include // hyperion incluse -#include "LedSpiDevice.h" +#include "ProviderSpi.h" /// /// Implementation of the LedDevice interface for writing to Ws2801 led device. /// -class LedDeviceWs2801 : public LedSpiDevice +class LedDeviceWs2801 : public ProviderSpi { public: /// diff --git a/libsrc/leddevice/LedDeviceWs2812SPI.cpp b/libsrc/leddevice/LedDeviceWs2812SPI.cpp index 5fbd2134..abef4d0e 100644 --- a/libsrc/leddevice/LedDeviceWs2812SPI.cpp +++ b/libsrc/leddevice/LedDeviceWs2812SPI.cpp @@ -12,7 +12,7 @@ #include "LedDeviceWs2812SPI.h" LedDeviceWs2812SPI::LedDeviceWs2812SPI(const Json::Value &deviceConfig) - : LedSpiDevice(deviceConfig) + : ProviderSpi(deviceConfig) , bitpair_to_byte { 0b10001000, 0b10001100, diff --git a/libsrc/leddevice/LedDeviceWs2812SPI.h b/libsrc/leddevice/LedDeviceWs2812SPI.h index bc1f01b1..aaeb18b3 100644 --- a/libsrc/leddevice/LedDeviceWs2812SPI.h +++ b/libsrc/leddevice/LedDeviceWs2812SPI.h @@ -4,12 +4,12 @@ #include // hyperion incluse -#include "LedSpiDevice.h" +#include "ProviderSpi.h" /// /// Implementation of the LedDevice interface for writing to Ws2801 led device. /// -class LedDeviceWs2812SPI : public LedSpiDevice +class LedDeviceWs2812SPI : public ProviderSpi { public: /// diff --git a/libsrc/leddevice/LedHIDDevice.cpp b/libsrc/leddevice/ProviderHID.cpp similarity index 91% rename from libsrc/leddevice/LedHIDDevice.cpp rename to libsrc/leddevice/ProviderHID.cpp index f3672e2f..2149f165 100644 --- a/libsrc/leddevice/LedHIDDevice.cpp +++ b/libsrc/leddevice/ProviderHID.cpp @@ -7,9 +7,9 @@ #include // Local Hyperion includes -#include "LedHIDDevice.h" +#include "ProviderHID.h" -LedHIDDevice::LedHIDDevice(const Json::Value &deviceConfig) +ProviderHID::ProviderHID(const Json::Value &deviceConfig) : _useFeature(false) , _deviceHandle(nullptr) , _blockedForDelay(false) @@ -17,7 +17,7 @@ LedHIDDevice::LedHIDDevice(const Json::Value &deviceConfig) setConfig(deviceConfig); } -LedHIDDevice::~LedHIDDevice() +ProviderHID::~ProviderHID() { if (_deviceHandle != nullptr) { @@ -28,7 +28,7 @@ LedHIDDevice::~LedHIDDevice() hid_exit(); } -bool LedHIDDevice::setConfig(const Json::Value &deviceConfig) +bool ProviderHID::setConfig(const Json::Value &deviceConfig) { _delayAfterConnect_ms = deviceConfig.get("delayAfterConnect", 0 ).asInt(); auto VendorIdString = deviceConfig.get("VID", "0x2341").asString(); @@ -41,7 +41,7 @@ bool LedHIDDevice::setConfig(const Json::Value &deviceConfig) return true; } -int LedHIDDevice::open() +int ProviderHID::open() { // Initialize the usb context int error = hid_init(); @@ -97,7 +97,7 @@ int LedHIDDevice::open() } -int LedHIDDevice::writeBytes(const unsigned size, const uint8_t * data) +int ProviderHID::writeBytes(const unsigned size, const uint8_t * data) { if (_blockedForDelay) { return 0; @@ -156,7 +156,7 @@ int LedHIDDevice::writeBytes(const unsigned size, const uint8_t * data) return ret; } -void LedHIDDevice::unblockAfterDelay() +void ProviderHID::unblockAfterDelay() { Debug(_log,"Device unblocked"); _blockedForDelay = false; diff --git a/libsrc/leddevice/LedHIDDevice.h b/libsrc/leddevice/ProviderHID.h similarity index 85% rename from libsrc/leddevice/LedHIDDevice.h rename to libsrc/leddevice/ProviderHID.h index 6db51ac0..4dbb9255 100644 --- a/libsrc/leddevice/LedHIDDevice.h +++ b/libsrc/leddevice/ProviderHID.h @@ -9,9 +9,9 @@ #include /// -/// The LedHIDDevice implements an abstract base-class for LedDevices using an HID-device. +/// The ProviderHID implements an abstract base-class for LedDevices using an HID-device. /// -class LedHIDDevice : public LedDevice +class ProviderHID : public LedDevice { Q_OBJECT @@ -21,12 +21,12 @@ public: /// /// @param deviceConfig json device config /// - LedHIDDevice(const Json::Value &deviceConfig); + ProviderHID(const Json::Value &deviceConfig); /// /// Destructor of the LedDevice; closes the output device if it is open /// - virtual ~LedHIDDevice(); + virtual ~ProviderHID(); /// /// Sets configuration diff --git a/libsrc/leddevice/LedRs232Device.cpp b/libsrc/leddevice/ProviderRs232.cpp similarity index 89% rename from libsrc/leddevice/LedRs232Device.cpp rename to libsrc/leddevice/ProviderRs232.cpp index fea6541f..819d6953 100644 --- a/libsrc/leddevice/LedRs232Device.cpp +++ b/libsrc/leddevice/ProviderRs232.cpp @@ -7,9 +7,9 @@ #include // Local Hyperion includes -#include "LedRs232Device.h" +#include "ProviderRs232.h" -LedRs232Device::LedRs232Device(const Json::Value &deviceConfig) +ProviderRs232::ProviderRs232(const Json::Value &deviceConfig) : _rs232Port(this) , _blockedForDelay(false) , _stateChanged(true) @@ -18,7 +18,7 @@ LedRs232Device::LedRs232Device(const Json::Value &deviceConfig) connect(&_rs232Port, SIGNAL(error(QSerialPort::SerialPortError)), this, SLOT(error(QSerialPort::SerialPortError))); } -bool LedRs232Device::setConfig(const Json::Value &deviceConfig) +bool ProviderRs232::setConfig(const Json::Value &deviceConfig) { closeDevice(); _deviceName = deviceConfig["output"].asString(); @@ -28,7 +28,7 @@ bool LedRs232Device::setConfig(const Json::Value &deviceConfig) return true; } -void LedRs232Device::error(QSerialPort::SerialPortError error) +void ProviderRs232::error(QSerialPort::SerialPortError error) { if ( error != QSerialPort::NoError ) { @@ -64,13 +64,13 @@ void LedRs232Device::error(QSerialPort::SerialPortError error) } } -LedRs232Device::~LedRs232Device() +ProviderRs232::~ProviderRs232() { disconnect(&_rs232Port, SIGNAL(error(QSerialPort::SerialPortError)), this, SLOT(error(QSerialPort::SerialPortError))); closeDevice(); } -void LedRs232Device::closeDevice() +void ProviderRs232::closeDevice() { if (_rs232Port.isOpen()) { @@ -79,7 +79,7 @@ void LedRs232Device::closeDevice() } } -int LedRs232Device::open() +int ProviderRs232::open() { Info(_log, "Opening UART: %s", _deviceName.c_str()); _rs232Port.setPortName(_deviceName.c_str()); @@ -88,7 +88,7 @@ int LedRs232Device::open() } -bool LedRs232Device::tryOpen() +bool ProviderRs232::tryOpen() { if ( ! _rs232Port.isOpen() ) { @@ -116,7 +116,7 @@ bool LedRs232Device::tryOpen() } -int LedRs232Device::writeBytes(const unsigned size, const uint8_t * data) +int ProviderRs232::writeBytes(const unsigned size, const uint8_t * data) { if (_blockedForDelay) { @@ -143,7 +143,7 @@ int LedRs232Device::writeBytes(const unsigned size, const uint8_t * data) } -void LedRs232Device::unblockAfterDelay() +void ProviderRs232::unblockAfterDelay() { Debug(_log, "Device unblocked"); _blockedForDelay = false; diff --git a/libsrc/leddevice/LedRs232Device.h b/libsrc/leddevice/ProviderRs232.h similarity index 86% rename from libsrc/leddevice/LedRs232Device.h rename to libsrc/leddevice/ProviderRs232.h index d321835d..4287aed9 100644 --- a/libsrc/leddevice/LedRs232Device.h +++ b/libsrc/leddevice/ProviderRs232.h @@ -7,9 +7,9 @@ #include /// -/// The LedRs232Device implements an abstract base-class for LedDevices using a RS232-device. +/// The ProviderRs232 implements an abstract base-class for LedDevices using a RS232-device. /// -class LedRs232Device : public LedDevice +class ProviderRs232 : public LedDevice { Q_OBJECT @@ -19,7 +19,7 @@ public: /// /// @param deviceConfig json device config /// - LedRs232Device(const Json::Value &deviceConfig); + ProviderRs232(const Json::Value &deviceConfig); /// /// Sets configuration @@ -31,7 +31,7 @@ public: /// /// Destructor of the LedDevice; closes the output device if it is open /// - virtual ~LedRs232Device(); + virtual ~ProviderRs232(); /// /// Opens and configures the output device diff --git a/libsrc/leddevice/LedSpiDevice.cpp b/libsrc/leddevice/ProviderSpi.cpp similarity index 87% rename from libsrc/leddevice/LedSpiDevice.cpp rename to libsrc/leddevice/ProviderSpi.cpp index bc2e3b66..754f7b0a 100644 --- a/libsrc/leddevice/LedSpiDevice.cpp +++ b/libsrc/leddevice/ProviderSpi.cpp @@ -10,11 +10,11 @@ #include // Local Hyperion includes -#include "LedSpiDevice.h" +#include "ProviderSpi.h" #include -LedSpiDevice::LedSpiDevice(const Json::Value &deviceConfig) +ProviderSpi::ProviderSpi(const Json::Value &deviceConfig) : LedDevice() , _fid(-1) { @@ -23,12 +23,12 @@ LedSpiDevice::LedSpiDevice(const Json::Value &deviceConfig) Debug(_log, "_spiDataInvert %d, _spiMode %d", _spiDataInvert, _spiMode); } -LedSpiDevice::~LedSpiDevice() +ProviderSpi::~ProviderSpi() { // close(_fid); } -bool LedSpiDevice::setConfig(const Json::Value &deviceConfig) +bool ProviderSpi::setConfig(const Json::Value &deviceConfig) { _deviceName = deviceConfig.get("output","/dev/spidev0.0").asString(); _baudRate_Hz = deviceConfig.get("rate",1000000).asInt(); @@ -39,7 +39,7 @@ bool LedSpiDevice::setConfig(const Json::Value &deviceConfig) return true; } -int LedSpiDevice::open() +int ProviderSpi::open() { const int bitsPerWord = 8; @@ -69,7 +69,7 @@ int LedSpiDevice::open() return 0; } -int LedSpiDevice::writeBytes(const unsigned size, const uint8_t * data) +int ProviderSpi::writeBytes(const unsigned size, const uint8_t * data) { if (_fid < 0) { diff --git a/libsrc/leddevice/LedSpiDevice.h b/libsrc/leddevice/ProviderSpi.h similarity index 87% rename from libsrc/leddevice/LedSpiDevice.h rename to libsrc/leddevice/ProviderSpi.h index 8bc920c3..9425b621 100644 --- a/libsrc/leddevice/LedSpiDevice.h +++ b/libsrc/leddevice/ProviderSpi.h @@ -7,9 +7,9 @@ #include /// -/// The LedSpiDevice implements an abstract base-class for LedDevices using the SPI-device. +/// The ProviderSpi implements an abstract base-class for LedDevices using the SPI-device. /// -class LedSpiDevice : public LedDevice +class ProviderSpi : public LedDevice { public: /// @@ -17,7 +17,7 @@ public: /// /// @param deviceConfig json device config /// - LedSpiDevice(const Json::Value &deviceConfig); + ProviderSpi(const Json::Value &deviceConfig); /// /// Sets configuration @@ -29,7 +29,7 @@ public: /// /// Destructor of the LedDevice; closes the output device if it is open /// - virtual ~LedSpiDevice(); + virtual ~ProviderSpi(); /// /// Opens and configures the output device diff --git a/libsrc/leddevice/LedUdpDevice.cpp b/libsrc/leddevice/ProviderUdp.cpp similarity index 87% rename from libsrc/leddevice/LedUdpDevice.cpp rename to libsrc/leddevice/ProviderUdp.cpp index 5bfbe69b..03ac61f0 100644 --- a/libsrc/leddevice/LedUdpDevice.cpp +++ b/libsrc/leddevice/ProviderUdp.cpp @@ -13,9 +13,9 @@ #include // Local Hyperion includes -#include "LedUdpDevice.h" +#include "ProviderUdp.h" -LedUdpDevice::LedUdpDevice(const Json::Value &deviceConfig) +ProviderUdp::ProviderUdp(const Json::Value &deviceConfig) : LedDevice() , _LatchTime_ns(-1) { @@ -23,12 +23,12 @@ LedUdpDevice::LedUdpDevice(const Json::Value &deviceConfig) _udpSocket = new QUdpSocket(); } -LedUdpDevice::~LedUdpDevice() +ProviderUdp::~ProviderUdp() { _udpSocket->close(); } -bool LedUdpDevice::setConfig(const Json::Value &deviceConfig) +bool ProviderUdp::setConfig(const Json::Value &deviceConfig) { if (_address.setAddress( QString::fromStdString(deviceConfig["host"].asString()) ) ) { @@ -52,7 +52,7 @@ bool LedUdpDevice::setConfig(const Json::Value &deviceConfig) return true; } -int LedUdpDevice::open() +int ProviderUdp::open() { QHostAddress localAddress = QHostAddress::Any; quint16 localPort = 0; @@ -62,7 +62,7 @@ int LedUdpDevice::open() return 0; } -int LedUdpDevice::writeBytes(const unsigned size, const uint8_t * data) +int ProviderUdp::writeBytes(const unsigned size, const uint8_t * data) { qint64 retVal = _udpSocket->writeDatagram((const char *)data,size,_address,_port); diff --git a/libsrc/leddevice/LedUdpDevice.h b/libsrc/leddevice/ProviderUdp.h similarity index 84% rename from libsrc/leddevice/LedUdpDevice.h rename to libsrc/leddevice/ProviderUdp.h index d1faa366..b5f9ec37 100644 --- a/libsrc/leddevice/LedUdpDevice.h +++ b/libsrc/leddevice/ProviderUdp.h @@ -7,9 +7,9 @@ #include /// -/// The LedUdpDevice implements an abstract base-class for LedDevices using the SPI-device. +/// The ProviderUdp implements an abstract base-class for LedDevices using the SPI-device. /// -class LedUdpDevice : public LedDevice +class ProviderUdp : public LedDevice { public: /// @@ -17,12 +17,12 @@ public: /// /// @param deviceConfig json device config /// - LedUdpDevice(const Json::Value &deviceConfig); + ProviderUdp(const Json::Value &deviceConfig); /// /// Destructor of the LedDevice; closes the output device if it is open /// - virtual ~LedUdpDevice(); + virtual ~ProviderUdp(); /// /// Sets configuration From c13f2e20ec2bba4ba8fca7cd3efc4dacce07b008 Mon Sep 17 00:00:00 2001 From: penfold42 Date: Sun, 28 Aug 2016 18:45:18 +1000 Subject: [PATCH 016/133] Added source and cid to e1.31 driver. (#207) source defaults to "hyperion on " cid defautls to randomly generated on each startup "device" : { "name" : "DMX_e131", "type" : "e131", "universe" : 1, "cid" : "{204b83c-efb5-4b23-b2d0-35939d561061}", "source-name": "This is my custom e1.31 source", "host" : "239.255.0.1", "port" : 5568, "colorOrder" : "rgb" }, --- libsrc/leddevice/LedDeviceUdpE131.cpp | 20 ++++++++++++++++---- libsrc/leddevice/LedDeviceUdpE131.h | 8 ++++++-- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/libsrc/leddevice/LedDeviceUdpE131.cpp b/libsrc/leddevice/LedDeviceUdpE131.cpp index c1c5506b..1e93b732 100644 --- a/libsrc/leddevice/LedDeviceUdpE131.cpp +++ b/libsrc/leddevice/LedDeviceUdpE131.cpp @@ -9,6 +9,9 @@ #include #include +#include +#include + // hyperion local includes #include "LedDeviceUdpE131.h" @@ -24,6 +27,17 @@ bool LedDeviceUdpE131::setConfig(const Json::Value &deviceConfig) ProviderUdp::setConfig(deviceConfig); _LatchTime_ns = deviceConfig.get("latchtime",104000).asInt(); _e131_universe = deviceConfig.get("universe",1).asInt(); + _e131_source_name = deviceConfig.get("source-name","hyperion on "+QHostInfo::localHostName().toStdString()).asString(); + QString _json_cid = QString::fromStdString(deviceConfig.get("cid","").asString()); + + if (_json_cid.isEmpty()) + { + _e131_cid = QUuid::createUuid(); + Debug( _log, "e131 no cid found, generated %s", _e131_cid.toString().toStdString().c_str()); + } else { + _e131_cid = QUuid(_json_cid); + Debug( _log, "e131 cid found, using %s", _e131_cid.toString().toStdString().c_str()); + } return true; } @@ -33,8 +47,6 @@ LedDevice* LedDeviceUdpE131::construct(const Json::Value &deviceConfig) return new LedDeviceUdpE131(deviceConfig); } -#define CID "hyperion!\0" -#define SOURCE_NAME "hyperion on hostname\0" // populates the headers void LedDeviceUdpE131::prepare(const unsigned this_universe, const unsigned this_dmxChannelCount) @@ -47,12 +59,12 @@ void LedDeviceUdpE131::prepare(const unsigned this_universe, const unsigned this memcpy (e131_packet.acn_id, _acn_id, 12); e131_packet.root_flength = htons(0x7000 | (110+this_dmxChannelCount) ); e131_packet.root_vector = htonl(VECTOR_ROOT_E131_DATA); - memcpy (e131_packet.cid, CID, sizeof(CID) ); + memcpy (e131_packet.cid, _e131_cid.toRfc4122().constData() , sizeof(e131_packet.cid) ); /* Frame Layer */ e131_packet.frame_flength = htons(0x7000 | (88+this_dmxChannelCount)); e131_packet.frame_vector = htonl(VECTOR_E131_DATA_PACKET); - memcpy (e131_packet.source_name, SOURCE_NAME, sizeof(SOURCE_NAME)); + snprintf (e131_packet.source_name, sizeof(e131_packet.source_name), "%s", _e131_source_name.c_str() ); e131_packet.priority = 100; e131_packet.reserved = htons(0); e131_packet.options = 0; // Bit 7 = Preview_Data diff --git a/libsrc/leddevice/LedDeviceUdpE131.h b/libsrc/leddevice/LedDeviceUdpE131.h index 6ddc8821..5fc62bff 100644 --- a/libsrc/leddevice/LedDeviceUdpE131.h +++ b/libsrc/leddevice/LedDeviceUdpE131.h @@ -6,6 +6,8 @@ // hyperion includes #include "ProviderUdp.h" +#include + /* * * https://raw.githubusercontent.com/forkineye/ESPixelStick/master/_E131.h @@ -55,12 +57,12 @@ typedef union { uint8_t acn_id[12]; uint16_t root_flength; uint32_t root_vector; - uint8_t cid[16]; + char cid[16]; /* Frame Layer */ uint16_t frame_flength; uint32_t frame_vector; - uint8_t source_name[64]; + char source_name[64]; uint8_t priority; uint16_t reserved; uint8_t sequence_number; @@ -135,4 +137,6 @@ private: uint8_t _e131_seq = 0; uint8_t _e131_universe = 1; uint8_t _acn_id[12] = {0x41, 0x53, 0x43, 0x2d, 0x45, 0x31, 0x2e, 0x31, 0x37, 0x00, 0x00, 0x00 }; + std::string _e131_source_name; + QUuid _e131_cid; }; From 61db9f43b89df52309aa0b1bb3538078ba261781 Mon Sep 17 00:00:00 2001 From: Rick van Hattem Date: Sun, 28 Aug 2016 15:10:43 +0200 Subject: [PATCH 017/133] Qcommandlineparser (#199) * Replaced getoptplusplus with QCommandLineParser. Fixes #39 * enabling C++11 if possible * enabling C++11 if possible * fixed gcc compilation issues * fixed linux builds and improved os x build * trying to fix dispmanx * trying to fix dispmanx * simplified travis build script * fixed argumentparser default values * rewrote validator system and made sure default arguments are processed correctly * rewrote validator system and made sure default arguments are processed correctly * fixed bool vs. regular options * oops... removing debug code * reverted screenshot api change --- .gitignore | 12 + .travis/travis_build.sh | 42 +- .travis/travis_install.sh | 11 +- CMakeLists.txt | 111 +- bin/.gitignore | 1 + config/.gitignore | 1 + dependencies/CMakeLists.txt | 1 - .../build/getoptPlusPlus/CMakeLists.txt | 9 - dependencies/build/getoptPlusPlus/COPYING | 66 - dependencies/build/getoptPlusPlus/Makefile | 16 - dependencies/build/getoptPlusPlus/README | 8 - .../build/getoptPlusPlus/config.doxygen | 1630 ----------------- dependencies/build/getoptPlusPlus/getoptpp.cc | 357 ---- dependencies/build/getoptPlusPlus/test.cc | 196 -- .../getoptPlusPlus-master-20130810.zip | Bin 33117 -> 0 bytes .../include/getoptPlusPlus/getoptpp.h | 398 ---- .../getoptPlusPlus/parameter.include.cc | 177 -- doc/.gitignore | 3 + include/commandline/BooleanOption.h | 35 + include/commandline/ColorOption.h | 41 + include/commandline/ColorsOption.h | 41 + include/commandline/DoubleOption.h | 40 + include/commandline/ImageOption.h | 41 + include/commandline/IntOption.h | 41 + include/commandline/Option.h | 49 + include/commandline/Parser.h | 120 ++ include/commandline/RegularExpressionOption.h | 71 + include/commandline/SwitchOption.h | 45 + include/commandline/ValidatorOption.h | 42 + include/protoserver/ProtoConnectionWrapper.h | 2 +- libsrc/CMakeLists.txt | 1 + libsrc/commandline/BooleanOption.cpp | 3 + libsrc/commandline/CMakeLists.txt | 42 + libsrc/commandline/ColorOption.cpp | 30 + libsrc/commandline/ColorsOption.cpp | 37 + libsrc/commandline/DoubleOption.cpp | 20 + libsrc/commandline/ImageOption.cpp | 18 + libsrc/commandline/IntOption.cpp | 20 + libsrc/commandline/Option.cpp | 26 + libsrc/commandline/Parser.cpp | 90 + .../commandline/RegularExpressionOption.cpp | 4 + libsrc/commandline/SwitchOption.cpp | 5 + libsrc/commandline/ValidatorOption.cpp | 25 + libsrc/protoserver/ProtoConnectionWrapper.cpp | 7 +- src/hyperion-aml/CMakeLists.txt | 2 +- src/hyperion-aml/hyperion-aml.cpp | 62 +- src/hyperion-dispmanx/CMakeLists.txt | 2 +- src/hyperion-dispmanx/hyperion-dispmanx.cpp | 81 +- src/hyperion-framebuffer/CMakeLists.txt | 2 +- .../hyperion-framebuffer.cpp | 60 +- src/hyperion-osx/CMakeLists.txt | 2 +- src/hyperion-osx/hyperion-osx.cpp | 96 +- src/hyperion-remote/CMakeLists.txt | 6 +- src/hyperion-remote/ColorAdjustmentValues.h | 12 - src/hyperion-remote/ColorCorrectionValues.h | 12 - src/hyperion-remote/ColorTransformValues.h | 12 - src/hyperion-remote/CustomParameter.h | 197 -- src/hyperion-remote/JsonConnection.cpp | 136 +- src/hyperion-remote/JsonConnection.h | 49 +- src/hyperion-remote/hyperion-remote.cpp | 326 ++-- src/hyperion-v4l2/CMakeLists.txt | 4 +- src/hyperion-v4l2/PixelFormatParameter.h | 43 - src/hyperion-v4l2/ScreenshotHandler.cpp | 4 +- src/hyperion-v4l2/ScreenshotHandler.h | 4 +- src/hyperion-v4l2/VideoStandardParameter.h | 39 - src/hyperion-v4l2/hyperion-v4l2.cpp | 142 +- src/hyperion-x11/CMakeLists.txt | 2 +- src/hyperion-x11/hyperion-x11.cpp | 82 +- src/hyperiond/CMakeLists.txt | 2 +- src/hyperiond/hyperiond.cpp | 2 + src/hyperiond/hyperiond.h | 2 + src/hyperiond/main.cpp | 61 +- test/dispmanx2png/CMakeLists.txt | 1 - test/dispmanx2png/dispmanx2png.cpp | 21 +- 74 files changed, 1490 insertions(+), 3911 deletions(-) create mode 100644 bin/.gitignore create mode 100644 config/.gitignore delete mode 100644 dependencies/build/getoptPlusPlus/CMakeLists.txt delete mode 100644 dependencies/build/getoptPlusPlus/COPYING delete mode 100644 dependencies/build/getoptPlusPlus/Makefile delete mode 100644 dependencies/build/getoptPlusPlus/README delete mode 100644 dependencies/build/getoptPlusPlus/config.doxygen delete mode 100644 dependencies/build/getoptPlusPlus/getoptpp.cc delete mode 100644 dependencies/build/getoptPlusPlus/test.cc delete mode 100644 dependencies/getoptPlusPlus-master-20130810.zip delete mode 100644 dependencies/include/getoptPlusPlus/getoptpp.h delete mode 100644 dependencies/include/getoptPlusPlus/parameter.include.cc create mode 100644 doc/.gitignore create mode 100644 include/commandline/BooleanOption.h create mode 100644 include/commandline/ColorOption.h create mode 100644 include/commandline/ColorsOption.h create mode 100644 include/commandline/DoubleOption.h create mode 100644 include/commandline/ImageOption.h create mode 100644 include/commandline/IntOption.h create mode 100644 include/commandline/Option.h create mode 100644 include/commandline/Parser.h create mode 100644 include/commandline/RegularExpressionOption.h create mode 100644 include/commandline/SwitchOption.h create mode 100644 include/commandline/ValidatorOption.h create mode 100644 libsrc/commandline/BooleanOption.cpp create mode 100644 libsrc/commandline/CMakeLists.txt create mode 100644 libsrc/commandline/ColorOption.cpp create mode 100644 libsrc/commandline/ColorsOption.cpp create mode 100644 libsrc/commandline/DoubleOption.cpp create mode 100644 libsrc/commandline/ImageOption.cpp create mode 100644 libsrc/commandline/IntOption.cpp create mode 100644 libsrc/commandline/Option.cpp create mode 100644 libsrc/commandline/Parser.cpp create mode 100644 libsrc/commandline/RegularExpressionOption.cpp create mode 100644 libsrc/commandline/SwitchOption.cpp create mode 100644 libsrc/commandline/ValidatorOption.cpp delete mode 100644 src/hyperion-remote/ColorAdjustmentValues.h delete mode 100644 src/hyperion-remote/ColorCorrectionValues.h delete mode 100644 src/hyperion-remote/ColorTransformValues.h delete mode 100644 src/hyperion-remote/CustomParameter.h delete mode 100644 src/hyperion-v4l2/PixelFormatParameter.h delete mode 100644 src/hyperion-v4l2/VideoStandardParameter.h diff --git a/.gitignore b/.gitignore index 11c9c013..b7b2e79c 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,15 @@ .DS_Store CMakeFiles/ __/ + +# Ignoring autogenerated files +*.cmake +Makefile +qrc_*.cpp +*.qrc.depends +moc_*.cpp +moc_*.cpp_parameters +CMakeCache.txt +*.log +/HyperionConfig.h +/lib diff --git a/.travis/travis_build.sh b/.travis/travis_build.sh index d274d8ff..0c84cf20 100755 --- a/.travis/travis_build.sh +++ b/.travis/travis_build.sh @@ -1,32 +1,32 @@ #!/bin/bash # for executing in non travis environment -[ -z "$TRAVIS_OS_NAME" ] && TRAVIS_OS_NAME="$( uname -s | tr '[:upper:]' '[:lower:]' )" +[ -z "$TRAVIS_OS_NAME" ] && TRAVIS_OS_NAME="$(uname -s | tr 'A-Z' 'a-z')" -###################################### -## COMPILE HYPERION +# Detect number of processor cores -# compile hyperion on osx -if [[ $TRAVIS_OS_NAME == 'osx' ]] -then +if [[ $TRAVIS_OS_NAME == 'osx' || $TRAVIS_OS_NAME == 'darwin' ]]; then procs=$(sysctl -n hw.ncpu | xargs) - echo "Processes: $procs" - - mkdir build || exit 1 - cd build - cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_TESTS=ON -Wno-dev .. || exit 2 - make -j$procs || exit 3 - # make -j$(nproc) package || exit 4 # currently osx(dmg) package creation not implemented +elif [[ $TRAVIS_OS_NAME == 'linux' ]]; then + procs=$(nproc) +else + # For most modern systems, including the pi, this is a sane default + procs=4 fi -# compile hyperion on linux -if [[ $TRAVIS_OS_NAME == 'linux' ]] -then - mkdir build || exit 1 - cd build - cmake -DPLATFORM=x86-dev -DCMAKE_BUILD_TYPE=Debug .. || exit 2 - make -j$(nproc) || exit 3 - make -j$(nproc) package || exit 4 + +# Compile hyperion + +mkdir build || exit 1 +cd build +cmake -DPLATFORM=x86-dev -DCMAKE_BUILD_TYPE=Debug .. || exit 2 +make -j$(nproc) || exit 3 + + +# Build the package on Linux + +if [[ $TRAVIS_OS_NAME == 'linux' ]]; then + make -j$(nproc) package || exit 4 fi diff --git a/.travis/travis_install.sh b/.travis/travis_install.sh index cb013543..af198a6e 100755 --- a/.travis/travis_install.sh +++ b/.travis/travis_install.sh @@ -1,7 +1,10 @@ #!/bin/bash +# for executing in non travis environment +[ -z "$TRAVIS_OS_NAME" ] && TRAVIS_OS_NAME="$( uname -s | tr '[:upper:]' '[:lower:]' )" + # install osx deps for hyperion compile -if [[ $TRAVIS_OS_NAME == 'osx' ]] +if [[ $TRAVIS_OS_NAME == 'osx' || $TRAVIS_OS_NAME == 'darwin' ]] then echo "Install OSX deps" time brew update @@ -9,13 +12,15 @@ then time brew install libusb || true time brew install cmake || true time brew install doxygen || true -fi # install linux deps for hyperion compile -if [[ $TRAVIS_OS_NAME == 'linux' ]] +elif [[ $TRAVIS_OS_NAME == 'linux' ]] then echo "Install linux deps" sudo apt-get -qq update sudo apt-get install -qq -y qtbase5-dev libqt5serialport5-dev libusb-1.0-0-dev python-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev doxygen +else + echo "Unsupported platform: $TRAVIS_OS_NAME" + exit 5 fi diff --git a/CMakeLists.txt b/CMakeLists.txt index 956c91a0..46e35bf2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,55 +30,58 @@ SET ( DEFAULT_USE_SHARED_AVAHI_LIBS OFF ) SET ( DEFAULT_USE_AVAHI_LIBS ON ) SET ( DEFAULT_TESTS OFF ) +if ( NOT DEFINED PLATFORM ) + if ( "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86" ) + SET( PLATFORM "x86") + elseif ( "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm" ) + SET( PLATFORM "rpi") + EXEC_PROGRAM( "nproc" OUTPUT_VARIABLE SYSTEM_CPU_CORES ) + FILE( READ /proc/cpuinfo SYSTEM_CPUINFO ) + STRING ( TOLOWER "${SYSTEM_CPUINFO}" SYSTEM_CPUINFO ) + if ( "${SYSTEM_CPUINFO}" MATCHES "amlogic" ) + SET( PLATFORM "wetek" ) + elseif( SYSTEM_CPU_CORES GREATER 1 AND "${SYSTEM_CPUINFO}" MATCHES "bcm" ) + SET( PLATFORM "rpi-pwm" ) + endif() + endif() + if ( PLATFORM ) + message( STATUS "PLATFORM is not defined, evaluated platform: ${PLATFORM}") + else() + message( FATAL_ERROR "PLATFORM is not defined and could not be evaluated. Set -DPLATFORM=") + endif() +endif() + +if ( "${PLATFORM}" STREQUAL "rpi" ) + SET ( DEFAULT_DISPMANX ON ) +elseif ( "${PLATFORM}" STREQUAL "rpi-pwm" ) + SET ( DEFAULT_DISPMANX ON ) + SET ( DEFAULT_WS2812BPWM ON ) + SET ( DEFAULT_WS281XPWM ON ) +elseif ( "${PLATFORM}" STREQUAL "wetek" ) + SET ( DEFAULT_AMLOGIC ON ) +elseif ( "${PLATFORM}" STREQUAL "x86" ) + SET ( DEFAULT_X11 ON ) + SET ( DEFAULT_USE_SHARED_AVAHI_LIBS ON ) +elseif ( "${PLATFORM}" STREQUAL "x86-dev" ) + SET ( DEFAULT_X11 ON ) + SET ( DEFAULT_AMLOGIC ON) + SET ( DEFAULT_WS281XPWM ON ) + SET ( DEFAULT_USE_SHARED_AVAHI_LIBS ON ) + SET ( DEFAULT_TESTS ON ) +elseif ( "${PLATFORM}" STREQUAL "imx6" ) + SET ( DEFAULT_FB ON ) +endif() + if (APPLE) - set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "/usr/local/opt/qt5") + set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "/usr/local/opt/qt5") + include_directories("/opt/X11/include/") SET ( DEFAULT_OSX ON ) - SET ( DEFAULT_V4L2 OFF ) + SET ( DEFAULT_V4L2 OFF ) SET ( DEFAULT_SPIDEV OFF ) SET ( DEFAULT_FB OFF ) - SET ( DEFAULT_USE_AVAHI_LIBS OFF ) -else () - if ( NOT DEFINED PLATFORM ) - if ( "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86" ) - SET( PLATFORM "x86") - elseif ( "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm" ) - SET( PLATFORM "rpi") - EXEC_PROGRAM( "nproc" OUTPUT_VARIABLE SYSTEM_CPU_CORES ) - FILE( READ /proc/cpuinfo SYSTEM_CPUINFO ) - STRING ( TOLOWER "${SYSTEM_CPUINFO}" SYSTEM_CPUINFO ) - if ( "${SYSTEM_CPUINFO}" MATCHES "amlogic" ) - SET( PLATFORM "wetek" ) - elseif( SYSTEM_CPU_CORES GREATER 1 AND "${SYSTEM_CPUINFO}" MATCHES "bcm" ) - SET( PLATFORM "rpi-pwm" ) - endif() - endif() - if ( PLATFORM ) - message( STATUS "PLATFORM is not defined, evaluated platform: ${PLATFORM}") - else() - message( FATAL_ERROR "PLATFORM is not defined and could not be evaluated. Set -DPLATFORM=") - endif() - endif() - - if ( "${PLATFORM}" STREQUAL "rpi" ) - SET ( DEFAULT_DISPMANX ON ) - elseif ( "${PLATFORM}" STREQUAL "rpi-pwm" ) - SET ( DEFAULT_DISPMANX ON ) - SET ( DEFAULT_WS2812BPWM ON ) - SET ( DEFAULT_WS281XPWM ON ) - elseif ( "${PLATFORM}" STREQUAL "wetek" ) - SET ( DEFAULT_AMLOGIC ON ) - elseif ( "${PLATFORM}" STREQUAL "x86" ) - SET ( DEFAULT_X11 ON ) - SET ( DEFAULT_USE_SHARED_AVAHI_LIBS ON ) - elseif ( "${PLATFORM}" STREQUAL "x86-dev" ) - SET ( DEFAULT_X11 ON ) - SET ( DEFAULT_AMLOGIC ON) - SET ( DEFAULT_WS281XPWM ON ) - SET ( DEFAULT_USE_SHARED_AVAHI_LIBS ON ) - SET ( DEFAULT_TESTS ON ) - elseif ( "${PLATFORM}" STREQUAL "imx6" ) - SET ( DEFAULT_FB ON ) - endif() + SET ( DEFAULT_WS281XPWM OFF ) + SET ( DEFAULT_USE_AVAHI_LIBS OFF ) + SET ( DEFAULT_USE_SHARED_AVAHI_LIBS OFF ) endif () # set the build options @@ -124,10 +127,6 @@ message(STATUS "ENABLE_PROFILER = " ${ENABLE_PROFILER}) SET ( PROTOBUF_INSTALL_BIN_DIR ${CMAKE_BINARY_DIR}/proto ) SET ( PROTOBUF_INSTALL_LIB_DIR ${CMAKE_BINARY_DIR}/proto ) -#if(ENABLE_QT5) -# TODO vs ENABLE_QT4? -#endif(ENABLE_QT5) - # Createt the configuration file # Add project specific cmake modules (find, etc) @@ -156,8 +155,18 @@ include_directories(${CMAKE_SOURCE_DIR}/include) #set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so") # enable C++11 -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall") -#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++11 -Wall") +include(CheckCXXCompilerFlag) +CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) +CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") +if(COMPILER_SUPPORTS_CXX11) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +elseif(COMPILER_SUPPORTS_CXX0X) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") +else() + message(STATUS "No support for C++11 detected. Compilation will most likely fail on your compiler") +endif() SET(QT_MIN_VERSION "5.2.0") find_package(Qt5 COMPONENTS Core Gui Network REQUIRED) diff --git a/bin/.gitignore b/bin/.gitignore new file mode 100644 index 00000000..7a132693 --- /dev/null +++ b/bin/.gitignore @@ -0,0 +1 @@ +protoc diff --git a/config/.gitignore b/config/.gitignore new file mode 100644 index 00000000..6830205c --- /dev/null +++ b/config/.gitignore @@ -0,0 +1 @@ +/*.json diff --git a/dependencies/CMakeLists.txt b/dependencies/CMakeLists.txt index 07dc7af4..dce78257 100644 --- a/dependencies/CMakeLists.txt +++ b/dependencies/CMakeLists.txt @@ -1,4 +1,3 @@ -add_subdirectory(build/getoptPlusPlus) add_subdirectory(build/hidapi) add_subdirectory(build/jsoncpp) add_subdirectory(build/tinkerforge) diff --git a/dependencies/build/getoptPlusPlus/CMakeLists.txt b/dependencies/build/getoptPlusPlus/CMakeLists.txt deleted file mode 100644 index e19880da..00000000 --- a/dependencies/build/getoptPlusPlus/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -project(getoptPlusPlus) - -include_directories( - ../../include/getoptPlusPlus) - -add_library(getoptPlusPlus - ../../include/getoptPlusPlus/getoptpp.h - ../../include/getoptPlusPlus/parameter.include.cc - getoptpp.cc) diff --git a/dependencies/build/getoptPlusPlus/COPYING b/dependencies/build/getoptPlusPlus/COPYING deleted file mode 100644 index 641905ac..00000000 --- a/dependencies/build/getoptPlusPlus/COPYING +++ /dev/null @@ -1,66 +0,0 @@ -GNU LESSER GENERAL PUBLIC LICENSE - -Version 3, 29 June 2007 - -Copyright © 2007 Free Software Foundation, Inc. - -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - -This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. -0. Additional Definitions. - -As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL” refers to version 3 of the GNU General Public License. - -“The Library” refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. - -An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. - -A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”. - -The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. - -The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. -1. Exception to Section 3 of the GNU GPL. - -You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. -2. Conveying Modified Versions. - -If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: - - * a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or - * b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. - -3. Object Code Incorporating Material from Library Header Files. - -The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: - - * a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. - * b) Accompany the object code with a copy of the GNU GPL and this license document. - -4. Combined Works. - -You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: - - * a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. - * b) Accompany the Combined Work with a copy of the GNU GPL and this license document. - * c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. - * d) Do one of the following: - o 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. - o 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. - * e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) - -5. Combined Libraries. - -You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: - - * a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. - * b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. - -6. Revised Versions of the GNU Lesser General Public License. - -The Free Software Foundation may publish revised and/or new versions of the GNU Lesser 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 Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. - -If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. - diff --git a/dependencies/build/getoptPlusPlus/Makefile b/dependencies/build/getoptPlusPlus/Makefile deleted file mode 100644 index d6be12e2..00000000 --- a/dependencies/build/getoptPlusPlus/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -SOURCES=getoptpp.cc test.cc -HEADERS=getoptpp.h -OBJECTS=$(SOURCES:.cc=.o) -LDFLAGS= -CXXFLAGS=-O0 -ggdb -Wall -CFLAGS=$(CXXFLAGS) -CC=g++ -TARGET=getopt-test - -all: $(TARGET) -$(TARGET): $(OBJECTS) - $(CXX) $(LDFLAGS) -o $(TARGET) $(OBJECTS) -$(SOURCES): $(HEADERS) - -clean: - rm -rf $(TARGET) $(OBJECTS) *~ diff --git a/dependencies/build/getoptPlusPlus/README b/dependencies/build/getoptPlusPlus/README deleted file mode 100644 index 0ef16591..00000000 --- a/dependencies/build/getoptPlusPlus/README +++ /dev/null @@ -1,8 +0,0 @@ -A very small class library that replaces getopt() and -getopt_long()-functionality with a more C++-friendly approach. - -Additionally, it does not rely on UNIX-specific code. - -See test.cc for a sample application and COPYING for license information. - - diff --git a/dependencies/build/getoptPlusPlus/config.doxygen b/dependencies/build/getoptPlusPlus/config.doxygen deleted file mode 100644 index 9ac6e568..00000000 --- a/dependencies/build/getoptPlusPlus/config.doxygen +++ /dev/null @@ -1,1630 +0,0 @@ -# Doxyfile 1.7.1 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, -# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, -# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, -# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = YES - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 8 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given extension. -# Doxygen has a built-in mapping, but you can override or extend it using this -# tag. The format is ext=language, where ext is a file extension, and language -# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, -# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make -# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C -# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions -# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate getter -# and setter methods for a property. Setting this option to YES (the default) -# will make doxygen to replace the get and set methods by a property in the -# documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the -# methods anyway, you should set this option to NO. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -TYPEDEF_HIDES_STRUCT = NO - -# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to -# determine which symbols to keep in memory and which to flush to disk. -# When the cache is full, less often used symbols will be written to disk. -# For small to medium size projects (<1000 input files) the default value is -# probably good enough. For larger projects a too small cache size can cause -# doxygen to be busy swapping symbols to and from disk most of the time -# causing a significant performance penality. -# If the system has enough physical memory increasing the cache will improve the -# performance by keeping more symbols in memory. Note that the value works on -# a logarithmic scale so increasing the size by one will rougly double the -# memory usage. The cache size is given by this formula: -# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols - -SYMBOL_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = NO - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespace are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen -# will list include files with double quotes in the documentation -# rather than with sharp brackets. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen -# will sort the (brief and detailed) documentation of class members so that -# constructors and destructors are listed first. If set to NO (the default) -# the constructors will appear in the respective orders defined by -# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. -# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO -# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is NO. - -SHOW_DIRECTORIES = NO - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. -# This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. The create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. -# You can optionally specify a file name after the option, if omitted -# DoxygenLayout.xml will be used as the name of the layout file. - -LAYOUT_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be abled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for -# the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx -# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 - -FILE_PATTERNS = - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = NO - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. -# If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. -# Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. -# The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER -# is applied to all files. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. -# Otherwise they will link to the documentation. - -REFERENCES_LINK_SOURCE = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = YES - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. -# Doxygen will adjust the colors in the stylesheet and background images -# according to this color. Hue is specified as an angle on a colorwheel, -# see http://en.wikipedia.org/wiki/Hue for more information. -# For instance the value 0 represents red, 60 is yellow, 120 is green, -# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. -# The allowed range is 0 to 359. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of -# the colors in the HTML output. For a value of 0 the output will use -# grayscales only. A value of 255 will produce the most vivid colors. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to -# the luminance component of the colors in the HTML output. Values below -# 100 gradually make the output lighter, whereas values above 100 make -# the output darker. The value divided by 100 is the actual gamma applied, -# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, -# and 100 does not change the gamma. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting -# this to NO can help when comparing the output of multiple runs. - -HTML_TIMESTAMP = YES - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. For this to work a browser that supports -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox -# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). - -HTML_DYNAMIC_SECTIONS = NO - -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX 10.5 (Leopard). -# To create a documentation set, doxygen will generate a Makefile in the -# HTML output directory. Running make will produce the docset in that -# directory and running "make install" will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find -# it at startup. -# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. - -GENERATE_DOCSET = NO - -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. - -CHM_INDEX_ENCODING = - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated -# that can be used as input for Qt's qhelpgenerator to generate a -# Qt Compressed Help (.qch) of the generated HTML documentation. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders - -QHP_VIRTUAL_FOLDER = doc - -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to -# add. For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see -# -# Qt Help Project / Custom Filters. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's -# filter section matches. -# -# Qt Help Project / Filter Attributes. - -QHP_SECT_FILTER_ATTRS = - -# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can -# be used to specify the location of Qt's qhelpgenerator. -# If non-empty doxygen will try to run qhelpgenerator on the generated -# .qhp file. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files -# will be generated, which together with the HTML files, form an Eclipse help -# plugin. To install this plugin and make it available under the help contents -# menu in Eclipse, the contents of the directory containing the HTML and XML -# files needs to be copied into the plugins directory of eclipse. The name of -# the directory within the plugins directory should be the same as -# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before -# the help appears. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have -# this name. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to YES, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). -# Windows users are probably better off using the HTML help feature. - -GENERATE_TREEVIEW = NO - -# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, -# and Class Hierarchy pages using a tree view instead of an ordered list. - -USE_INLINE_TREES = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open -# links to external symbols imported via tag files in a separate window. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are -# not supported properly for IE 6.0, but are supported on all modern browsers. -# Note that when changing this option you need to delete any form_*.png files -# in the HTML output before the changes have effect. - -FORMULA_TRANSPARENT = YES - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box -# for the HTML output. The underlying search engine uses javascript -# and DHTML and should work on any modern browser. Note that when using -# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets -# (GENERATE_DOCSET) there is already a search function so this one should -# typically be disabled. For large projects the javascript based search engine -# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. - -SEARCHENGINE = YES - -# When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a PHP enabled web server instead of at the web client -# using Javascript. Doxygen will generate the search PHP script and index -# file to put on the web server. The advantage of the server -# based approach is that it scales better to large projects and allows -# full text search. The disadvances is that it is more difficult to setup -# and does not have live searching capabilities. - -SERVER_BASED_SEARCH = NO - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. -# Note that when enabling USE_PDFLATEX this option is only used for -# generating bitmaps for formulas in the HTML output, but not in the -# Makefile that is written to the output directory. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = YES - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = YES - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -# If LATEX_SOURCE_CODE is set to YES then doxygen will include -# source code with syntax highlighting in the LaTeX output. -# Note that which sources are shown also depends on other settings -# such as SOURCE_BROWSER. - -LATEX_SOURCE_CODE = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. -# This is useful -# if you want to understand what is going on. -# On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse -# the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option is superseded by the HAVE_DOT option below. This is only a -# fallback. It is recommended to install and use dot, since it yields more -# powerful graphs. - -CLASS_DIAGRAMS = YES - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = NO - -# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is -# allowed to run in parallel. When set to 0 (the default) doxygen will -# base this on the number of processors available in the system. You can set it -# explicitly to a value larger than 0 to get control over the balance -# between CPU load and processing speed. - -DOT_NUM_THREADS = 0 - -# By default doxygen will write a font called FreeSans.ttf to the output -# directory and reference it in all dot files that doxygen generates. This -# font does not include all possible unicode characters however, so when you need -# these (or just want a differently looking font) you can specify the font name -# using DOT_FONTNAME. You need need to make sure dot is able to find the font, -# which can be done by putting it in a standard location or by setting the -# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory -# containing the font. - -DOT_FONTNAME = FreeSans.ttf - -# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. -# The default size is 10pt. - -DOT_FONTSIZE = 10 - -# By default doxygen will tell dot to use the output directory to look for the -# FreeSans.ttf font (which doxygen will put there itself). If you specify a -# different font using DOT_FONTNAME you can set the path where dot -# can find it using this tag. - -DOT_FONTPATH = - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not -# seem to support this out of the box. Warning: Depending on the platform used, -# enabling this option may lead to badly anti-aliased labels on the edges of -# a graph (i.e. they become hard to read). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = YES - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES diff --git a/dependencies/build/getoptPlusPlus/getoptpp.cc b/dependencies/build/getoptPlusPlus/getoptpp.cc deleted file mode 100644 index 37212901..00000000 --- a/dependencies/build/getoptPlusPlus/getoptpp.cc +++ /dev/null @@ -1,357 +0,0 @@ -/* (C) 2011 Viktor Lofgren - * - * 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 - * 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 . - */ - -#include "getoptpp.h" -#include -#include -#include -#include -#include - -using namespace std; - -namespace vlofgren { - -/* -* -* Class OptionsParser -* -* -*/ - - -OptionsParser::OptionsParser(const char* programDesc) : fprogramDesc(programDesc) {} -OptionsParser::~OptionsParser() {} - -ParameterSet& OptionsParser::getParameters() { - return parameters; -} - -void OptionsParser::parse(int argc, const char* argv[]) throw(runtime_error) -{ - argv0 = argv[0]; - - if(argc == 1) return; - - vector v(&argv[1], &argv[argc]); - - ParserState state(/* *this,*/ v); - - for(; !state.end(); state.advance()) { - - std::list::iterator i; - - for(i = parameters.parameters.begin(); - i != parameters.parameters.end(); i++) - { - int n = 0; - try - { - n = (*i)->receive(state); - } - catch(Parameter::ExpectedArgument &) - { - throw Parameter::ExpectedArgument(state.get() + ": expected an argument"); - } - catch(Parameter::UnexpectedArgument &) - { - throw Parameter::UnexpectedArgument(state.get() + ": did not expect an argument"); - } - catch(Switchable::SwitchingError &) - { - throw Parameter::ParameterRejected(state.get() + ": parameter already set"); - } - catch(Parameter::ParameterRejected & pr) { - std::string what = pr.what(); - if(what.length()) - { - throw Parameter::ParameterRejected(state.get() + ": " + what); - } - throw Parameter::ParameterRejected(state.get() + " (unspecified error)"); - } - - for (int j = 1; j < n; ++j) - { - state.advance(); - } - - if(n != 0) - { - break; - } - } - - if(i == parameters.parameters.end()) { - std::string file = state.get(); - if(file == "--") { - state.advance(); - break; - } - else if(file.at(0) == '-') - throw Parameter::ParameterRejected(string("Bad parameter: ") + file); - else files.push_back(state.get()); - } - } - - if(!state.end()) for(; !state.end(); state.advance()) { - files.push_back(state.get()); - } - -} - -void OptionsParser::usage() const { - cerr << fprogramDesc << endl; - cerr << "Build time: " << __DATE__ << " " << __TIME__ << endl << endl; - cerr << "Usage: " << programName() << " [OPTIONS]" << endl << endl; - - cerr << "Parameters: " << endl; - - int totalWidth = 80; - int usageWidth = 33; - - // read total width from the terminal - struct winsize w; - if (ioctl(0, TIOCGWINSZ, &w) == 0) - { - if (w.ws_col > totalWidth) - totalWidth = w.ws_col; - } - - std::list::const_iterator i; - for(i = parameters.parameters.begin(); - i != parameters.parameters.end(); i++) - { - cerr.width(usageWidth); - cerr << std::left << " " + (*i)->usageLine(); - - std::string description = (*i)->description(); - while (int(description.length()) > (totalWidth - usageWidth)) - { - size_t pos = description.find_last_of(' ', totalWidth - usageWidth); - cerr << description.substr(0, pos) << std::endl << std::string(usageWidth - 1, ' '); - description = description.substr(pos); - } - cerr << description << endl; - - } -} - -const vector& OptionsParser::getFiles() const { - return files; -} - -const string& OptionsParser::programName() const { - return argv0; -} - -/* -* Parameter set -* -* -*/ - -ParameterSet::ParameterSet(const ParameterSet& ps) { - throw new runtime_error("ParameterSet not copyable"); -} - -ParameterSet::~ParameterSet() { - for(std::list::iterator i = parameters.begin(); - i != parameters.end(); i++) - { - delete *i; - } - -} - -/* The typical use case for command line arguments makes linear searching completely -* acceptable here. -*/ - -Parameter& ParameterSet::operator[](char c) const { - for(std::list::const_iterator i = parameters.begin(); i!= parameters.end(); i++) { - if((*i)->shortOption() == c) return *(*i); - } - throw out_of_range("ParameterSet["+string(&c)+string("]")); -} - - -Parameter& ParameterSet::operator[](const string& param) const { - for(std::list::const_iterator i = parameters.begin(); i!= parameters.end(); i++) { - if((*i)->longOption() == param) return *(*i); - } - throw out_of_range("ParameterSet["+param+"]"); -} - - - -/* -* -* Class ParserState -* -* -*/ - - -ParserState::ParserState(/*OptionsParser &opts, */vector& args) : - /*opts(opts),*/ arguments(args), iterator(args.begin()) -{ - -} - -const string ParserState::peek() const { - vector::const_iterator next = iterator+1; - if(next != arguments.end()) return *next; - else return ""; - -} - -const string ParserState::get() const { - if(!end()) return *iterator; - else return ""; -} - -void ParserState::advance() { - iterator++; -} - -bool ParserState::end() const { - return iterator == arguments.end(); -} - - -/* -* -* Class Parameter -* -* -*/ - - - -Parameter::Parameter(char shortOption, const std::string & longOption, const std::string & description) : - fshortOption(shortOption), flongOption(longOption), fdescription(description) -{ - -} - -Parameter::~Parameter() {} - -const string& Parameter::description() const { return fdescription; } -const string& Parameter::longOption() const { return flongOption; } -bool Parameter::hasShortOption() const { return fshortOption != 0x0; } -char Parameter::shortOption() const { assert(hasShortOption()); return fshortOption; } - -/* -* -* Class Switchable -* -* -*/ - -bool Switchable::isSet() const { return fset; } -Switchable::~Switchable() {}; -Switchable::Switchable() : fset(false) {} - -void MultiSwitchable::set() throw (Switchable::SwitchingError) { fset = true; } -MultiSwitchable::~MultiSwitchable() {} - - -void UniquelySwitchable::set() throw (Switchable::SwitchingError) { - if(UniquelySwitchable::isSet()) throw Switchable::SwitchingError(); - fset = true; -} -UniquelySwitchable::~UniquelySwitchable() {} - - -PresettableUniquelySwitchable::~PresettableUniquelySwitchable() {} -bool PresettableUniquelySwitchable::isSet() const { - return UniquelySwitchable::isSet() || fpreset.isSet(); -} -void PresettableUniquelySwitchable::set() throw (Switchable::SwitchingError) -{ - UniquelySwitchable::set(); -} -void PresettableUniquelySwitchable::preset() { - fpreset.set(); -} - -/* -* -* PODParameter specializations -* -* -* -*/ - - -template<> -PODParameter::PODParameter(char shortOption, const char *longOption, - const char* description) : CommonParameter(shortOption, longOption, description) { -} - - -template<> -int PODParameter::validate(const string &s) throw(Parameter::ParameterRejected) -{ - // This is sadly necessary for strto*-functions to operate on - // const char*. The function doesn't write to the memory, though, - // so it's quite safe. - - char* cstr = const_cast(s.c_str()); - if(*cstr == '\0') throw ParameterRejected("No argument given"); - - long l = strtol(cstr, &cstr, 10); - if(*cstr != '\0') throw ParameterRejected("Expected int"); - - if(l > INT_MAX || l < INT_MIN) { - throw ParameterRejected("Expected int"); - } - - return l; -} - -template<> -long PODParameter::validate(const string &s) throw(Parameter::ParameterRejected) -{ - char* cstr = const_cast(s.c_str()); - if(*cstr == '\0') throw ParameterRejected("No argument given"); - - long l = strtol(cstr, &cstr, 10); - if(*cstr != '\0') throw ParameterRejected("Expected long"); - - return l; -} - -template<> -double PODParameter::validate(const string &s) throw(Parameter::ParameterRejected) -{ - char* cstr = const_cast(s.c_str()); - if(*cstr == '\0') throw ParameterRejected("No argument given"); - - double d = strtod(cstr, &cstr); - if(*cstr != '\0') throw ParameterRejected("Expected double"); - - return d; -} - -template<> -string PODParameter::validate(const string &s) throw(Parameter::ParameterRejected) -{ - return s; -} - - -} //namespace diff --git a/dependencies/build/getoptPlusPlus/test.cc b/dependencies/build/getoptPlusPlus/test.cc deleted file mode 100644 index adb34ff8..00000000 --- a/dependencies/build/getoptPlusPlus/test.cc +++ /dev/null @@ -1,196 +0,0 @@ - /* (C) 2011 Viktor Lofgren - * - * 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 - * 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 . - */ - - - -#include "getoptpp.h" -#include -#include -#include -#include - -using namespace std; -using namespace vlofgren; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - -/* - * - * This is one way of adding new parameter types, - * inheriting existing types and adding new validation. - * - * In this case, StringParameter (which is a typedef of PODParameter gets - * a new validator that only accepts strings with only letters. - * - */ - - -class AlphabeticParameter : public StringParameter { -public: - AlphabeticParameter(char shortName, const char* longName, const char* description) : - StringParameter(shortName, longName, description) {} - virtual ~AlphabeticParameter() {} - - void receiveSwitch() throw(Parameter::ParameterRejected) { - throw Parameter::ParameterRejected(); - } - - - /* isalpha may be a macro */ - static bool isNotAlpha(char c) { return !isalpha(c); } - - virtual string validate(const string& arg) throw(Parameter::ParameterRejected) { - int nonalpha = count_if(arg.begin(), arg.end(), isNotAlpha); - - - if(nonalpha) throw Parameter::ParameterRejected("I only want numbers"); - else return arg; - } - -}; - -/* - * - * The other way is to specialize the PODParameter class - * - */ - -enum RockPaperScissor { ROCK, PAPER, SCISSOR } ; - -namespace vlofgren { - // needs to live in the vlofgren namespace for whatever reason - template<> enum RockPaperScissor - PODParameter::validate(const string &s) throw(Parameter::ParameterRejected) - { - if(s == "rock") - return ROCK; - else if(s == "paper") - return PAPER; - else if(s == "scissor") - return SCISSOR; - else { - throw ParameterRejected("Invalid argument"); - } - - } -} -typedef PODParameter RockPaperScissorParameter; - - -/* - * - * Dummy program - * - */ - - -int main(int argc, const char* argv[]) { - - // Create a parser - - OptionsParser optp("An example program (that also runs some tests)"); - ParameterSet& ps = optp.getParameters(); - - /* An alternative option is to simply extend the options parser and set all this up - * in the constructor. - */ - - ps.add('f', "foo", "Enable the foo system (no argument)"); - ps.add('b', "bar", "Enable the bar system (string argument)"); - ps.add >('z', "baz", "Enable the baz system (floating point argument"); - - PODParameter& i = ps.add >('i', "foobar", "Enable the foobar system (integer argument"); - i.setDefault(15); - - ps.add('a', "alpha", "Custom parameter that requires a string of letters"); - ps.add('r', "rps", "Takes the values rock, paper or scissor"); - ps.add('h', "help", "Display help screen"); - - - // Register the parameters with the parser - - try { - // Parse argv - optp.parse(argc, argv); - - // Test for the help flag - if(ps['h'].isSet()) { - optp.usage(); - return EXIT_SUCCESS; - } - - // Print out what values the parameters were given - - cout << "The following parameters were set:" << endl; - - cout << "foo: " << (ps['f'].isSet() ? "true" : "false") << endl; - cout << "bar: \"" << ps['b'].get() << "\""<< endl; - cout << "baz: "; - - if(ps['z'].isSet()) { - cout << ps['z'].get() << endl; - } else { - cout << "not set" << endl; - } - - /* You can also save the return value from ParserSet::add() if - * you feel the operator[].get() stuff is a bit much */ - cout << "foobar: "; - if(i.isSet()) { - cout << i.get() << endl; - } else { - cout << "not set" << endl; - } - cout << "alpha: "; - if(ps["alpha"].isSet()) { - cout << ps["alpha"].get() << endl; - } else { - cout << "not set" << endl; - } - - cout << "rps: "; - if(ps["rps"].isSet()) { - cout << ps["rps"].get() << endl; - } else { - cout << "not set" << endl; - } - - } catch(Parameter::ParameterRejected &p){ - // This will happen if the user has fed some malformed parameter to the program - cerr << p.what() << endl; - optp.usage(); - return EXIT_FAILURE; - } catch(runtime_error &e) { - // This will happen if you try to access a parameter that hasn't been set - cerr << e.what() << endl; - - return EXIT_FAILURE; - } - - - // List what non-parameter options were given (typically files) - cout << "The following file arguments were given:" << endl; - - vector files = optp.getFiles(); - for(vector::iterator i = files.begin(); i != files.end(); i++) { - cout << "\t" << *i << endl; - } - - - return EXIT_SUCCESS; -} - -#endif diff --git a/dependencies/getoptPlusPlus-master-20130810.zip b/dependencies/getoptPlusPlus-master-20130810.zip deleted file mode 100644 index fe33242948a9f8e3ac8a4d1d7fee57dbff82df8d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 33117 zcmZ^~V{k4^ur2(=$&RsO+qP}nwry+2w(Xr{$4;Kuwr$(_-h1n-Q+0owsp_fu(^Ivk zR!y(&o>7zm1OEm1Kcf~7SK$9H{{IOb00Xcvb9HcZRkU?;`9DTyXXN5)=FFg`3IPC- z`qq+H{QsSy|F3hkhrdt>3;;lf2LRyxug)S0ids_g692PDx7LO|NjtLNipH(omEfEw z{Tg93Vc@|NC#omKuqTBOe&u!2psa@q(OOb!`CGyi)FH<`)dLxqnrZ7Qot6nh5?sCJ z2640-m)m(lhu4qNmj2F;L4YF1%1xbs?sipYd~dIxN9pa()5pif*x}4!*S}bAKD9dk z;_p@V5`8`0PjBY-hKpR52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p>2p@$Z@cPekcI zq5lm1{1+4x>OVpM5dr#7B>O+YH2;M}`H_JC{eAw2Xw843|2g3HFZ71me?tGeakqbR z|EW*^i|efa-*W$@R{s. - */ - - /* - * Modifications: - * - * - Removed using namespace std from header - * - Changed Parameter container type from std::set to std::list to presume order - * - Changed arguments of Parameters to be a seperated arguments on the command line - * - Make the choice of receiving arguments or not in subclasses of CommonParameter - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef GETOPTPP_H -#define GETOPTPP_H - -namespace vlofgren { - -class Parameter; -class ParserState; - -class OptionsParser; - -/** Container for a set of parameters */ - -class ParameterSet { -public: - - /** Find a parameter by short option form */ - Parameter& operator[](char c) const; - - /** Find a parameter by long option form. */ - Parameter& operator[](const std::string &s) const; - - /** Factory method that adds a new parameter of - * type T to the set. - * - * This is just for convenience. It allows ParameterSet - * to manage the pointers, as well as (usually) making the - * code slightly easier to read. - * - * Do not try to add non-Parameter types lest you will invoke - * the wrath of gcc's template error messages. - * - * @returns The created parameter. The reference is valid - * as long as ParameterSet exists. - */ - template - T &add(char shortName, const char* longName, const char* description); - - ParameterSet() {} - ~ParameterSet(); -protected: - friend class OptionsParser; - std::list parameters; - -private: - ParameterSet(const ParameterSet& ps); -}; - -/** getopt()-style parser for command line arguments - * - * Matches each element in argv against given - * parameters, and collects non-parameter arguments - * (typically files) in a vector. - * - */ - -class OptionsParser { -public: - OptionsParser(const char *programDesc); - virtual ~OptionsParser(); - - ParameterSet& getParameters(); - - /** Parse command line arguments */ - void parse(int argc, const char* argv[]) throw(std::runtime_error); - - /** Generate a usage screen */ - void usage() const; - - /** Return the name of the program, as - * given by argv[0] - */ - const std::string& programName() const; - - /** Return a vector of each non-parameter */ - const std::vector& getFiles() const; -protected: - std::string argv0; - std::string fprogramDesc; - - ParameterSet parameters; - std::vector files; - - friend class ParserState; -}; - -/** - * Corresponds to the state of the parsing, basically just a wrapper - * for a const_iterator that handles nicer. - */ - -class ParserState { -public: - const std::string peek() const; - const std::string get() const; - void advance(); - bool end() const; -protected: - ParserState(/*OptionsParser &opts,*/ std::vector& args); -private: - friend class OptionsParser; - -// OptionsParser &opts; - const std::vector &arguments; - std::vector::const_iterator iterator; -}; - -/** - * - * Abstract base class of all parameters - * - */ - -class Parameter { -public: - - /** Generic exception thrown when a parameter is malformed - */ - class ParameterRejected : public std::runtime_error { - public: - ParameterRejected(const std::string& s) : std::runtime_error(s) {} - ParameterRejected() : runtime_error("") {} - }; - - /** Exception thrown when a parameter did not expect an argument */ - class UnexpectedArgument : public ParameterRejected { - public: - UnexpectedArgument(const std::string &s) : ParameterRejected(s) {} - UnexpectedArgument() {} - }; - - /** Exception thrown when a parameter expected an argument */ - class ExpectedArgument : public ParameterRejected { - public: - ExpectedArgument(const std::string &s) : ParameterRejected(s) {} - ExpectedArgument() {} - }; - - Parameter(char shortOption, const std::string & longOption, const std::string & description); - - virtual ~Parameter(); - - /** Test whether the parameter has been set */ - virtual bool isSet() const = 0; - - /** This parameter's line in OptionsParser::usage() */ - virtual std::string usageLine() const = 0; - - /** Description of the parameter (rightmost field in OptionsParser::usage()) */ - const std::string& description() const; - - /** The long name of this parameter (e.g. "--option"), without the dash. */ - const std::string& longOption() const; - - /** Check if this parameters has a short option */ - bool hasShortOption() const; - - /** The short name of this parameter (e.g. "-o"), without the dash. */ - char shortOption() const; - -protected: - - /** Receive a potential parameter from the parser (and determien if it's ours) - * - * The parser will pass each potential parameter through it's registered parameters' - * receive function. - * - * @throw ParameterRejected if the parameter belongs to us, but is malformed somehow. - * - * @param state Allows access to the current argument. This is a fairly powerful - * iterator that technically allows for more complex grammar than what is - * presently used. - */ - virtual int receive(ParserState& state) throw(ParameterRejected) = 0; - - friend class OptionsParser; - - char fshortOption; - const std::string flongOption; - const std::string fdescription; -private: - -}; - -/* - * - * Abstract base class of all parameters - * - */ - -class Switchable; - -/** Base class for most parameter implementations. - * - * It parses the argument in receive() and if it matches, - * calls receiveSwitch() or receiveArgument() which are implemented - * in child classes. - * - * The SwitchingBehavior mixin determines what happens if the argument - * is set multiple times. - */ - -template -class CommonParameter : public Parameter, protected SwitchingBehavior { -public: - - /** Test whether the parameter has been set */ - virtual bool isSet() const; - - CommonParameter(char shortOption, const char *longOption, - const char* description); - virtual ~CommonParameter(); - - virtual std::string usageLine() const; - -protected: - /** Parse the argument given by state, and dispatch either - * receiveSwitch() or receiveArgument() accordingly. - * - * @param state The current argument being parsed. - * @return The number of parameters taken from the input - */ - virtual int receive(ParserState& state) throw(ParameterRejected) = 0; -}; - -/** This class (used as a mixin) defines how a parameter - * behaves when switched on, specifically when switched on multiple times. - * - */ -class Switchable { -public: - class SwitchingError : public Parameter::ParameterRejected {}; - - /** Test whether the parameter has been set */ - virtual bool isSet() const; - - /** Set the parameter - * - */ - virtual void set() throw (SwitchingError) = 0; - - virtual ~Switchable(); - Switchable(); -protected: - bool fset; -}; - -/** Switching behavior that does not complain when set multiple times. */ -class MultiSwitchable : public Switchable { -public: - virtual ~MultiSwitchable(); - virtual void set() throw(SwitchingError); - -}; - -/** Switching behavior that allows switching only once. - * - * This is typically what you want if your parameter has an argument. - * - */ -class UniquelySwitchable : public Switchable { -public: - - virtual ~UniquelySwitchable(); - - /** Set the parameter - * - * @throw SwitchingError Thrown if the parameter is already set. - */ - virtual void set() throw (SwitchingError); -}; - -/** Switching behavior that makes possible allows presettable parameters, - * that is, it can either be set by the program, or by a command line argument, - * and the command-line part is UniquelySwitchable, but the program part - * is MultiSwitchable (and is set by preset()) - * - * - */ -class PresettableUniquelySwitchable : public UniquelySwitchable { -public: - - /** Test whether the parameter has been set OR preset */ - virtual bool isSet() const; - - /** Call if the parameter has been set. - * - * @throw SwitchingError thrown if the parameter is already set - * (doesn't care if it's been pre-set) - */ - virtual void set() throw (Switchable::SwitchingError); - - /** Call if the parameter has been preset */ - virtual void preset(); - - virtual ~PresettableUniquelySwitchable(); -private: - MultiSwitchable fpreset; -}; - -/* Parameter that does not take an argument, and throws an exception - * if an argument is given */ - -template -class SwitchParameter : public CommonParameter { -public: - SwitchParameter(char shortOption, const char *longOption, - const char* description); - virtual ~SwitchParameter(); - -protected: - virtual int receive(ParserState& state) throw(Parameter::ParameterRejected); -}; - -/** Plain-Old-Data parameter. Performs input validation. - * - * Currently only supports int, long and double, but extending - * it to other types (even non-POD) is as easy as partial template specialization. - * - * Specifically, you need to specialize validate(). - */ - -template -class PODParameter : public CommonParameter { -public: - PODParameter(char shortOption, const char *longOption, - const char* description); - virtual ~PODParameter(); - - /* Retreive the value of the argument. Throws an exception if - * the value hasn't been set (test with isSet()) - */ - T getValue() const; - - /** Type-casting operator, for convenience. */ - operator T() const; - - /** Set a default value for this parameter */ - virtual void setDefault(T value); - - std::string usageLine() const; -protected: - virtual int receive(ParserState& state) throw(Parameter::ParameterRejected); - - /** Validation function for the data type. - * - * @throw ParameterRejected if the argument does not conform to this data type. - * @return the value corresponding to the argument. - */ - virtual T validate(const std::string& s) throw (Parameter::ParameterRejected); - - T value; -}; - - -typedef PODParameter IntParameter; -typedef PODParameter LongParameter; -typedef PODParameter DoubleParameter; -typedef PODParameter StringParameter; - -#include "parameter.include.cc" - -} //namespace - -#endif diff --git a/dependencies/include/getoptPlusPlus/parameter.include.cc b/dependencies/include/getoptPlusPlus/parameter.include.cc deleted file mode 100644 index a1daf516..00000000 --- a/dependencies/include/getoptPlusPlus/parameter.include.cc +++ /dev/null @@ -1,177 +0,0 @@ - /* (C) 2011 Viktor Lofgren - * - * 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 - * 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 . - */ - - -#ifdef GETOPTPP_H - - -/* This file contains template voodoo, and due to the unique way GCC handles - * templates, it needs to be included as a header (and it -is-). Do not attempt to - * compile this file directly! - */ - -template -T &ParameterSet::add(char shortName, const char* longName, const char* description) { - T* p = new T(shortName, longName, description); - parameters.push_back(p); - return *p; -} - -/* - * - * Class CommonParameter implementation - * - * - */ - -template -CommonParameter::~CommonParameter() {} - -template -CommonParameter::CommonParameter(char shortOption, const char *longOption, - const char* description) : Parameter(shortOption, longOption, description) {} - -template -bool CommonParameter::isSet() const{ - return SwitchingBehavior::isSet(); -} - -template -std::string CommonParameter::usageLine() const { - std::stringstream strstr; - - if (hasShortOption()) - { - strstr << "-" << shortOption() << ", "; - } - else - { - strstr << " "; - } - strstr.width(20); - strstr << std::left << "--" + longOption(); - - return strstr.str(); -} - -/* - * - * Class SwitchParameter - * - * - */ - -template -SwitchParameter::SwitchParameter(char shortOption, const char *longOption, - const char* description) : CommonParameter(shortOption, longOption, description) {} -template -SwitchParameter::~SwitchParameter() {} - -template -int SwitchParameter::receive(ParserState& state) throw(Parameter::ParameterRejected) { - - const std::string arg = state.get(); - - if(arg.at(0) != '-') return false; - - if ((arg.at(1) == '-' && arg.substr(2) == this->longOption()) || - (this->hasShortOption() && arg.at(1) == this->shortOption() && arg.length() == 2)) - { - this->set(); - return 1; - } - - return 0; -} - -/* - * PODParameter stuff - * - */ - - -template -PODParameter::PODParameter(char shortOption, const char *longOption, - const char* description) : CommonParameter(shortOption, longOption, description) {} - -template -PODParameter::~PODParameter() {} - -template -PODParameter::operator T() const { return getValue(); } - -template -void PODParameter::setDefault(T value) { - PresettableUniquelySwitchable::preset(); - this->value = value; -} - -template -T PODParameter::getValue() const { - if(!this->isSet()) { - throw std::runtime_error( - std::string("Attempting to retreive the argument of parameter") + this->longOption() + " but it hasn't been set!"); - } - return value; - -} - -template -std::string PODParameter::usageLine() const { - std::stringstream strstr; - - if (this->hasShortOption()) - { - strstr << "-" << this->shortOption() << ", "; - } - else - { - strstr << " "; - } - strstr.width(20); - strstr << std::left << "--" + this->longOption() + " "; - - return strstr.str(); -} - -template -int PODParameter::receive(ParserState& state) throw(Parameter::ParameterRejected) { - - const std::string arg = state.get(); - - if(arg.at(0) != '-') return false; - - if((arg.at(1) == '-' && arg.substr(2) == this->longOption()) || - (this->hasShortOption() && arg.at(1) == this->shortOption() && arg.length() == 2)) - { - // retrieve the argument - std::string arg1 = state.peek(); - if (arg1.length() == 0) - { - throw Parameter::ExpectedArgument(arg + ": expected an argument"); - return 1; - } - - this->set(); - value = this->validate(arg1); - - return 2; - } - - return 0; -} - -#endif diff --git a/doc/.gitignore b/doc/.gitignore new file mode 100644 index 00000000..0149c29b --- /dev/null +++ b/doc/.gitignore @@ -0,0 +1,3 @@ +/hyperion-build-doc.sh +/hyperion.doxygen +/html/ diff --git a/include/commandline/BooleanOption.h b/include/commandline/BooleanOption.h new file mode 100644 index 00000000..72e35eee --- /dev/null +++ b/include/commandline/BooleanOption.h @@ -0,0 +1,35 @@ +#ifndef HYPERION_BOOLEANOPTION_H +#define HYPERION_BOOLEANOPTION_H + + +#include +#include "Option.h" + +namespace commandline +{ + +class BooleanOption: public Option +{ +public: + BooleanOption(const QString &name, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString() + ) + : Option(name, description, QString(), QString()) + {} + BooleanOption(const QStringList &names, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString() + ) + : Option(names, description, QString(), QString()) + {} + BooleanOption(const QCommandLineOption &other) + : Option(other) + {} +}; + +} + +#endif //HYPERION_BOOLEANOPTION_H diff --git a/include/commandline/ColorOption.h b/include/commandline/ColorOption.h new file mode 100644 index 00000000..1814143c --- /dev/null +++ b/include/commandline/ColorOption.h @@ -0,0 +1,41 @@ +#ifndef HYPERION_COLOROPTION_H +#define HYPERION_COLOROPTION_H + +#include "Option.h" +#include +#include + +namespace commandline +{ + +class ColorOption: public Option +{ +protected: + QColor _color; +public: + ColorOption(const QString &name, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString() + ) + : Option(name, description, valueName, defaultValue) + {} + ColorOption(const QStringList &names, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString() + ) + : Option(names, description, valueName, defaultValue) + {} + ColorOption(const QCommandLineOption &other) + : Option(other) + {} + + virtual bool validate(Parser & parser, QString & value) override; + QColor getColor(Parser &parser) + { return _color; } +}; + +} + +#endif //HYPERION_COLOROPTION_H diff --git a/include/commandline/ColorsOption.h b/include/commandline/ColorsOption.h new file mode 100644 index 00000000..eafe1b07 --- /dev/null +++ b/include/commandline/ColorsOption.h @@ -0,0 +1,41 @@ +#ifndef HYPERION_COLORSOPTION_H +#define HYPERION_COLORSOPTION_H + +#include "Option.h" +#include +#include + +namespace commandline +{ + +class ColorsOption: public Option +{ +protected: + QList _colors; +public: + ColorsOption(const QString &name, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString() + ) + : Option(name, description, valueName, defaultValue) + {} + ColorsOption(const QStringList &names, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString() + ) + : Option(names, description, valueName, defaultValue) + {} + ColorsOption(const QCommandLineOption &other) + : Option(other) + {} + + virtual bool validate(Parser & parser, QString & value) override; + QList &getColors(Parser &parser) + { return _colors; } +}; + +} + +#endif //HYPERION_COLOROPTION_H diff --git a/include/commandline/DoubleOption.h b/include/commandline/DoubleOption.h new file mode 100644 index 00000000..9eb3f924 --- /dev/null +++ b/include/commandline/DoubleOption.h @@ -0,0 +1,40 @@ +#ifndef HYPERION_DOUBLECOMMANDLINEOPTION_H +#define HYPERION_DOUBLECOMMANDLINEOPTION_H + +#include +#include "ValidatorOption.h" + +namespace commandline +{ + +class DoubleOption: public ValidatorOption +{ +protected: + double _double; +public: + DoubleOption(const QString &name, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString(), + double minimum = -INFINITY, double maximum = INFINITY, int decimals = 1000) + : ValidatorOption(name, description, valueName, defaultValue) + { setValidator(new QDoubleValidator(minimum, maximum, decimals)); } + DoubleOption(const QStringList &names, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString(), + double minimum = -INFINITY, double maximum = INFINITY, int decimals = 1000) + : ValidatorOption(names, description, valueName, defaultValue) + { setValidator(new QDoubleValidator(minimum, maximum, decimals)); } + DoubleOption(const QCommandLineOption &other, + double minimum = -INFINITY, double maximum = INFINITY, int decimals = 1000) + : ValidatorOption(other) + { setValidator(new QDoubleValidator(minimum, maximum, decimals)); } + + double getDouble(Parser &parser, bool *ok = 0); + double *getDoublePtr(Parser &parser, bool *ok = 0); +}; + +} + +#endif //HYPERION_DOUBLECOMMANDLINEOPTION_H diff --git a/include/commandline/ImageOption.h b/include/commandline/ImageOption.h new file mode 100644 index 00000000..535d501e --- /dev/null +++ b/include/commandline/ImageOption.h @@ -0,0 +1,41 @@ +#ifndef HYPERION_IMAGEOPTION_H +#define HYPERION_IMAGEOPTION_H + +#include "Option.h" +#include +#include + +namespace commandline +{ + +class ImageOption: public Option +{ +protected: + QImage _image; +public: + ImageOption(const QString &name, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString() + ) + : Option(name, description, valueName, defaultValue) + {} + ImageOption(const QStringList &names, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString() + ) + : Option(names, description, valueName, defaultValue) + {} + ImageOption(const QCommandLineOption &other) + : Option(other) + {} + + virtual bool validate(Parser & parser, QString & value) override; + QImage &getImage(Parser &parser) + { return _image; } +}; + +} + +#endif //HYPERION_IMAGEOPTION_H diff --git a/include/commandline/IntOption.h b/include/commandline/IntOption.h new file mode 100644 index 00000000..2f59fae3 --- /dev/null +++ b/include/commandline/IntOption.h @@ -0,0 +1,41 @@ +#ifndef HYPERION_INTCOMMANDLINEOPTION_H +#define HYPERION_INTCOMMANDLINEOPTION_H + +#include +#include +#include "ValidatorOption.h" + +namespace commandline +{ + +class IntOption: public ValidatorOption +{ +protected: + int _int; +public: + IntOption(const QString &name, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString(), + int minimum = std::numeric_limits::min(), int maximum = std::numeric_limits::max()) + : ValidatorOption(name, description, valueName, defaultValue) + { setValidator(new QIntValidator(minimum, maximum)); } + IntOption(const QStringList &names, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString(), + int minimum = std::numeric_limits::min(), int maximum = std::numeric_limits::max()) + : ValidatorOption(names, description, valueName, defaultValue) + { setValidator(new QIntValidator(minimum, maximum)); } + IntOption(const QCommandLineOption &other, + int minimum = std::numeric_limits::min(), int maximum = std::numeric_limits::max()) + : ValidatorOption(other) + { setValidator(new QIntValidator(minimum, maximum)); } + + int getInt(Parser &parser, bool *ok = 0, int base = 10); + int *getIntPtr(Parser &parser, bool *ok = 0, int base = 10); +}; + +} + +#endif //HYPERION_INTCOMMANDLINEOPTION_H diff --git a/include/commandline/Option.h b/include/commandline/Option.h new file mode 100644 index 00000000..d58bc4fe --- /dev/null +++ b/include/commandline/Option.h @@ -0,0 +1,49 @@ +#ifndef HYPERION_OPTION_H +#define HYPERION_OPTION_H + +#include +#include + +namespace commandline +{ + +class Parser; + +/* Note, this class and all it's derivatives store the validated results for caching. This means that unlike the + * regular QCommandLineOption it is _not_ idempotent! */ +class Option: public QCommandLineOption +{ +protected: + QString _error; +public: + Option(const QString &name, + const QString &description = QString(), + const QString &valueName = QString::null, + const QString &defaultValue = QString() + ) + : QCommandLineOption(name, description, valueName, defaultValue) + {} + Option(const QStringList &names, + const QString &description = QString(), + const QString &valueName = QString::null, + const QString &defaultValue = QString() + ) + : QCommandLineOption(names, description, valueName, defaultValue) + {} + Option(const QCommandLineOption &other) + : QCommandLineOption(other) + {} + + virtual bool validate(Parser &parser, QString &value); + QString name() + { return this->names().last();} + QString getError() + { return this->_error; } + QString value(Parser &parser); + std::string getStdString(Parser &parser); + std::wstring getStdWString(Parser &parser); +}; + +} + +#endif //HYPERION_OPTION_H diff --git a/include/commandline/Parser.h b/include/commandline/Parser.h new file mode 100644 index 00000000..a9876e87 --- /dev/null +++ b/include/commandline/Parser.h @@ -0,0 +1,120 @@ +#ifndef HYPERION_COMMANDLINEPARSER_H +#define HYPERION_COMMANDLINEPARSER_H + +#include +#include +#include "ColorOption.h" +#include "ColorsOption.h" +#include "DoubleOption.h" +#include "ImageOption.h" +#include "IntOption.h" +#include "Option.h" +#include "RegularExpressionOption.h" +#include "SwitchOption.h" +#include "ValidatorOption.h" +#include "BooleanOption.h" + +namespace commandline +{ + +class Parser : public QObject +{ +protected: + QHash _options; + QString _errorText; + /* No public inheritance because we need to modify a few methods */ + QCommandLineParser _parser; + + QStringList _getNames(const char shortOption, const QString longOption); + QString _getDescription(const QString description, const QString default_=QString()); + +public: + bool parse(const QStringList &arguments); + void process(const QStringList &arguments); + void process(const QCoreApplication &app); + QString errorText() const; + + template + OptionT &add( + const char shortOption, + const QString longOption, + const QString description, + const QString default_, + Args ... args) + { + OptionT * option = new OptionT( + _getNames(shortOption, longOption), + _getDescription(description, default_), + longOption, + default_, + args...); + addOption(option); + return *option; + } + + /* gcc does not support default arguments for variadic templates which + * makes this method necessary */ + template + OptionT &add( + const char shortOption, + const QString longOption, + const QString description, + const QString default_ = QString()) + { + OptionT * option = new OptionT( + _getNames(shortOption, longOption), + _getDescription(description, default_), + longOption, + default_); + addOption(option); + return *option; + } + + Parser(QString description=QString()) + {if(description.size())setApplicationDescription(description);}; + QCommandLineOption addHelpOption() + { return _parser.addHelpOption(); } + bool addOption(Option &option); + bool addOption(Option *option); + void addPositionalArgument(const QString &name, const QString &description, const QString &syntax = QString()) + { _parser.addPositionalArgument(name, description, syntax); } + QCommandLineOption addVersionOption() + { return _parser.addVersionOption(); } + QString applicationDescription() const + { return _parser.applicationDescription(); } + void clearPositionalArguments() + { _parser.clearPositionalArguments(); } + QString helpText() const + { return _parser.helpText(); } + bool isSet(const QString &name) const + { return _parser.isSet(name); } + bool isSet(const Option &option) const + { return _parser.isSet(option); } + bool isSet(const Option *option) const + { return _parser.isSet(*option); } + QStringList optionNames() const + { return _parser.optionNames(); } + QStringList positionalArguments() const + { return _parser.positionalArguments(); } + void setApplicationDescription(const QString &description) + { _parser.setApplicationDescription(description); } + void setSingleDashWordOptionMode(QCommandLineParser::SingleDashWordOptionMode singleDashWordOptionMode) + { _parser.setSingleDashWordOptionMode(singleDashWordOptionMode); } + void showHelp(int exitCode = 0) + { _parser.showHelp(exitCode); } + QStringList unknownOptionNames() const + { return _parser.unknownOptionNames(); } + QString value(const QString &optionName) const + { return _parser.value(optionName); } + QString value(const Option &option) const + { return _parser.value(option); } + QStringList values(const QString &optionName) const + { return _parser.values(optionName); } + QStringList values(const Option &option) const + { return _parser.values(option); } + +}; + +} + +#endif //HYPERION_COMMANDLINEPARSER_H diff --git a/include/commandline/RegularExpressionOption.h b/include/commandline/RegularExpressionOption.h new file mode 100644 index 00000000..36094754 --- /dev/null +++ b/include/commandline/RegularExpressionOption.h @@ -0,0 +1,71 @@ +#ifndef HYPERION_REGULAREXPRESSIONCOMMANDLINEOPTION_H +#define HYPERION_REGULAREXPRESSIONCOMMANDLINEOPTION_H + +#include +#include +#include "ValidatorOption.h" + +namespace commandline +{ + +class RegularExpressionOption: public ValidatorOption +{ +public: + RegularExpressionOption(const QString &name, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString()) + : ValidatorOption(name, description, valueName, defaultValue) + {} + RegularExpressionOption(const QStringList &names, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString()) + : ValidatorOption(names, description, valueName, defaultValue) + {} + RegularExpressionOption(const QCommandLineOption &other) + : ValidatorOption(other) + {} + + RegularExpressionOption(const QString &name, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString(), + const QRegularExpression &expression = QRegularExpression()) + : ValidatorOption(name, description, valueName, defaultValue) + { setValidator(new QRegularExpressionValidator(expression)); } + RegularExpressionOption(const QStringList &names, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString(), + const QRegularExpression &expression = QRegularExpression()) + : ValidatorOption(names, description, valueName, defaultValue) + { setValidator(new QRegularExpressionValidator(expression)); } + RegularExpressionOption(const QCommandLineOption &other, + const QRegularExpression &expression = QRegularExpression()) + : ValidatorOption(other) + { setValidator(new QRegularExpressionValidator(expression)); } + + RegularExpressionOption(const QString &name, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString(), + const QString &expression = QString()) + : ValidatorOption(name, description, valueName, defaultValue) + { setValidator(new QRegularExpressionValidator(QRegularExpression(expression))); } + RegularExpressionOption(const QStringList &names, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString(), + const QString &expression = QString()) + : ValidatorOption(names, description, valueName, defaultValue) + { setValidator(new QRegularExpressionValidator(QRegularExpression(expression))); } + RegularExpressionOption(const QCommandLineOption &other, + const QString &expression = QString()) + : ValidatorOption(other) + { setValidator(new QRegularExpressionValidator(QRegularExpression(expression))); } +}; + +} + +#endif //HYPERION_REGULAREXPRESSIONCOMMANDLINEOPTION_H diff --git a/include/commandline/SwitchOption.h b/include/commandline/SwitchOption.h new file mode 100644 index 00000000..06763661 --- /dev/null +++ b/include/commandline/SwitchOption.h @@ -0,0 +1,45 @@ +#ifndef HYPERION_SWITCHCOMMANDLINEOPTION_H +#define HYPERION_SWITCHCOMMANDLINEOPTION_H + +#include +#include "Option.h" + +namespace commandline +{ + +template +class SwitchOption: public Option +{ +protected: + QMap _switches; +public: + SwitchOption(const QString &name, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString(), + const QMap &switches=QMap()) + : Option(name, description, valueName, defaultValue), _switches(switches) + {} + SwitchOption(const QStringList &names, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString(), + const QMap &switches=QMap()) + : Option(names, description, valueName, defaultValue), _switches(switches) + {} + SwitchOption(const QCommandLineOption &other, const QMap &switches) + : Option(other), _switches(switches) + {} + + const QMap &getSwitches() const{return _switches;}; + virtual bool validate(Parser &parser, QString &switch_) override{return hasSwitch(switch_);} + bool hasSwitch(const QString &switch_){return _switches.contains(switch_.toLower());} + void setSwitches(const QMap &_switches){this->_switches = _switches;} + void addSwitch(const QString &switch_, T value=T()){_switches[switch_.toLower()] = value;} + void removeSwitch(const QString &switch_){_switches.remove(switch_.toLower());} + T & switchValue(Parser & parser){return _switches[value(parser).toLower()];} +}; + +} + +#endif //HYPERION_SWITCHCOMMANDLINEOPTION_H diff --git a/include/commandline/ValidatorOption.h b/include/commandline/ValidatorOption.h new file mode 100644 index 00000000..c7349ccf --- /dev/null +++ b/include/commandline/ValidatorOption.h @@ -0,0 +1,42 @@ +#ifndef HYPERION_COMMANDLINEOPTION_H +#define HYPERION_COMMANDLINEOPTION_H + +#include +#include +#include + +namespace commandline +{ + +class ValidatorOption: public Option +{ +protected: + const QValidator *validator; + virtual void setValidator(const QValidator *validator); +public: + ValidatorOption(const QString &name, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString(), + const QValidator *validator = nullptr) + : Option(name, description, valueName, defaultValue), validator(validator) + {} + ValidatorOption(const QStringList &names, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString(), + const QValidator *validator = nullptr) + : Option(names, description, valueName, defaultValue), validator(validator) + {} + ValidatorOption(const QCommandLineOption &other, + const QValidator *validator = nullptr) + : Option(other), validator(validator) + {} + + virtual const QValidator *getValidator() const; + virtual bool validate(Parser & parser, QString &value) override; +}; + +} + +#endif //HYPERION_COMMANDLINEOPTION_H diff --git a/include/protoserver/ProtoConnectionWrapper.h b/include/protoserver/ProtoConnectionWrapper.h index 2f423291..1f4e1bb5 100644 --- a/include/protoserver/ProtoConnectionWrapper.h +++ b/include/protoserver/ProtoConnectionWrapper.h @@ -16,7 +16,7 @@ class ProtoConnectionWrapper : public QObject Q_OBJECT public: - ProtoConnectionWrapper(const std::string & address, int priority, int duration_ms, bool skipProtoReply); + ProtoConnectionWrapper(const QString &address, int priority, int duration_ms, bool skipProtoReply); virtual ~ProtoConnectionWrapper(); signals: diff --git a/libsrc/CMakeLists.txt b/libsrc/CMakeLists.txt index a40681f6..f6b0d9a7 100644 --- a/libsrc/CMakeLists.txt +++ b/libsrc/CMakeLists.txt @@ -4,6 +4,7 @@ SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include) SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc) add_subdirectory(hyperion) +add_subdirectory(commandline) add_subdirectory(blackborder) add_subdirectory(jsonserver) add_subdirectory(protoserver) diff --git a/libsrc/commandline/BooleanOption.cpp b/libsrc/commandline/BooleanOption.cpp new file mode 100644 index 00000000..d92c5192 --- /dev/null +++ b/libsrc/commandline/BooleanOption.cpp @@ -0,0 +1,3 @@ +#include "commandline/BooleanOption.h" + +using namespace commandline; diff --git a/libsrc/commandline/CMakeLists.txt b/libsrc/commandline/CMakeLists.txt new file mode 100644 index 00000000..51fa4161 --- /dev/null +++ b/libsrc/commandline/CMakeLists.txt @@ -0,0 +1,42 @@ +# Define the current source locations +set(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/commandline) +set(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/commandline) + +set(Parser_HEADERS + ${CURRENT_HEADER_DIR}/ColorOption.h + ${CURRENT_HEADER_DIR}/ColorsOption.h + ${CURRENT_HEADER_DIR}/DoubleOption.h + ${CURRENT_HEADER_DIR}/ImageOption.h + ${CURRENT_HEADER_DIR}/IntOption.h + ${CURRENT_HEADER_DIR}/Option.h + ${CURRENT_HEADER_DIR}/Parser.h + ${CURRENT_HEADER_DIR}/RegularExpressionOption.h + ${CURRENT_HEADER_DIR}/SwitchOption.h + ${CURRENT_HEADER_DIR}/ValidatorOption.h + ${CURRENT_HEADER_DIR}/BooleanOption.h +) + +set(Parser_SOURCES + ${CURRENT_SOURCE_DIR}/ColorOption.cpp + ${CURRENT_SOURCE_DIR}/ColorsOption.cpp + ${CURRENT_SOURCE_DIR}/DoubleOption.cpp + ${CURRENT_SOURCE_DIR}/ImageOption.cpp + ${CURRENT_SOURCE_DIR}/IntOption.cpp + ${CURRENT_SOURCE_DIR}/Option.cpp + ${CURRENT_SOURCE_DIR}/Parser.cpp + ${CURRENT_SOURCE_DIR}/RegularExpressionOption.cpp + ${CURRENT_SOURCE_DIR}/SwitchOption.cpp + ${CURRENT_SOURCE_DIR}/ValidatorOption.cpp + ${CURRENT_SOURCE_DIR}/BooleanOption.cpp +) + +add_library(commandline + ${Parser_HEADERS} + ${Parser_SOURCES} +) + +qt5_use_modules(commandline Gui) + +target_link_libraries(commandline + hyperion +) diff --git a/libsrc/commandline/ColorOption.cpp b/libsrc/commandline/ColorOption.cpp new file mode 100644 index 00000000..32863fad --- /dev/null +++ b/libsrc/commandline/ColorOption.cpp @@ -0,0 +1,30 @@ +#include +#include "commandline/ColorOption.h" +#include "commandline/Parser.h" + +using namespace commandline; + +bool ColorOption::validate(Parser & parser, QString & value) +{ + // Check if we can create the color by name + _color = QColor(value); + if (_color.isValid()) { + return true; + } + + // check if we can create the color by hex RRGGBB getColors + _color = QColor(QString("#%1").arg(value)); + if (_color.isValid()) { + return true; + } + + if(!parser.isSet(*this)){ + // Return true if no value is available + return true; + } + + QStringList error; + _error = QString("Invalid color. A color is specified by a six lettered RRGGBB hex getColors or one of the following names:\n\t- %1").arg(QColor::colorNames().join("\n\t- ")); + + return false; +} diff --git a/libsrc/commandline/ColorsOption.cpp b/libsrc/commandline/ColorsOption.cpp new file mode 100644 index 00000000..b7f81bd7 --- /dev/null +++ b/libsrc/commandline/ColorsOption.cpp @@ -0,0 +1,37 @@ +#include +#include "commandline/ColorsOption.h" +#include "commandline/Parser.h" + +using namespace commandline; + +bool ColorsOption::validate(Parser & parser, QString & value) +{ + // Clear any old results + _colors.clear(); + + // Check if we can create the color by name + QColor color(value); + if (color.isValid()) { + _colors.push_back(color); + return true; + } + + // check if we can create the color by hex RRGGBB getColors + QRegularExpression hexRe("^([0-9A-F]{6})+$", QRegularExpression::CaseInsensitiveOption); + QRegularExpressionMatch match = hexRe.match(value); + if(match.hasMatch()) { + Q_FOREACH(const QString m, match.capturedTexts()){ + _colors.push_back(QColor(QString("#%1").arg(m))); + } + return true; + } + + if(!parser.isSet(*this)){ + // Return true if no value is available + return true; + } + + _error = QString("Invalid color. A color is specified by a six lettered RRGGBB hex getColors or one of the following names:\n\t- %1").arg(QColor::colorNames().join("\n\t- ")); + + return false; +} diff --git a/libsrc/commandline/DoubleOption.cpp b/libsrc/commandline/DoubleOption.cpp new file mode 100644 index 00000000..532df096 --- /dev/null +++ b/libsrc/commandline/DoubleOption.cpp @@ -0,0 +1,20 @@ +#include "commandline/DoubleOption.h" +#include "commandline/Parser.h" + +using namespace commandline; + +double DoubleOption::getDouble(Parser &parser, bool *ok) +{ + _double = value(parser).toDouble(ok); + return _double; +} + +double *DoubleOption::getDoublePtr(Parser &parser, bool *ok) +{ + if (parser.isSet(this)) { + getDouble(parser, ok); + return &_double; + } else { + return nullptr; + } +} diff --git a/libsrc/commandline/ImageOption.cpp b/libsrc/commandline/ImageOption.cpp new file mode 100644 index 00000000..77933176 --- /dev/null +++ b/libsrc/commandline/ImageOption.cpp @@ -0,0 +1,18 @@ +#include "commandline/ImageOption.h" + +using namespace commandline; + +bool ImageOption::validate(Parser & parser, QString & value) +{ + if(value.size()){ + _image = QImage(value); + + if (_image.isNull()) + { + _error = QString("File %1 could not be opened as image").arg(value); + return false; + } + } + + return true; +} diff --git a/libsrc/commandline/IntOption.cpp b/libsrc/commandline/IntOption.cpp new file mode 100644 index 00000000..e034fb0c --- /dev/null +++ b/libsrc/commandline/IntOption.cpp @@ -0,0 +1,20 @@ +#include "commandline/IntOption.h" +#include "commandline/Parser.h" + +using namespace commandline; + +int IntOption::getInt(Parser &parser, bool *ok, int base) +{ + _int = value(parser).toInt(ok, base); + return _int; +} + +int *IntOption::getIntPtr(Parser &parser, bool *ok, int base) +{ + if (parser.isSet(this)) { + getInt(parser, ok, base); + return &_int; + } else { + return nullptr; + } +} diff --git a/libsrc/commandline/Option.cpp b/libsrc/commandline/Option.cpp new file mode 100644 index 00000000..d8e733e8 --- /dev/null +++ b/libsrc/commandline/Option.cpp @@ -0,0 +1,26 @@ +#include "commandline/Option.h" +#include "commandline/Parser.h" + +using namespace commandline; + +bool Option::validate(Parser & parser, QString &value) +{ + /* By default everything is accepted */ + return true; +} + +QString Option::value(Parser &parser) +{ + return parser.value(*this); +} + +std::string Option::getStdString(Parser &parser) +{ + return value(parser).toStdString(); +} + +std::wstring Option::getStdWString(Parser &parser) +{ + return value(parser).toStdWString(); +} + diff --git a/libsrc/commandline/Parser.cpp b/libsrc/commandline/Parser.cpp new file mode 100644 index 00000000..c09c3449 --- /dev/null +++ b/libsrc/commandline/Parser.cpp @@ -0,0 +1,90 @@ +#include +#include +#include "commandline/Parser.h" + +using namespace commandline; + +bool Parser::parse(const QStringList &arguments) +{ + if (!_parser.parse(arguments)) { + return false; + } + + Q_FOREACH(Option * option, _options) { + QString value = this->value(*option); + if (!option->validate(*this, value)) { + const QString error = option->getError(); + if (error.size()) { + _errorText = tr("%1 is not a valid option for %2\n%3").arg(value, option->name(), error); + } + else { + _errorText = tr("%1 is not a valid option for %2").arg(value, option->name()); + } + return false; + } + } + return true; +} + +void Parser::process(const QStringList &arguments) +{ + _parser.process(arguments); + if (!parse(arguments)) { + + fprintf(stdout, "%s", qPrintable(tr("Error: %1").arg(_errorText))); + showHelp(EXIT_FAILURE); + } +} + +void Parser::process(const QCoreApplication &app) +{ + Q_UNUSED(app); + process(QCoreApplication::arguments()); +} + +QString Parser::errorText() const +{ + if (_errorText.size()) { + return _errorText; + } + else { + return _parser.errorText(); + } +} + +bool Parser::addOption(Option &option) +{ + return addOption(&option); +} + +bool Parser::addOption(Option * const option) +{ + _options[option->name()] = option; + return _parser.addOption(*option); +} +QStringList Parser::_getNames(const char shortOption, const QString longOption) +{ + QStringList names; + if (shortOption != 0x0) { + names << QString(shortOption); + } + if (longOption.size()) { + names << longOption; + } + return names; +} +QString Parser::_getDescription(const QString description, const QString default_) +{ + /* Add the translations if available */ + QString formattedDescription(tr(qPrintable(description))); + + /* Fill in the default if needed */ + if (default_.size()) { + if(!formattedDescription.contains("%1")){ + formattedDescription += " [default: %1]"; + } + formattedDescription = formattedDescription.arg(default_); + } + return formattedDescription; +} + diff --git a/libsrc/commandline/RegularExpressionOption.cpp b/libsrc/commandline/RegularExpressionOption.cpp new file mode 100644 index 00000000..7b16f264 --- /dev/null +++ b/libsrc/commandline/RegularExpressionOption.cpp @@ -0,0 +1,4 @@ +#include "commandline/RegularExpressionOption.h" + +using namespace commandline; + diff --git a/libsrc/commandline/SwitchOption.cpp b/libsrc/commandline/SwitchOption.cpp new file mode 100644 index 00000000..05d5bc1c --- /dev/null +++ b/libsrc/commandline/SwitchOption.cpp @@ -0,0 +1,5 @@ +#include "commandline/SwitchOption.h" + +using namespace commandline; + + diff --git a/libsrc/commandline/ValidatorOption.cpp b/libsrc/commandline/ValidatorOption.cpp new file mode 100644 index 00000000..9dfc9fca --- /dev/null +++ b/libsrc/commandline/ValidatorOption.cpp @@ -0,0 +1,25 @@ +#include "commandline/ValidatorOption.h" +#include "commandline/Parser.h" + +using namespace commandline; + +bool ValidatorOption::validate(Parser & parser, QString & value) +{ + if (parser.isSet(*this) || !defaultValues().empty()) { + int pos = 0; + validator->fixup(value); + return validator->validate(value, pos) == QValidator::Acceptable; + } else { + return true; + } +} + +const QValidator *ValidatorOption::getValidator() const +{ + return validator; +} +void ValidatorOption::setValidator(const QValidator *validator) +{ + ValidatorOption::validator = validator; +} + diff --git a/libsrc/protoserver/ProtoConnectionWrapper.cpp b/libsrc/protoserver/ProtoConnectionWrapper.cpp index e236e223..bc38e735 100644 --- a/libsrc/protoserver/ProtoConnectionWrapper.cpp +++ b/libsrc/protoserver/ProtoConnectionWrapper.cpp @@ -1,10 +1,13 @@ // protoserver includes #include "protoserver/ProtoConnectionWrapper.h" -ProtoConnectionWrapper::ProtoConnectionWrapper(const std::string & address, int priority, int duration_ms, bool skipProtoReply) +ProtoConnectionWrapper::ProtoConnectionWrapper(const QString &address, + int priority, + int duration_ms, + bool skipProtoReply) : _priority(priority) , _duration_ms(duration_ms) - , _connection(address) + , _connection(address.toStdString()) { _connection.setSkipReply(skipProtoReply); connect(&_connection, SIGNAL(setGrabbingMode(GrabbingMode)), this, SIGNAL(setGrabbingMode(GrabbingMode))); diff --git a/src/hyperion-aml/CMakeLists.txt b/src/hyperion-aml/CMakeLists.txt index 3493d3f3..0ee29a3d 100644 --- a/src/hyperion-aml/CMakeLists.txt +++ b/src/hyperion-aml/CMakeLists.txt @@ -30,7 +30,7 @@ add_executable(${PROJECT_NAME} ) target_link_libraries(${PROJECT_NAME} - getoptPlusPlus + commandline blackborder hyperion-utils protoserver diff --git a/src/hyperion-aml/hyperion-aml.cpp b/src/hyperion-aml/hyperion-aml.cpp index 191b871e..cc91a63e 100644 --- a/src/hyperion-aml/hyperion-aml.cpp +++ b/src/hyperion-aml/hyperion-aml.cpp @@ -4,20 +4,16 @@ #include #include -// getoptPlusPLus includes -#include - #include #include "AmlogicWrapper.h" #include "HyperionConfig.h" -#include +#include - -using namespace vlofgren; +using namespace commandline; // save the image as screenshot -void saveScreenshot(const char * filename, const Image & image) +void saveScreenshot(QString filename, const Image & image) { // store as PNG QImage pngImage((const uint8_t *) image.memptr(), image.width(), image.height(), 3*image.width(), QImage::Format_RGB888); @@ -35,50 +31,30 @@ int main(int argc, char ** argv) try { - // create the option parser and initialize all parameters - OptionsParser optionParser("AmLogic capture application for Hyperion"); - ParameterSet & parameters = optionParser.getParameters(); + // create the option parser and initialize all parser + Parser parser("AmLogic capture application for Hyperion"); - IntParameter & argFps = parameters.add ('f', "framerate", "Capture frame rate [default: 10]"); - IntParameter & argWidth = parameters.add (0x0, "width", "Width of the captured image [default: 128]"); - IntParameter & argHeight = parameters.add (0x0, "height", "Height of the captured image [default: 128]"); - SwitchParameter<> & argScreenshot = parameters.add> (0x0, "screenshot", "Take a single screenshot, save it to file and quit"); - StringParameter & argAddress = parameters.add ('a', "address", "Set the address of the hyperion server [default: 127.0.0.1:19445]"); - IntParameter & argPriority = parameters.add ('p', "priority", "Use the provided priority channel (the lower the number, the higher the priority) [default: 800]"); - SwitchParameter<> & argSkipReply = parameters.add> (0x0, "skip-reply", "Do not receive and check reply messages from Hyperion"); - SwitchParameter<> & argHelp = parameters.add> ('h', "help", "Show this help message and exit"); - - // set defaults - argFps.setDefault(10); - argWidth.setDefault(160); - argHeight.setDefault(160); - argAddress.setDefault("127.0.0.1:19445"); - argPriority.setDefault(800); + IntOption & argFps = parser.add ('f', "framerate", "Capture frame rate [default: %1]", "10"); + IntOption & argWidth = parser.add (0x0, "width", "Width of the captured image [default: %1]", "160", 160, 4096); + IntOption & argHeight = parser.add (0x0, "height", "Height of the captured image [default: %1]", "160", 160, 4096); + BooleanOption & argScreenshot = parser.add (0x0, "screenshot", "Take a single screenshot, save it to file and quit"); + Option & argAddress = parser.add
    @@ -38,8 +40,35 @@ udpListener = JSON.parse(response.data).result.properties.udpListener; webConfig = JSON.parse(response.data).result.properties.webConfig; + var element = document.getElementById('editor_holder'); + //JSONEditor.defaults.options.theme = 'bootstrap3'; + var editor = new JSONEditor(element,{ + theme: 'bootstrap3', + disable_collapse: 'true', + form_name_root: 'sa', + disable_edit_json: 'true', + disable_properties: 'true', + no_additional_properties: 'true', + schema: { + title:' ', + properties: { + logger, + jsonServer, + protoServer, + boblightServer, + udpListener, + webConfig + } + } + }); - $('form').jsonForm({ + document.getElementById('submit').addEventListener('click',function() { + // Get the value from the editor + console.log(editor.getValue()); + }); + + + /*$('form').jsonForm({ schema: { logger, jsonServer, @@ -57,7 +86,7 @@ console.log(values); } } - }); + });*/ diff --git a/assets/webconfig/index.html b/assets/webconfig/index.html index 6274caa6..65fbe1a8 100644 --- a/assets/webconfig/index.html +++ b/assets/webconfig/index.html @@ -28,6 +28,9 @@ + + + @@ -451,7 +454,7 @@ $("#load_effects").on("click", function() { $("#page-wrapper").load("effects.html"); }); - + $("#load_components").on("click", function() { $("#page-wrapper").load("remote_components.html"); }); @@ -484,7 +487,7 @@ var cleanCurrentVersion; var latestVersion; var cleanLatestVersion; - + webSocket = new WebSocket('ws://'+document.location.hostname+':19444'); var serverInfo; @@ -501,12 +504,12 @@ responseJSON = JSON.parse(response.data ); currentVersion = responseJSON.info.hyperion[0].version; cleanCurrentVersion = currentVersion.replace(/\./g, ''); - + $.get( "https://raw.githubusercontent.com/hyperion-project/hyperion.ng/master/version.json", function( data ) { var responseJSON = JSON.parse(data); latestVersion = responseJSON[0].versionnr; cleanLatestVersion = latestVersion.replace(/\./g, ''); - + $('#currentversion').append(' V'+currentVersion); $('#latestversion').append(' V'+latestVersion); @@ -517,9 +520,9 @@ $('#versioninforesult').append('
    You run the latest version of Hyperion.
    '); } }); - + }; - + }); $(function(){ var sidebar = $('#side-menu'); // cache sidebar to a variable for performance diff --git a/assets/webconfig/js/lib/jsoneditor.min.js b/assets/webconfig/js/lib/jsoneditor.min.js new file mode 100644 index 00000000..e396783b --- /dev/null +++ b/assets/webconfig/js/lib/jsoneditor.min.js @@ -0,0 +1,859 @@ +/*! JSON Editor v0.7.28 - JSON Schema -> HTML Editor + * By Jeremy Dorn - https://github.com/jdorn/json-editor/ + * Released under the MIT license + * + * Date: 2016-08-07 + */ +/** + * See README.md for requirements and usage info + */ +!function(){/*jshint loopfunc: true */ +/* Simple JavaScript Inheritance + * By John Resig http://ejohn.org/ + * MIT Licensed. + */ +// Inspired by base2 and Prototype +var a;!function(){var b=!1,c=/xyz/.test(function(){window.postMessage("xyz")})?/\b_super\b/:/.*/; +// The base Class implementation (does nothing) +// Create a new Class that inherits from this class +return a=function(){},a.extend=function d(a){ +// The dummy class constructor +function e(){ +// All construction is actually done in the init method +!b&&this.init&&this.init.apply(this,arguments)}var f=this.prototype; +// Instantiate a base class (but only create the instance, +// don't run the init constructor) +b=!0;var g=new this;b=!1; +// Copy the properties over onto the new prototype +for(var h in a) +// Check if we're overwriting an existing function +g[h]="function"==typeof a[h]&&"function"==typeof f[h]&&c.test(a[h])?function(a,b){return function(){var c=this._super; +// Add a new ._super() method that is the same method +// but on the super-class +this._super=f[a]; +// The method only need to be bound temporarily, so we +// remove it when we're done executing +var d=b.apply(this,arguments);return this._super=c,d}}(h,a[h]):a[h]; +// Populate our constructed prototype object +// Enforce the constructor to be what we expect +// And make this class extendable +return e.prototype=g,e.prototype.constructor=e,e.extend=d,e},a}(), +// CustomEvent constructor polyfill +// From MDN +function(){function a(a,b){b=b||{bubbles:!1,cancelable:!1,detail:void 0};var c=document.createEvent("CustomEvent");return c.initCustomEvent(a,b.bubbles,b.cancelable,b.detail),c}a.prototype=window.Event.prototype,window.CustomEvent=a}(), +// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel +// MIT license +function(){for(var a=0,b=["ms","moz","webkit","o"],c=0;c0&&a.length-1 in a){for(c=0;c=g&&!h&&(h=!0,b())})}},d.send()}}),g||b()},expandRefs:function(a){for(a=c({},a);a.$ref;){var b=a.$ref;delete a.$ref,this.refs[b]||(b=decodeURIComponent(b)),a=this.extendSchemas(a,this.refs[b])}return a},expandSchema:function(a){var b,e=this,f=c({},a); +// allOf schemas should be merged into the parent +if( +// Version 3 `type` +"object"==typeof a.type&&( +// Array of types +Array.isArray(a.type)?d(a.type,function(b,c){ +// Schema +"object"==typeof c&&(a.type[b]=e.expandSchema(c))}):a.type=e.expandSchema(a.type)), +// Version 3 `disallow` +"object"==typeof a.disallow&&( +// Array of types +Array.isArray(a.disallow)?d(a.disallow,function(b,c){ +// Schema +"object"==typeof c&&(a.disallow[b]=e.expandSchema(c))}):a.disallow=e.expandSchema(a.disallow)), +// Version 4 `anyOf` +a.anyOf&&d(a.anyOf,function(b,c){a.anyOf[b]=e.expandSchema(c)}), +// Version 4 `dependencies` (schema dependencies) +a.dependencies&&d(a.dependencies,function(b,c){"object"!=typeof c||Array.isArray(c)||(a.dependencies[b]=e.expandSchema(c))}), +// Version 4 `not` +a.not&&(a.not=this.expandSchema(a.not)),a.allOf){for(b=0;ba.minimum:b>=a.minimum, +// Use math.js is available +window.math?g=window.math[a.exclusiveMinimum?"larger":"largerEq"](window.math.bignumber(b),window.math.bignumber(a.minimum)):window.Decimal&&(g=new window.Decimal(b)[a.exclusiveMinimum?"gt":"gte"](new window.Decimal(a.minimum))),g||k.push({path:e,property:"minimum",message:this.translate(a.exclusiveMinimum?"error_minimum_excl":"error_minimum_incl",[a.minimum])}))}else if("string"==typeof b) +// `maxLength` +a.maxLength&&(b+"").length>a.maxLength&&k.push({path:e,property:"maxLength",message:this.translate("error_maxLength",[a.maxLength])}), +// `minLength` +a.minLength&&(b+"").lengtha.maxItems&&k.push({path:e,property:"maxItems",message:this.translate("error_maxItems",[a.maxItems])}), +// `minItems` +a.minItems&&b.lengtha.maxProperties&&k.push({path:e,property:"maxProperties",message:this.translate("error_maxProperties",[a.maxProperties])})} +// `minProperties` +if(a.minProperties){g=0;for(h in b)b.hasOwnProperty(h)&&g++;g=0){b=this.theme.getBlockLinkHolder(),c=this.theme.getBlockLink(),c.setAttribute("target","_blank");var i=document.createElement(e);i.setAttribute("controls","controls"),this.theme.createMediaLink(b,c,i), +// When a watched field changes, update the url +this.link_watchers.push(function(b){var d=f(b);c.setAttribute("href",d),c.textContent=a.rel||d,i.setAttribute("src",d)})}else c=b=this.theme.getBlockLink(),b.setAttribute("target","_blank"),b.textContent=a.rel, +// When a watched field changes, update the url +this.link_watchers.push(function(c){var d=f(c);b.setAttribute("href",d),b.textContent=a.rel||d});return g&&c&&(g===!0?c.setAttribute("download",""):this.link_watchers.push(function(a){c.setAttribute("download",g(a))})),a["class"]&&(c.className=c.className+" "+a["class"]),b},refreshWatchedFieldValues:function(){if(this.watched_values){var a={},b=!1,c=this;if(this.watched){var d,e;for(var f in this.watched)this.watched.hasOwnProperty(f)&&(e=c.jsoneditor.getEditor(this.watched[f]),d=e?e.getValue():null,c.watched_values[f]!==d&&(b=!0),a[f]=d)}return a.self=this.getValue(),this.watched_values.self!==a.self&&(b=!0),this.watched_values=a,b}},getWatchedFieldValues:function(){return this.watched_values},updateHeaderText:function(){if(this.header) +// If the header has children, only update the text node's value +if(this.header.children.length){for(var a=0;a-1:!!this.jsoneditor.options.required_by_default},getDisplayText:function(a){var b=[],c={}; +// Determine how many times each attribute name is used. +// This helps us pick the most distinct display text for the schemas. +d(a,function(a,b){b.title&&(c[b.title]=c[b.title]||0,c[b.title]++),b.description&&(c[b.description]=c[b.description]||0,c[b.description]++),b.format&&(c[b.format]=c[b.format]||0,c[b.format]++),b.type&&(c[b.type]=c[b.type]||0,c[b.type]++)}), +// Determine display text for each element of the array +d(a,function(a,d){var e; +// If it's a simple string +e="string"==typeof d?d:d.title&&c[d.title]<=1?d.title:d.format&&c[d.format]<=1?d.format:d.type&&c[d.type]<=1?d.type:d.description&&c[d.description]<=1?d.descripton:d.title?d.title:d.format?d.format:d.type?d.type:d.description?d.description:JSON.stringify(d).length<50?JSON.stringify(d):"type",b.push(e)}); +// Replace identical display text with "text 1", "text 2", etc. +var e={};return d(b,function(a,d){e[d]=e[d]||0,e[d]++,c[d]>1&&(b[a]=d+" "+e[d])}),b},getOption:function(a){try{throw"getOption is deprecated"}catch(b){window.console.error(b)}return this.options[a]},showValidationErrors:function(a){}}),f.defaults.editors["null"]=f.AbstractEditor.extend({getValue:function(){return null},setValue:function(){this.onChange()},getNumColumns:function(){return 2}}),f.defaults.editors.string=f.AbstractEditor.extend({register:function(){this._super(),this.input&&this.input.setAttribute("name",this.formname)},unregister:function(){this._super(),this.input&&this.input.removeAttribute("name")},setValue:function(a,b,c){if((!this.template||c)&&(null===a||"undefined"==typeof a?a="":"object"==typeof a?a=JSON.stringify(a):"string"!=typeof a&&(a=""+a),a!==this.serialized)){ +// Sanitize value before setting it +var d=this.sanitize(a);if(this.input.value!==d){this.input.value=d, +// If using SCEditor, update the WYSIWYG +this.sceditor_instance?this.sceditor_instance.val(d):this.epiceditor?this.epiceditor.importFile(null,d):this.ace_editor&&this.ace_editor.setValue(d);var e=c||this.getValue()!==a;this.refreshValue(),b?this.is_dirty=!1:"change"===this.jsoneditor.options.show_errors&&(this.is_dirty=!0),this.adjust_height&&this.adjust_height(this.input), +// Bubble this setValue to parents if the value changed +this.onChange(e)}}},getNumColumns:function(){var a,b=Math.ceil(Math.max(this.getTitle().length,this.schema.maxLength||0,this.schema.minLength||0)/5);return a="textarea"===this.input_type?6:["text","email"].indexOf(this.input_type)>=0?4:2,Math.min(12,Math.max(b,a))},build:function(){var a=this; +// Specific format +if(this.options.compact||(this.header=this.label=this.theme.getFormInputLabel(this.getTitle())),this.schema.description&&(this.description=this.theme.getFormInputDescription(this.schema.description)),this.format=this.schema.format,!this.format&&this.schema.media&&this.schema.media.type&&(this.format=this.schema.media.type.replace(/(^(application|text)\/(x-)?(script\.)?)|(-source$)/g,"")),!this.format&&this.options.default_format&&(this.format=this.options.default_format),this.options.format&&(this.format=this.options.format),this.format) +// Text Area +if("textarea"===this.format)this.input_type="textarea",this.input=this.theme.getTextareaInput();else if("range"===this.format){this.input_type="range";var b=this.schema.minimum||0,c=this.schema.maximum||Math.max(100,b+1),d=1;this.schema.multipleOf&&(b%this.schema.multipleOf&&(b=Math.ceil(b/this.schema.multipleOf)*this.schema.multipleOf),c%this.schema.multipleOf&&(c=Math.floor(c/this.schema.multipleOf)*this.schema.multipleOf),d=this.schema.multipleOf),this.input=this.theme.getRangeInput(b,c,d)}else["actionscript","batchfile","bbcode","c","c++","cpp","coffee","csharp","css","dart","django","ejs","erlang","golang","groovy","handlebars","haskell","haxe","html","ini","jade","java","javascript","json","less","lisp","lua","makefile","markdown","matlab","mysql","objectivec","pascal","perl","pgsql","php","python","r","ruby","sass","scala","scss","smarty","sql","stylus","svg","twig","vbscript","xml","yaml"].indexOf(this.format)>=0?(this.input_type=this.format,this.source_code=!0,this.input=this.theme.getTextareaInput()):(this.input_type=this.format,this.input=this.theme.getFormInputField(this.input_type));else this.input_type="text",this.input=this.theme.getFormInputField(this.input_type); +// minLength, maxLength, and pattern +"undefined"!=typeof this.schema.maxLength&&this.input.setAttribute("maxlength",this.schema.maxLength),"undefined"!=typeof this.schema.pattern?this.input.setAttribute("pattern",this.schema.pattern):"undefined"!=typeof this.schema.minLength&&this.input.setAttribute("pattern",".{"+this.schema.minLength+",}"),this.options.compact?this.container.className+=" compact":this.options.input_width&&(this.input.style.width=this.options.input_width),(this.schema.readOnly||this.schema.readonly||this.schema.template)&&(this.always_disabled=!0,this.input.disabled=!0),this.input.addEventListener("change",function(b){ +// Don't allow changing if this field is a template +if(b.preventDefault(),b.stopPropagation(),a.schema.template)return void(this.value=a.value);var c=this.value,d=a.sanitize(c);c!==d&&(this.value=d),a.is_dirty=!0,a.refreshValue(),a.onChange(!0)}),this.options.input_height&&(this.input.style.height=this.options.input_height),this.options.expand_height&&(this.adjust_height=function(a){if(a){var b,c=a.offsetHeight; +// Input too short +if(a.offsetHeight100);)b++,c++,a.style.height=c+"px";else{for(b=0;a.offsetHeight>=a.scrollHeight+3&&!(b>100);)b++,c--,a.style.height=c+"px";a.style.height=c+1+"px"}}},this.input.addEventListener("keyup",function(b){a.adjust_height(this)}),this.input.addEventListener("change",function(b){a.adjust_height(this)}),this.adjust_height()),this.format&&this.input.setAttribute("data-schemaformat",this.format),this.control=this.theme.getFormControl(this.label,this.input,this.description),this.container.appendChild(this.control), +// Any special formatting that needs to happen after the input is added to the dom +window.requestAnimationFrame(function(){ +// Skip in case the input is only a temporary editor, +// otherwise, in the case of an ace_editor creation, +// it will generate an error trying to append it to the missing parentNode +a.input.parentNode&&a.afterInputReady(),a.adjust_height&&a.adjust_height(a.input)}), +// Compile and store the template +this.schema.template?(this.template=this.jsoneditor.compileTemplate(this.schema.template,this.template_engine),this.refreshValue()):this.refreshValue()},enable:function(){this.always_disabled||(this.input.disabled=!1),this._super()},disable:function(){this.input.disabled=!0, +// TODO: WYSIWYG and Markdown editors +this._super()},afterInputReady:function(){var a,b=this; +// Code editor +if(this.source_code) +// WYSIWYG html and bbcode editor +if(this.options.wysiwyg&&["html","bbcode"].indexOf(this.input_type)>=0&&window.jQuery&&window.jQuery.fn&&window.jQuery.fn.sceditor)a=c({},{plugins:"html"===b.input_type?"xhtml":"bbcode",emoticonsEnabled:!1,width:"100%",height:300},f.plugins.sceditor,b.options.sceditor_options||{}),window.jQuery(b.input).sceditor(a),b.sceditor_instance=window.jQuery(b.input).sceditor("instance"),b.sceditor_instance.blur(function(){ +// Get editor's value +var a=window.jQuery("
    "+b.sceditor_instance.val()+"
    "); +// Remove sceditor spans/divs +window.jQuery("#sceditor-start-marker,#sceditor-end-marker,.sceditor-nlf",a).remove(), +// Set the value and update +b.input.value=a.html(),b.value=b.input.value,b.is_dirty=!0,b.onChange(!0)});else if("markdown"===this.input_type&&window.EpicEditor)this.epiceditor_container=document.createElement("div"),this.input.parentNode.insertBefore(this.epiceditor_container,this.input),this.input.style.display="none",a=c({},f.plugins.epiceditor,{container:this.epiceditor_container,clientSideStorage:!1}),this.epiceditor=new window.EpicEditor(a).load(),this.epiceditor.importFile(null,this.getValue()),this.epiceditor.on("update",function(){var a=b.epiceditor.exportFile();b.input.value=a,b.value=a,b.is_dirty=!0,b.onChange(!0)});else if(window.ace){var d=this.input_type; +// aliases for c/cpp +"cpp"!==d&&"c++"!==d&&"c"!==d||(d="c_cpp"),this.ace_container=document.createElement("div"),this.ace_container.style.width="100%",this.ace_container.style.position="relative",this.ace_container.style.height="400px",this.input.parentNode.insertBefore(this.ace_container,this.input),this.input.style.display="none",this.ace_editor=window.ace.edit(this.ace_container),this.ace_editor.setValue(this.getValue()), +// The theme +f.plugins.ace.theme&&this.ace_editor.setTheme("ace/theme/"+f.plugins.ace.theme), +// The mode +d=window.ace.require("ace/mode/"+d),d&&this.ace_editor.getSession().setMode(new d.Mode), +// Listen for changes +this.ace_editor.on("change",function(){var a=b.ace_editor.getValue();b.input.value=a,b.refreshValue(),b.is_dirty=!0,b.onChange(!0)})}b.theme.afterInputReady(b.input)},refreshValue:function(){this.value=this.input.value,"string"!=typeof this.value&&(this.value=""),this.serialized=this.value},destroy:function(){ +// If using SCEditor, destroy the editor instance +this.sceditor_instance?this.sceditor_instance.destroy():this.epiceditor?this.epiceditor.unload():this.ace_editor&&this.ace_editor.destroy(),this.template=null,this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),this.label&&this.label.parentNode&&this.label.parentNode.removeChild(this.label),this.description&&this.description.parentNode&&this.description.parentNode.removeChild(this.description),this._super()},/** + * This is overridden in derivative editors + */ +sanitize:function(a){return a},/** + * Re-calculates the value if needed + */ +onWatchedFieldChange:function(){var a; +// If this editor needs to be rendered by a macro template +this.template&&(a=this.getWatchedFieldValues(),this.setValue(this.template(a),!1,!0)),this._super()},showValidationErrors:function(a){var b=this;if("always"===this.jsoneditor.options.show_errors);else if(!this.is_dirty&&this.previous_error_setting===this.jsoneditor.options.show_errors)return;this.previous_error_setting=this.jsoneditor.options.show_errors;var c=[];d(a,function(a,d){d.path===b.path&&c.push(d.message)}),c.length?this.theme.addInputError(this.input,c.join(". ")+"."):this.theme.removeInputError(this.input)}}),f.defaults.editors.number=f.defaults.editors.string.extend({sanitize:function(a){return(a+"").replace(/[^0-9\.\-eE]/g,"")},getNumColumns:function(){return 2},getValue:function(){return 1*this.value}}),f.defaults.editors.integer=f.defaults.editors.number.extend({sanitize:function(a){return a+="",a.replace(/[^0-9\-]/g,"")},getNumColumns:function(){return 2}}),f.defaults.editors.object=f.AbstractEditor.extend({getDefault:function(){return c({},this.schema["default"]||{})},getChildEditors:function(){return this.editors},register:function(){if(this._super(),this.editors)for(var a in this.editors)this.editors.hasOwnProperty(a)&&this.editors[a].register()},unregister:function(){if(this._super(),this.editors)for(var a in this.editors)this.editors.hasOwnProperty(a)&&this.editors[a].unregister()},getNumColumns:function(){return Math.max(Math.min(12,this.maxwidth),3)},enable:function(){if(this.editjson_button&&(this.editjson_button.disabled=!1),this.addproperty_button&&(this.addproperty_button.disabled=!1),this._super(),this.editors)for(var a in this.editors)this.editors.hasOwnProperty(a)&&this.editors[a].enable()},disable:function(){if(this.editjson_button&&(this.editjson_button.disabled=!0),this.addproperty_button&&(this.addproperty_button.disabled=!0),this.hideEditJSON(),this._super(),this.editors)for(var a in this.editors)this.editors.hasOwnProperty(a)&&this.editors[a].disable()},layoutEditors:function(){var a,b,c=this;if(this.row_container){ +// Sort editors by propertyOrder +this.property_order=Object.keys(this.editors),this.property_order=this.property_order.sort(function(a,b){var d=c.editors[a].schema.propertyOrder,e=c.editors[b].schema.propertyOrder;return"number"!=typeof d&&(d=1e3),"number"!=typeof e&&(e=1e3),d-e});var e;if("grid"===this.format){var f=[]; +// Make almost full rows width 12 +// Do this by increasing all editors' sizes proprotionately +// Any left over space goes to the biggest editor +// Don't touch rows with a width of 6 or less +for(d(this.property_order,function(a,b){var d=c.editors[b];if(!d.property_removed){ +// See if the editor will fit in any of the existing rows first +for(var e=!1,g=d.options.hidden?0:d.options.grid_columns||d.getNumColumns(),h=d.options.hidden?0:d.container.offsetHeight,i=0;ih)&&(e=i); +// If there isn't a spot in any of the existing rows, start a new row +e===!1&&(f.push({width:0,minh:999999,maxh:0,editors:[]}),e=f.length-1),f[e].editors.push({key:b, +//editor: editor, +width:g,height:h}),f[e].width+=g,f[e].minh=Math.min(f[e].minh,h),f[e].maxh=Math.max(f[e].maxh,h)}}),a=0;af[a].editors[g].width&&(g=b),f[a].editors[b].width*=12/f[a].width,f[a].editors[b].width=Math.floor(f[a].editors[b].width),h+=f[a].editors[b].width;h<12&&(f[a].editors[g].width+=12-h),f[a].width=12} +// layout hasn't changed +if(this.layout===JSON.stringify(f))return!1;for(this.layout=JSON.stringify(f), +// Layout the form +e=document.createElement("div"),a=0;a=this.schema.maxProperties),this.addproperty_checkboxes&&(this.addproperty_list.innerHTML=""),this.addproperty_checkboxes={}; +// Check for which editors can't be removed or added back +for(a in this.cached_editors)this.cached_editors.hasOwnProperty(a)&&(this.addPropertyCheckbox(a),this.isRequired(this.cached_editors[a])&&a in this.editors&&(this.addproperty_checkboxes[a].disabled=!0),"undefined"!=typeof this.schema.minProperties&&d<=this.schema.minProperties?(this.addproperty_checkboxes[a].disabled=this.addproperty_checkboxes[a].checked,this.addproperty_checkboxes[a].checked||(e=!0)):a in this.editors?(e=!0,c=!0):b||this.schema.properties.hasOwnProperty(a)?(this.addproperty_checkboxes[a].disabled=!1,e=!0):this.addproperty_checkboxes[a].disabled=!0);this.canHaveAdditionalProperties()&&(e=!0); +// Additional addproperty checkboxes not tied to a current editor +for(a in this.schema.properties)this.schema.properties.hasOwnProperty(a)&&(this.cached_editors[a]||(e=!0,this.addPropertyCheckbox(a))); +// If no editors can be added or removed, hide the modal button +e?this.canHaveAdditionalProperties()?b?this.addproperty_add.disabled=!1:this.addproperty_add.disabled=!0:(this.addproperty_add.style.display="none",this.addproperty_input.style.display="none"):(this.hideAddProperty(),this.addproperty_controls.style.display="none")},isRequired:function(a){return"boolean"==typeof a.schema.required?a.schema.required:Array.isArray(this.schema.required)?this.schema.required.indexOf(a.key)>-1:!!this.jsoneditor.options.required_by_default},setValue:function(a,b){var c=this;a=a||{},("object"!=typeof a||Array.isArray(a))&&(a={}), +// First, set the values for all of the defined properties +d(this.cached_editors,function(d,e){ +// Value explicitly set +"undefined"!=typeof a[d]?(c.addObjectProperty(d),e.setValue(a[d],b)):b||c.isRequired(e)?e.setValue(e.getDefault(),b):c.removeObjectProperty(d)}),d(a,function(a,d){c.cached_editors[a]||(c.addObjectProperty(a),c.editors[a]&&c.editors[a].setValue(d,b))}),this.refreshValue(),this.layoutEditors(),this.onChange()},showValidationErrors:function(a){var b=this,c=[],e=[]; +// Show errors for this editor +if(d(a,function(a,d){d.path===b.path?c.push(d):e.push(d)}),this.error_holder)if(c.length){this.error_holder.innerHTML="",this.error_holder.style.display="",d(c,function(a,c){b.error_holder.appendChild(b.theme.getErrorMessage(c.message))})}else this.error_holder.style.display="none"; +// Show error for the table row if this is inside a table +this.options.table_row&&(c.length?this.theme.addTableRowError(this.container):this.theme.removeTableRowError(this.container)), +// Show errors for child editors +d(this.editors,function(a,b){b.showValidationErrors(e)})}}),f.defaults.editors.array=f.AbstractEditor.extend({getDefault:function(){return this.schema["default"]||[]},register:function(){if(this._super(),this.rows)for(var a=0;a=this.schema.items.length?this.schema.additionalItems===!0?{}:this.schema.additionalItems?c({},this.schema.additionalItems):void 0:c({},this.schema.items[a]):this.schema.items?c({},this.schema.items):{}},getItemInfo:function(a){var b=this.getItemSchema(a); +// Check if it's cached +this.item_info=this.item_info||{};var c=JSON.stringify(b); +// Get the schema for this item +return"undefined"!=typeof this.item_info[c]?this.item_info[c]:(b=this.jsoneditor.expandRefs(b),this.item_info[c]={title:b.title||"item","default":b["default"],width:12,child_editors:b.properties||b.items},this.item_info[c])},getElementEditor:function(a){var b=this.getItemInfo(a),c=this.getItemSchema(a);c=this.jsoneditor.expandRefs(c),c.title=b.title+" "+(a+1);var d,e=this.jsoneditor.getEditorClass(c);d=this.tabs_holder?this.theme.getTabContent():b.child_editors?this.theme.getChildEditorHolder():this.theme.getIndentedPanel(),this.row_holder.appendChild(d);var f=this.jsoneditor.createEditor(e,{jsoneditor:this.jsoneditor,schema:c,container:d,path:this.path+"."+a,parent:this,required:!0});return f.preBuild(),f.build(),f.postBuild(),f.title_controls||(f.array_controls=this.theme.getButtonHolder(),d.appendChild(f.array_controls)),f},destroy:function(){this.empty(!0),this.title&&this.title.parentNode&&this.title.parentNode.removeChild(this.title),this.description&&this.description.parentNode&&this.description.parentNode.removeChild(this.description),this.row_holder&&this.row_holder.parentNode&&this.row_holder.parentNode.removeChild(this.row_holder),this.controls&&this.controls.parentNode&&this.controls.parentNode.removeChild(this.controls),this.panel&&this.panel.parentNode&&this.panel.parentNode.removeChild(this.panel),this.rows=this.row_cache=this.title=this.description=this.row_holder=this.panel=this.controls=null,this._super()},empty:function(a){if(this.rows){var b=this;d(this.rows,function(c,d){a&&(d.tab&&d.tab.parentNode&&d.tab.parentNode.removeChild(d.tab),b.destroyRow(d,!0),b.row_cache[c]=null),b.rows[c]=null}),b.rows=[],a&&(b.row_cache=[])}},destroyRow:function(a,b){var c=a.container;b?(a.destroy(),c.parentNode&&c.parentNode.removeChild(c),a.tab&&a.tab.parentNode&&a.tab.parentNode.removeChild(a.tab)):(a.tab&&(a.tab.style.display="none"),c.style.display="none",a.unregister())},getMax:function(){return Array.isArray(this.schema.items)&&this.schema.additionalItems===!1?Math.min(this.schema.items.length,this.schema.maxItems||1/0):this.schema.maxItems||1/0},refreshTabs:function(a){var b=this;d(this.rows,function(c,d){d.tab&&(a?d.tab_text.textContent=d.getHeaderText():d.tab===b.active_tab?(b.theme.markTabActive(d.tab),d.container.style.display=""):(b.theme.markTabInactive(d.tab),d.container.style.display="none"))})},setValue:function(a,b){ +// Update the array's value, adding/removing rows when necessary +a=a||[],Array.isArray(a)||(a=[a]);var c=JSON.stringify(a);if(c!==this.serialized){ +// Make sure value has between minItems and maxItems items in it +if(this.schema.minItems)for(;a.lengththis.getMax()&&(a=a.slice(0,this.getMax()));var e=this;d(a,function(a,c){e.rows[a]? +// TODO: don't set the row's value if it hasn't changed +e.rows[a].setValue(c,b):e.row_cache[a]?(e.rows[a]=e.row_cache[a],e.rows[a].setValue(c,b),e.rows[a].container.style.display="",e.rows[a].tab&&(e.rows[a].tab.style.display=""),e.rows[a].register()):e.addRow(c,b)});for(var f=a.length;f=this.rows.length;d(this.rows,function(a,c){ +// Hide the move down button for the last row +c.movedown_button&&(a===b.rows.length-1?c.movedown_button.style.display="none":c.movedown_button.style.display=""), +// Hide the delete button if we have minItems items +c.delete_button&&(e?c.delete_button.style.display="none":c.delete_button.style.display=""), +// Get the value for this editor +b.value[a]=c.getValue()});var f=!1;this.value.length?1===this.value.length?(this.remove_all_rows_button.style.display="none", +// If there are minItems items in the array, or configured to hide the delete_last_row button, hide the delete button beneath the rows +e||this.hide_delete_last_row_buttons?this.delete_last_row_button.style.display="none":(this.delete_last_row_button.style.display="",f=!0)):(e||this.hide_delete_last_row_buttons?this.delete_last_row_button.style.display="none":(this.delete_last_row_button.style.display="",f=!0),e||this.hide_delete_all_rows_buttons?this.remove_all_rows_button.style.display="none":(this.remove_all_rows_button.style.display="",f=!0)):(this.delete_last_row_button.style.display="none",this.remove_all_rows_button.style.display="none"), +// If there are maxItems in the array, hide the add button beneath the rows +this.getMax()&&this.getMax()<=this.rows.length||this.hide_add_button?this.add_row_button.style.display="none":(this.add_row_button.style.display="",f=!0),!this.collapsed&&f?this.controls.style.display="inline-block":this.controls.style.display="none"}},addRow:function(a,b){var c=this,e=this.rows.length;c.rows[e]=this.getElementEditor(e),c.row_cache[e]=c.rows[e],c.tabs_holder&&(c.rows[e].tab_text=document.createElement("span"),c.rows[e].tab_text.textContent=c.rows[e].getHeaderText(),c.rows[e].tab=c.theme.getTab(c.rows[e].tab_text),c.rows[e].tab.addEventListener("click",function(a){c.active_tab=c.rows[e].tab,c.refreshTabs(),a.preventDefault(),a.stopPropagation()}),c.theme.addTab(c.tabs_holder,c.rows[e].tab));var f=c.rows[e].title_controls||c.rows[e].array_controls; +// Buttons to delete row, move row up, and move row down +c.hide_delete_buttons||(c.rows[e].delete_button=this.getButton(c.getItemTitle(),"delete",this.translate("button_delete_row_title",[c.getItemTitle()])),c.rows[e].delete_button.className+=" delete",c.rows[e].delete_button.setAttribute("data-i",e),c.rows[e].delete_button.addEventListener("click",function(a){a.preventDefault(),a.stopPropagation();var b=1*this.getAttribute("data-i"),e=c.getValue(),f=[],g=null;d(e,function(a,d){ +// If the one we're deleting is the active tab +// Make the next tab active if there is one +// Note: the next tab is going to be the current tab after deletion +return a===b?void(c.rows[a].tab===c.active_tab&&(c.rows[a+1]?g=c.rows[a].tab:a&&(g=c.rows[a-1].tab))):void f.push(d)}),c.setValue(f),g&&(c.active_tab=g,c.refreshTabs()),c.onChange(!0)}),f&&f.appendChild(c.rows[e].delete_button)),e&&!c.hide_move_buttons&&(c.rows[e].moveup_button=this.getButton("","moveup",this.translate("button_move_up_title")),c.rows[e].moveup_button.className+=" moveup",c.rows[e].moveup_button.setAttribute("data-i",e),c.rows[e].moveup_button.addEventListener("click",function(a){a.preventDefault(),a.stopPropagation();var b=1*this.getAttribute("data-i");if(!(b<=0)){var d=c.getValue(),e=d[b-1];d[b-1]=d[b],d[b]=e,c.setValue(d),c.active_tab=c.rows[b-1].tab,c.refreshTabs(),c.onChange(!0)}}),f&&f.appendChild(c.rows[e].moveup_button)),c.hide_move_buttons||(c.rows[e].movedown_button=this.getButton("","movedown",this.translate("button_move_down_title")),c.rows[e].movedown_button.className+=" movedown",c.rows[e].movedown_button.setAttribute("data-i",e),c.rows[e].movedown_button.addEventListener("click",function(a){a.preventDefault(),a.stopPropagation();var b=1*this.getAttribute("data-i"),d=c.getValue();if(!(b>=d.length-1)){var e=d[b+1];d[b+1]=d[b],d[b]=e,c.setValue(d),c.active_tab=c.rows[b+1].tab,c.refreshTabs(),c.onChange(!0)}}),f&&f.appendChild(c.rows[e].movedown_button)),a&&c.rows[e].setValue(a,b),c.refreshTabs()},addControls:function(){var a=this;this.collapsed=!1,this.toggle_button=this.getButton("","collapse",this.translate("button_collapse")),this.title_controls.appendChild(this.toggle_button);var b=a.row_holder.style.display,c=a.controls.style.display;this.toggle_button.addEventListener("click",function(d){d.preventDefault(),d.stopPropagation(),a.collapsed?(a.collapsed=!1,a.panel&&(a.panel.style.display=""),a.row_holder.style.display=b,a.tabs_holder&&(a.tabs_holder.style.display=""),a.controls.style.display=c,a.setButtonText(this,"","collapse",a.translate("button_collapse"))):(a.collapsed=!0,a.row_holder.style.display="none",a.tabs_holder&&(a.tabs_holder.style.display="none"),a.controls.style.display="none",a.panel&&(a.panel.style.display="none"),a.setButtonText(this,"","expand",a.translate("button_expand")))}), +// If it should start collapsed +this.options.collapsed&&e(this.toggle_button,"click"), +// Collapse button disabled +this.schema.options&&"undefined"!=typeof this.schema.options.disable_collapse?this.schema.options.disable_collapse&&(this.toggle_button.style.display="none"):this.jsoneditor.options.disable_collapse&&(this.toggle_button.style.display="none"), +// Add "new row" and "delete last" buttons below editor +this.add_row_button=this.getButton(this.getItemTitle(),"add",this.translate("button_add_row_title",[this.getItemTitle()])),this.add_row_button.addEventListener("click",function(b){b.preventDefault(),b.stopPropagation();var c=a.rows.length;a.row_cache[c]?(a.rows[c]=a.row_cache[c],a.rows[c].setValue(a.rows[c].getDefault(),!0),a.rows[c].container.style.display="",a.rows[c].tab&&(a.rows[c].tab.style.display=""),a.rows[c].register()):a.addRow(),a.active_tab=a.rows[c].tab,a.refreshTabs(),a.refreshValue(),a.onChange(!0)}),a.controls.appendChild(this.add_row_button),this.delete_last_row_button=this.getButton(this.translate("button_delete_last",[this.getItemTitle()]),"delete",this.translate("button_delete_last_title",[this.getItemTitle()])),this.delete_last_row_button.addEventListener("click",function(b){b.preventDefault(),b.stopPropagation();var c=a.getValue(),d=null;a.rows.length>1&&a.rows[a.rows.length-1].tab===a.active_tab&&(d=a.rows[a.rows.length-2].tab),c.pop(),a.setValue(c),d&&(a.active_tab=d,a.refreshTabs()),a.onChange(!0)}),a.controls.appendChild(this.delete_last_row_button),this.remove_all_rows_button=this.getButton(this.translate("button_delete_all"),"delete",this.translate("button_delete_all_title")),this.remove_all_rows_button.addEventListener("click",function(b){b.preventDefault(),b.stopPropagation(),a.setValue([]),a.onChange(!0)}),a.controls.appendChild(this.remove_all_rows_button),a.tabs&&(this.add_row_button.style.width="100%",this.add_row_button.style.textAlign="left",this.add_row_button.style.marginBottom="3px",this.delete_last_row_button.style.width="100%",this.delete_last_row_button.style.textAlign="left",this.delete_last_row_button.style.marginBottom="3px",this.remove_all_rows_button.style.width="100%",this.remove_all_rows_button.style.textAlign="left",this.remove_all_rows_button.style.marginBottom="3px")},showValidationErrors:function(a){var b=this,c=[],e=[]; +// Show errors for this editor +if(d(a,function(a,d){d.path===b.path?c.push(d):e.push(d)}),this.error_holder)if(c.length){this.error_holder.innerHTML="",this.error_holder.style.display="",d(c,function(a,c){b.error_holder.appendChild(b.theme.getErrorMessage(c.message))})}else this.error_holder.style.display="none"; +// Show errors for child editors +d(this.rows,function(a,b){b.showValidationErrors(e)})}}),f.defaults.editors.table=f.defaults.editors.array.extend({register:function(){if(this._super(),this.rows)for(var a=0;athis.schema.maxItems&&(a=a.slice(0,this.schema.maxItems));var c=JSON.stringify(a);if(c!==this.serialized){var e=!1,f=this;d(a,function(a,b){f.rows[a]? +// TODO: don't set the row's value if it hasn't changed +f.rows[a].setValue(b):(f.addRow(b),e=!0)});for(var g=a.length;g=this.rows.length,c=!1;d(this.rows,function(d,e){ +// Hide the move down button for the last row +e.movedown_button&&(d===a.rows.length-1?e.movedown_button.style.display="none":(c=!0,e.movedown_button.style.display="")), +// Hide the delete button if we have minItems items +e.delete_button&&(b?e.delete_button.style.display="none":(c=!0,e.delete_button.style.display="")),e.moveup_button&&(c=!0)}), +// Show/hide controls column in table +d(this.rows,function(a,b){c?b.controls_cell.style.display="":b.controls_cell.style.display="none"}),c?this.controls_header_cell.style.display="":this.controls_header_cell.style.display="none";var e=!1;this.value.length?1===this.value.length?(this.table.style.display="",this.remove_all_rows_button.style.display="none", +// If there are minItems items in the array, or configured to hide the delete_last_row button, hide the delete button beneath the rows +b||this.hide_delete_last_row_buttons?this.delete_last_row_button.style.display="none":(this.delete_last_row_button.style.display="",e=!0)):(this.table.style.display="",b||this.hide_delete_last_row_buttons?this.delete_last_row_button.style.display="none":(this.delete_last_row_button.style.display="",e=!0),b||this.hide_delete_all_rows_buttons?this.remove_all_rows_button.style.display="none":(this.remove_all_rows_button.style.display="",e=!0)):(this.delete_last_row_button.style.display="none",this.remove_all_rows_button.style.display="none",this.table.style.display="none"), +// If there are maxItems in the array, hide the add button beneath the rows +this.schema.maxItems&&this.schema.maxItems<=this.rows.length||this.hide_add_button?this.add_row_button.style.display="none":(this.add_row_button.style.display="",e=!0),e?this.controls.style.display="":this.controls.style.display="none"},refreshValue:function(){var a=this;this.value=[],d(this.rows,function(b,c){ +// Get the value for this editor +a.value[b]=c.getValue()}),this.serialized=JSON.stringify(this.value)},addRow:function(a){var b=this,c=this.rows.length;b.rows[c]=this.getElementEditor(c);var e=b.rows[c].table_controls; +// Buttons to delete row, move row up, and move row down +this.hide_delete_buttons||(b.rows[c].delete_button=this.getButton("","delete",this.translate("button_delete_row_title_short")),b.rows[c].delete_button.className+=" delete",b.rows[c].delete_button.setAttribute("data-i",c),b.rows[c].delete_button.addEventListener("click",function(a){a.preventDefault(),a.stopPropagation();var c=1*this.getAttribute("data-i"),e=b.getValue(),f=[];d(e,function(a,b){a!==c&&// If this is the one we're deleting +f.push(b)}),b.setValue(f),b.onChange(!0)}),e.appendChild(b.rows[c].delete_button)),c&&!this.hide_move_buttons&&(b.rows[c].moveup_button=this.getButton("","moveup",this.translate("button_move_up_title")),b.rows[c].moveup_button.className+=" moveup",b.rows[c].moveup_button.setAttribute("data-i",c),b.rows[c].moveup_button.addEventListener("click",function(a){a.preventDefault(),a.stopPropagation();var c=1*this.getAttribute("data-i");if(!(c<=0)){var d=b.getValue(),e=d[c-1];d[c-1]=d[c],d[c]=e,b.setValue(d),b.onChange(!0)}}),e.appendChild(b.rows[c].moveup_button)),this.hide_move_buttons||(b.rows[c].movedown_button=this.getButton("","movedown",this.translate("button_move_down_title")),b.rows[c].movedown_button.className+=" movedown",b.rows[c].movedown_button.setAttribute("data-i",c),b.rows[c].movedown_button.addEventListener("click",function(a){a.preventDefault(),a.stopPropagation();var c=1*this.getAttribute("data-i"),d=b.getValue();if(!(c>=d.length-1)){var e=d[c+1];d[c+1]=d[c],d[c]=e,b.setValue(d),b.onChange(!0)}}),e.appendChild(b.rows[c].movedown_button)),a&&b.rows[c].setValue(a)},addControls:function(){var a=this;this.collapsed=!1,this.toggle_button=this.getButton("","collapse",this.translate("button_collapse")),this.title_controls&&(this.title_controls.appendChild(this.toggle_button),this.toggle_button.addEventListener("click",function(b){b.preventDefault(),b.stopPropagation(),a.collapsed?(a.collapsed=!1,a.panel.style.display="",a.setButtonText(this,"","collapse",a.translate("button_collapse"))):(a.collapsed=!0,a.panel.style.display="none",a.setButtonText(this,"","expand",a.translate("button_expand")))}), +// If it should start collapsed +this.options.collapsed&&e(this.toggle_button,"click"), +// Collapse button disabled +this.schema.options&&"undefined"!=typeof this.schema.options.disable_collapse?this.schema.options.disable_collapse&&(this.toggle_button.style.display="none"):this.jsoneditor.options.disable_collapse&&(this.toggle_button.style.display="none")), +// Add "new row" and "delete last" buttons below editor +this.add_row_button=this.getButton(this.getItemTitle(),"add",this.translate("button_add_row_title",[this.getItemTitle()])),this.add_row_button.addEventListener("click",function(b){b.preventDefault(),b.stopPropagation(),a.addRow(),a.refreshValue(),a.refreshRowButtons(),a.onChange(!0)}),a.controls.appendChild(this.add_row_button),this.delete_last_row_button=this.getButton(this.translate("button_delete_last",[this.getItemTitle()]),"delete",this.translate("button_delete_last_title",[this.getItemTitle()])),this.delete_last_row_button.addEventListener("click",function(b){b.preventDefault(),b.stopPropagation();var c=a.getValue();c.pop(),a.setValue(c),a.onChange(!0)}),a.controls.appendChild(this.delete_last_row_button),this.remove_all_rows_button=this.getButton(this.translate("button_delete_all"),"delete",this.translate("button_delete_all_title")),this.remove_all_rows_button.addEventListener("click",function(b){b.preventDefault(),b.stopPropagation(),a.setValue([]),a.onChange(!0)}),a.controls.appendChild(this.remove_all_rows_button)}}), +// Multiple Editor (for when `type` is an array) +f.defaults.editors.multiple=f.AbstractEditor.extend({register:function(){if(this.editors){for(var a=0;anull";if("object"==typeof a){ +// TODO: use theme +var c="";return d(a,function(d,e){var f=b.getHTML(e); +// Add the keys to object children +Array.isArray(a)||( +// TODO: use theme +f="
    "+d+": "+f+"
    "), +// TODO: use theme +c+="
  • "+f+"
  • "}),c=Array.isArray(a)?"
      "+c+"
    ":"
      "+c+"
    "}return"boolean"==typeof a?a?"true":"false":"string"==typeof a?a.replace(/&/g,"&").replace(//g,">"):a},setValue:function(a){this.value!==a&&(this.value=a,this.refreshValue(),this.onChange())},destroy:function(){this.display_area&&this.display_area.parentNode&&this.display_area.parentNode.removeChild(this.display_area),this.title&&this.title.parentNode&&this.title.parentNode.removeChild(this.title),this.switcher&&this.switcher.parentNode&&this.switcher.parentNode.removeChild(this.switcher),this._super()}}),f.defaults.editors.select=f.AbstractEditor.extend({setValue:function(a,b){a=this.typecast(a||""); +// Sanitize value before setting it +var c=a;this.enum_values.indexOf(c)<0&&(c=this.enum_values[0]),this.value!==c&&(this.input.value=this.enum_options[this.enum_values.indexOf(c)],this.select2&&this.select2.select2("val",this.input.value),this.value=c,this.onChange())},register:function(){this._super(),this.input&&this.input.setAttribute("name",this.formname)},unregister:function(){this._super(),this.input&&this.input.removeAttribute("name")},getNumColumns:function(){if(!this.enum_options)return 3;for(var a=this.getTitle().length,b=0;b2||this.enum_options.length&&this.enumSource)){var a=c({},f.plugins.select2);this.schema.options&&this.schema.options.select2_options&&(a=c(a,this.schema.options.select2_options)),this.select2=window.jQuery(this.input).select2(a);var b=this;this.select2.on("select2-blur",function(){b.input.value=b.select2.select2("val"),b.onInputChange()}),this.select2.on("change",function(){b.input.value=b.select2.select2("val"),b.onInputChange()})}else this.select2=null},postBuild:function(){this._super(),this.theme.afterInputReady(this.input),this.setupSelect2()},onWatchedFieldChange:function(){var a,b; +// If this editor uses a dynamic select box +if(this.enumSource){a=this.getWatchedFieldValues();for(var c=[],d=[],e=0;e=2||this.enum_options.length&&this.enumSource)){var b=c({},f.plugins.selectize);this.schema.options&&this.schema.options.selectize_options&&(b=c(b,this.schema.options.selectize_options)),this.selectize=window.jQuery(this.input).selectize(c(b,{create:!0,onChange:function(){a.onInputChange()}}))}else this.selectize=null},postBuild:function(){this._super(),this.theme.afterInputReady(this.input),this.setupSelectize()},onWatchedFieldChange:function(){var a,b; +// If this editor uses a dynamic select box +if(this.enumSource){a=this.getWatchedFieldValues();for(var c=[],d=[],e=0;eType: "+a+", Size: "+Math.floor((this.value.length-this.value.split(",")[0].length-1)/1.33333)+" bytes","image"===a.substr(0,5)){this.preview.innerHTML+="
    ";var b=document.createElement("img");b.style.maxWidth="100%",b.style.maxHeight="100px",b.src=this.value,this.preview.appendChild(b)}}else this.preview.innerHTML="Invalid data URI"}},enable:function(){this.uploader&&(this.uploader.disabled=!1),this._super()},disable:function(){this.uploader&&(this.uploader.disabled=!0),this._super()},setValue:function(a){this.value!==a&&(this.value=a,this.input.value=this.value,this.refreshPreview(),this.onChange())},destroy:function(){this.preview&&this.preview.parentNode&&this.preview.parentNode.removeChild(this.preview),this.title&&this.title.parentNode&&this.title.parentNode.removeChild(this.title),this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),this.uploader&&this.uploader.parentNode&&this.uploader.parentNode.removeChild(this.uploader),this._super()}}),f.defaults.editors.upload=f.AbstractEditor.extend({getNumColumns:function(){return 4},build:function(){var a=this; +// Don't show uploader if this is readonly +if(this.title=this.header=this.label=this.theme.getFormInputLabel(this.getTitle()), +// Input that holds the base64 string +this.input=this.theme.getFormInputField("hidden"),this.container.appendChild(this.input),!this.schema.readOnly&&!this.schema.readonly){if(!this.jsoneditor.options.upload)throw"Upload handler required for upload editor"; +// File uploader +this.uploader=this.theme.getFormInputField("file"),this.uploader.addEventListener("change",function(b){if(b.preventDefault(),b.stopPropagation(),this.files&&this.files.length){var c=new FileReader;c.onload=function(b){a.preview_value=b.target.result,a.refreshPreview(),a.onChange(!0),c=null},c.readAsDataURL(this.files[0])}})}var b=this.schema.description;b||(b=""),this.preview=this.theme.getFormInputDescription(b),this.container.appendChild(this.preview),this.control=this.theme.getFormControl(this.label,this.uploader||this.input,this.preview),this.container.appendChild(this.control)},refreshPreview:function(){if(this.last_preview!==this.preview_value&&(this.last_preview=this.preview_value,this.preview.innerHTML="",this.preview_value)){var a=this,b=this.preview_value.match(/^data:([^;,]+)[;,]/);b&&(b=b[1]),b||(b="unknown");var c=this.uploader.files[0];if(this.preview.innerHTML="Type: "+b+", Size: "+c.size+" bytes","image"===b.substr(0,5)){this.preview.innerHTML+="
    ";var d=document.createElement("img");d.style.maxWidth="100%",d.style.maxHeight="100px",d.src=this.preview_value,this.preview.appendChild(d)}this.preview.innerHTML+="
    ";var e=this.getButton("Upload","upload","Upload");this.preview.appendChild(e),e.addEventListener("click",function(b){b.preventDefault(),e.setAttribute("disabled","disabled"),a.theme.removeInputError(a.uploader),a.theme.getProgressBar&&(a.progressBar=a.theme.getProgressBar(),a.preview.appendChild(a.progressBar)),a.jsoneditor.options.upload(a.path,c,{success:function(b){a.setValue(b),a.parent?a.parent.onChildEditorChange(a):a.jsoneditor.onChange(),a.progressBar&&a.preview.removeChild(a.progressBar),e.removeAttribute("disabled")},failure:function(b){a.theme.addInputError(a.uploader,b),a.progressBar&&a.preview.removeChild(a.progressBar),e.removeAttribute("disabled")},updateProgress:function(b){a.progressBar&&(b?a.theme.updateProgressBar(a.progressBar,b):a.theme.updateProgressBarUnknown(a.progressBar))}})})}},enable:function(){this.uploader&&(this.uploader.disabled=!1),this._super()},disable:function(){this.uploader&&(this.uploader.disabled=!0),this._super()},setValue:function(a){this.value!==a&&(this.value=a,this.input.value=this.value,this.onChange())},destroy:function(){this.preview&&this.preview.parentNode&&this.preview.parentNode.removeChild(this.preview),this.title&&this.title.parentNode&&this.title.parentNode.removeChild(this.title),this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),this.uploader&&this.uploader.parentNode&&this.uploader.parentNode.removeChild(this.uploader),this._super()}}),f.defaults.editors.checkbox=f.AbstractEditor.extend({setValue:function(a,b){this.value=!!a,this.input.checked=this.value,this.onChange()},register:function(){this._super(),this.input&&this.input.setAttribute("name",this.formname)},unregister:function(){this._super(),this.input&&this.input.removeAttribute("name")},getNumColumns:function(){return Math.min(12,Math.max(this.getTitle().length/7,2))},build:function(){var a=this;this.options.compact||(this.label=this.header=this.theme.getCheckboxLabel(this.getTitle())),this.schema.description&&(this.description=this.theme.getFormInputDescription(this.schema.description)),this.options.compact&&(this.container.className+=" compact"),this.input=this.theme.getCheckbox(),this.control=this.theme.getFormControl(this.label,this.input,this.description),(this.schema.readOnly||this.schema.readonly)&&(this.always_disabled=!0,this.input.disabled=!0),this.input.addEventListener("change",function(b){b.preventDefault(),b.stopPropagation(),a.value=this.checked,a.onChange(!0)}),this.container.appendChild(this.control)},enable:function(){this.always_disabled||(this.input.disabled=!1),this._super()},disable:function(){this.input.disabled=!0,this._super()},destroy:function(){this.label&&this.label.parentNode&&this.label.parentNode.removeChild(this.label),this.description&&this.description.parentNode&&this.description.parentNode.removeChild(this.description),this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),this._super()}}),f.defaults.editors.arraySelectize=f.AbstractEditor.extend({build:function(){this.title=this.theme.getFormInputLabel(this.getTitle()),this.title_controls=this.theme.getHeaderButtonHolder(),this.title.appendChild(this.title_controls),this.error_holder=document.createElement("div"),this.schema.description&&(this.description=this.theme.getDescription(this.schema.description)),this.input=document.createElement("select"),this.input.setAttribute("multiple","multiple");var a=this.theme.getFormControl(this.title,this.input,this.description);this.container.appendChild(a),this.container.appendChild(this.error_holder),window.jQuery(this.input).selectize({delimiter:!1,createOnBlur:!0,create:!0})},postBuild:function(){var a=this;this.input.selectize.on("change",function(b){a.refreshValue(),a.onChange(!0)})},destroy:function(){this.empty(!0),this.title&&this.title.parentNode&&this.title.parentNode.removeChild(this.title),this.description&&this.description.parentNode&&this.description.parentNode.removeChild(this.description),this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),this._super()},empty:function(a){},setValue:function(a,b){var c=this; +// Update the array's value, adding/removing rows when necessary +a=a||[],Array.isArray(a)||(a=[a]),this.input.selectize.clearOptions(),this.input.selectize.clear(!0),a.forEach(function(a){c.input.selectize.addOption({text:a,value:a})}),this.input.selectize.setValue(a),this.refreshValue(b)},refreshValue:function(a){this.value=this.input.selectize.getValue()},showValidationErrors:function(a){var b=this,c=[],e=[]; +// Show errors for this editor +if(d(a,function(a,d){d.path===b.path?c.push(d):e.push(d)}),this.error_holder)if(c.length){this.error_holder.innerHTML="",this.error_holder.style.display="",d(c,function(a,c){b.error_holder.appendChild(b.theme.getErrorMessage(c.message))})}else this.error_holder.style.display="none"}});var g=function(){var a=document.documentElement;return a.matches?"matches":a.webkitMatchesSelector?"webkitMatchesSelector":a.mozMatchesSelector?"mozMatchesSelector":a.msMatchesSelector?"msMatchesSelector":a.oMatchesSelector?"oMatchesSelector":void 0}();f.AbstractTheme=a.extend({getContainer:function(){return document.createElement("div")},getFloatRightLinkHolder:function(){var a=document.createElement("div");return a.style=a.style||{},a.style.cssFloat="right",a.style.marginLeft="10px",a},getModal:function(){var a=document.createElement("div");return a.style.backgroundColor="white",a.style.border="1px solid black",a.style.boxShadow="3px 3px black",a.style.position="absolute",a.style.zIndex="10",a.style.display="none",a},getGridContainer:function(){var a=document.createElement("div");return a},getGridRow:function(){var a=document.createElement("div");return a.className="row",a},getGridColumn:function(){var a=document.createElement("div");return a},setGridColumnSize:function(a,b){},getLink:function(a){var b=document.createElement("a");return b.setAttribute("href","#"),b.appendChild(document.createTextNode(a)),b},disableHeader:function(a){a.style.color="#ccc"},disableLabel:function(a){a.style.color="#ccc"},enableHeader:function(a){a.style.color=""},enableLabel:function(a){a.style.color=""},getFormInputLabel:function(a){var b=document.createElement("label");return b.appendChild(document.createTextNode(a)),b},getCheckboxLabel:function(a){var b=this.getFormInputLabel(a);return b.style.fontWeight="normal",b},getHeader:function(a){var b=document.createElement("h3");return"string"==typeof a?b.textContent=a:b.appendChild(a),b},getCheckbox:function(){var a=this.getFormInputField("checkbox");return a.style.display="inline-block",a.style.width="auto",a},getMultiCheckboxHolder:function(a,b,c){var d=document.createElement("div");b&&(b.style.display="block",d.appendChild(b));for(var e in a)a.hasOwnProperty(e)&&(a[e].style.display="inline-block",a[e].style.marginRight="20px",d.appendChild(a[e]));return c&&d.appendChild(c),d},getSelectInput:function(a){var b=document.createElement("select");return a&&this.setSelectOptions(b,a),b},getSwitcher:function(a){var b=this.getSelectInput(a);return b.style.backgroundColor="transparent",b.style.display="inline-block",b.style.fontStyle="italic",b.style.fontWeight="normal",b.style.height="auto",b.style.marginBottom=0,b.style.marginLeft="5px",b.style.padding="0 0 0 3px",b.style.width="auto",b},getSwitcherOptions:function(a){return a.getElementsByTagName("option")},setSwitcherOptions:function(a,b,c){this.setSelectOptions(a,b,c)},setSelectOptions:function(a,b,c){c=c||[],a.innerHTML="";for(var d=0;d'),a.errmsg=a.parentNode.getElementsByClassName("error")[0]),a.errmsg.textContent=b)},removeInputError:function(a){a.errmsg&&(a.group.className=a.group.className.replace(/ error/g,""),a.errmsg.style.display="none")},getProgressBar:function(){var a=document.createElement("div");a.className="progress";var b=document.createElement("span");return b.className="meter",b.style.width="0%",a.appendChild(b),a},updateProgressBar:function(a,b){a&&(a.firstChild.style.width=b+"%")},updateProgressBarUnknown:function(a){a&&(a.firstChild.style.width="100%")}}), +// Foundation 3 Specific Theme +f.defaults.themes.foundation3=f.defaults.themes.foundation.extend({getHeaderButtonHolder:function(){var a=this._super();return a.style.fontSize=".6em",a},getFormInputLabel:function(a){var b=this._super(a);return b.style.fontWeight="bold",b},getTabHolder:function(){var a=document.createElement("div");return a.className="row",a.innerHTML="
    ",a},setGridColumnSize:function(a,b){var c=["zero","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve"];a.className="columns "+c[b]},getTab:function(a){var b=document.createElement("dd"),c=document.createElement("a");return c.setAttribute("href","#"),c.appendChild(a),b.appendChild(c),b},getTabContentHolder:function(a){return a.children[1]},getTabContent:function(){var a=document.createElement("div");return a.className="content active",a.style.paddingLeft="5px",a},markTabActive:function(a){a.className+=" active"},markTabInactive:function(a){a.className=a.className.replace(/\s*active/g,"")},addTab:function(a,b){a.children[0].appendChild(b)}}), +// Foundation 4 Specific Theme +f.defaults.themes.foundation4=f.defaults.themes.foundation.extend({getHeaderButtonHolder:function(){var a=this._super();return a.style.fontSize=".6em",a},setGridColumnSize:function(a,b){a.className="columns large-"+b},getFormInputDescription:function(a){var b=this._super(a);return b.style.fontSize=".8rem",b},getFormInputLabel:function(a){var b=this._super(a);return b.style.fontWeight="bold",b}}), +// Foundation 5 Specific Theme +f.defaults.themes.foundation5=f.defaults.themes.foundation.extend({getFormInputDescription:function(a){var b=this._super(a);return b.style.fontSize=".8rem",b},setGridColumnSize:function(a,b){a.className="columns medium-"+b},getButton:function(a,b,c){var d=this._super(a,b,c);return d.className=d.className.replace(/\s*small/g,"")+" tiny",d},getTabHolder:function(){var a=document.createElement("div");return a.innerHTML="
    ",a},getTab:function(a){var b=document.createElement("dd"),c=document.createElement("a");return c.setAttribute("href","#"),c.appendChild(a),b.appendChild(c),b},getTabContentHolder:function(a){return a.children[1]},getTabContent:function(){var a=document.createElement("div");return a.className="content active",a.style.paddingLeft="5px",a},markTabActive:function(a){a.className+=" active"},markTabInactive:function(a){a.className=a.className.replace(/\s*active/g,"")},addTab:function(a,b){a.children[0].appendChild(b)}}),f.defaults.themes.foundation6=f.defaults.themes.foundation5.extend({getIndentedPanel:function(){var a=document.createElement("div");return a.className="callout secondary",a},getButtonHolder:function(){var a=document.createElement("div");return a.className="button-group tiny",a.style.marginBottom=0,a},getFormInputLabel:function(a){var b=this._super(a);return b.style.display="block",b},getFormControl:function(a,b,c){var d=document.createElement("div");return d.className="form-control",a&&d.appendChild(a),"checkbox"===b.type?a.insertBefore(b,a.firstChild):a?a.appendChild(b):d.appendChild(b),c&&a.appendChild(c),d},addInputError:function(a,b){if(a.group){if(a.group.className+=" error",a.errmsg)a.errmsg.style.display="",a.className="";else{var c=document.createElement("span");c.className="form-error is-visible",a.group.getElementsByTagName("label")[0].appendChild(c),a.className=a.className+" is-invalid-input",a.errmsg=c}a.errmsg.textContent=b}},removeInputError:function(a){a.errmsg&&(a.className=a.className.replace(/ is-invalid-input/g,""),a.errmsg.parentNode&&a.errmsg.parentNode.removeChild(a.errmsg))}}),f.defaults.themes.html=f.AbstractTheme.extend({getFormInputLabel:function(a){var b=this._super(a);return b.style.display="block",b.style.marginBottom="3px",b.style.fontWeight="bold",b},getFormInputDescription:function(a){var b=this._super(a);return b.style.fontSize=".8em",b.style.margin=0,b.style.display="inline-block",b.style.fontStyle="italic",b},getIndentedPanel:function(){var a=this._super();return a.style.border="1px solid #ddd",a.style.padding="5px",a.style.margin="5px",a.style.borderRadius="3px",a},getChildEditorHolder:function(){var a=this._super();return a.style.marginBottom="8px",a},getHeaderButtonHolder:function(){var a=this.getButtonHolder();return a.style.display="inline-block",a.style.marginLeft="10px",a.style.fontSize=".8em",a.style.verticalAlign="middle",a},getTable:function(){var a=this._super();return a.style.borderBottom="1px solid #ccc",a.style.marginBottom="5px",a},addInputError:function(a,b){if(a.style.borderColor="red",a.errmsg)a.errmsg.style.display="block";else{var c=this.closest(a,".form-control");a.errmsg=document.createElement("div"),a.errmsg.setAttribute("class","errmsg"),a.errmsg.style=a.errmsg.style||{},a.errmsg.style.color="red",c.appendChild(a.errmsg)}a.errmsg.innerHTML="",a.errmsg.appendChild(document.createTextNode(b))},removeInputError:function(a){a.style.borderColor="",a.errmsg&&(a.errmsg.style.display="none")},getProgressBar:function(){var a=100,b=0,c=document.createElement("progress");return c.setAttribute("max",a),c.setAttribute("value",b),c},updateProgressBar:function(a,b){a&&a.setAttribute("value",b)},updateProgressBarUnknown:function(a){a&&a.removeAttribute("value")}}),f.defaults.themes.jqueryui=f.AbstractTheme.extend({getTable:function(){var a=this._super();return a.setAttribute("cellpadding",5),a.setAttribute("cellspacing",0),a},getTableHeaderCell:function(a){var b=this._super(a);return b.className="ui-state-active",b.style.fontWeight="bold",b},getTableCell:function(){var a=this._super();return a.className="ui-widget-content",a},getHeaderButtonHolder:function(){var a=this.getButtonHolder();return a.style.marginLeft="10px",a.style.fontSize=".6em",a.style.display="inline-block",a},getFormInputDescription:function(a){var b=this.getDescription(a);return b.style.marginLeft="10px",b.style.display="inline-block",b},getFormControl:function(a,b,c){var d=this._super(a,b,c);return"checkbox"===b.type?(d.style.lineHeight="25px",d.style.padding="3px 0"):d.style.padding="4px 0 8px 0",d},getDescription:function(a){var b=document.createElement("span");return b.style.fontSize=".8em",b.style.fontStyle="italic",b.textContent=a,b},getButtonHolder:function(){var a=document.createElement("div");return a.className="ui-buttonset",a.style.fontSize=".7em",a},getFormInputLabel:function(a){var b=document.createElement("label");return b.style.fontWeight="bold",b.style.display="block",b.textContent=a,b},getButton:function(a,b,c){var d=document.createElement("button");d.className="ui-button ui-widget ui-state-default ui-corner-all", +// Icon only +b&&!a?(d.className+=" ui-button-icon-only",b.className+=" ui-button-icon-primary ui-icon-primary",d.appendChild(b)):b?(d.className+=" ui-button-text-icon-primary",b.className+=" ui-button-icon-primary ui-icon-primary",d.appendChild(b)):d.className+=" ui-button-text-only";var e=document.createElement("span");return e.className="ui-button-text",e.textContent=a||c||".",d.appendChild(e),d.setAttribute("title",c),d},setButtonText:function(a,b,c,d){a.innerHTML="",a.className="ui-button ui-widget ui-state-default ui-corner-all", +// Icon only +c&&!b?(a.className+=" ui-button-icon-only",c.className+=" ui-button-icon-primary ui-icon-primary",a.appendChild(c)):c?(a.className+=" ui-button-text-icon-primary",c.className+=" ui-button-icon-primary ui-icon-primary",a.appendChild(c)):a.className+=" ui-button-text-only";var e=document.createElement("span");e.className="ui-button-text",e.textContent=b||d||".",a.appendChild(e),a.setAttribute("title",d)},getIndentedPanel:function(){var a=document.createElement("div");return a.className="ui-widget-content ui-corner-all",a.style.padding="1em 1.4em",a.style.marginBottom="20px",a},afterInputReady:function(a){a.controls||(a.controls=this.closest(a,".form-control"))},addInputError:function(a,b){a.controls&&(a.errmsg?a.errmsg.style.display="":(a.errmsg=document.createElement("div"),a.errmsg.className="ui-state-error",a.controls.appendChild(a.errmsg)),a.errmsg.textContent=b)},removeInputError:function(a){a.errmsg&&(a.errmsg.style.display="none")},markTabActive:function(a){a.className=a.className.replace(/\s*ui-widget-header/g,"")+" ui-state-active"},markTabInactive:function(a){a.className=a.className.replace(/\s*ui-state-active/g,"")+" ui-widget-header"}}),f.defaults.themes.barebones=f.AbstractTheme.extend({getFormInputLabel:function(a){var b=this._super(a);return b},getFormInputDescription:function(a){var b=this._super(a);return b},getIndentedPanel:function(){var a=this._super();return a},getChildEditorHolder:function(){var a=this._super();return a},getHeaderButtonHolder:function(){var a=this.getButtonHolder();return a},getTable:function(){var a=this._super();return a},addInputError:function(a,b){if(a.errmsg)a.errmsg.style.display="block";else{var c=this.closest(a,".form-control");a.errmsg=document.createElement("div"),a.errmsg.setAttribute("class","errmsg"),c.appendChild(a.errmsg)}a.errmsg.innerHTML="",a.errmsg.appendChild(document.createTextNode(b))},removeInputError:function(a){a.style.borderColor="",a.errmsg&&(a.errmsg.style.display="none")},getProgressBar:function(){var a=100,b=0,c=document.createElement("progress");return c.setAttribute("max",a),c.setAttribute("value",b),c},updateProgressBar:function(a,b){a&&a.setAttribute("value",b)},updateProgressBarUnknown:function(a){a&&a.removeAttribute("value")}}),f.AbstractIconLib=a.extend({mapping:{collapse:"",expand:"","delete":"",edit:"",add:"",cancel:"",save:"",moveup:"",movedown:""},icon_prefix:"",getIconClass:function(a){return this.mapping[a]?this.icon_prefix+this.mapping[a]:null},getIcon:function(a){var b=this.getIconClass(a);if(!b)return null;var c=document.createElement("i");return c.className=b,c}}),f.defaults.iconlibs.bootstrap2=f.AbstractIconLib.extend({mapping:{collapse:"chevron-down",expand:"chevron-up","delete":"trash",edit:"pencil",add:"plus",cancel:"ban-circle",save:"ok",moveup:"arrow-up",movedown:"arrow-down"},icon_prefix:"icon-"}),f.defaults.iconlibs.bootstrap3=f.AbstractIconLib.extend({mapping:{collapse:"chevron-down",expand:"chevron-right","delete":"remove",edit:"pencil",add:"plus",cancel:"floppy-remove",save:"floppy-saved",moveup:"arrow-up",movedown:"arrow-down"},icon_prefix:"glyphicon glyphicon-"}),f.defaults.iconlibs.fontawesome3=f.AbstractIconLib.extend({mapping:{collapse:"chevron-down",expand:"chevron-right","delete":"remove",edit:"pencil",add:"plus",cancel:"ban-circle",save:"save",moveup:"arrow-up",movedown:"arrow-down"},icon_prefix:"icon-"}),f.defaults.iconlibs.fontawesome4=f.AbstractIconLib.extend({mapping:{collapse:"caret-square-o-down",expand:"caret-square-o-right","delete":"times",edit:"pencil",add:"plus",cancel:"ban",save:"save",moveup:"arrow-up",movedown:"arrow-down"},icon_prefix:"fa fa-"}),f.defaults.iconlibs.foundation2=f.AbstractIconLib.extend({mapping:{collapse:"minus",expand:"plus","delete":"remove",edit:"edit",add:"add-doc",cancel:"error",save:"checkmark",moveup:"up-arrow",movedown:"down-arrow"},icon_prefix:"foundicon-"}),f.defaults.iconlibs.foundation3=f.AbstractIconLib.extend({mapping:{collapse:"minus",expand:"plus","delete":"x",edit:"pencil",add:"page-add",cancel:"x-circle",save:"save",moveup:"arrow-up",movedown:"arrow-down"},icon_prefix:"fi-"}),f.defaults.iconlibs.jqueryui=f.AbstractIconLib.extend({mapping:{collapse:"triangle-1-s",expand:"triangle-1-e","delete":"trash",edit:"pencil",add:"plusthick",cancel:"closethick",save:"disk",moveup:"arrowthick-1-n",movedown:"arrowthick-1-s"},icon_prefix:"ui-icon ui-icon-"}),f.defaults.templates["default"]=function(){return{compile:function(a){var b=a.match(/{{\s*([a-zA-Z0-9\-_ \.]+)\s*}}/g),c=b&&b.length; +// Shortcut if the template contains no variables +if(!c)return function(){return a};for(var d=[],e=function(a){var c,e=b[a].replace(/[{}]+/g,"").trim().split("."),f=e.length;if(f>1){var g;c=function(b){for(g=b,a=0;a=0){ +// For enumerated strings, number, or integers +if(a.items["enum"])return"multiselect";if(f.plugins.selectize.enable&&"string"===a.items.type)return"arraySelectize"}}), +// Use the multiple editor for schemas with `oneOf` set +f.defaults.resolvers.unshift(function(a){ +// If this schema uses `oneOf` or `anyOf` +if(a.oneOf||a.anyOf)return"multiple"}),/** + * This is a small wrapper for using JSON Editor like a typical jQuery plugin. + */ +function(){if(window.jQuery||window.Zepto){var a=window.jQuery||window.Zepto;a.jsoneditor=f.defaults,a.fn.jsoneditor=function(a){var b=this,c=this.data("jsoneditor");if("value"===a){if(!c)throw"Must initialize jsoneditor before getting/setting the value"; +// Set value +if(!(arguments.length>1))return c.getValue();c.setValue(arguments[1])}else{if("validate"===a){if(!c)throw"Must initialize jsoneditor before validating"; +// Validate a specific value +// Validate a specific value +return arguments.length>1?c.validate(arguments[1]):c.validate()}"destroy"===a?c&&(c.destroy(),this.data("jsoneditor",null)):( +// Destroy first +c&&c.destroy(), +// Create editor +c=new f(this.get(0),a),this.data("jsoneditor",c), +// Setup event listeners +c.on("change",function(){b.trigger("change")}),c.on("ready",function(){b.trigger("ready")}))}return this}}}(),window.JSONEditor=f}(); +//# sourceMappingURL=jsoneditor.min.js.map \ No newline at end of file diff --git a/assets/webconfig/js/lib/jsoneditor.min.js.map b/assets/webconfig/js/lib/jsoneditor.min.js.map new file mode 100644 index 00000000..2af76a36 --- /dev/null +++ b/assets/webconfig/js/lib/jsoneditor.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["jsoneditor.js"],"names":["Class","initializing","fnTest","test","window","postMessage","extend","prop","this","init","apply","arguments","_super","prototype","name","fn","tmp","ret","constructor","CustomEvent","event","params","bubbles","cancelable","detail","undefined","evt","document","createEvent","initCustomEvent","Event","lastTime","vendors","x","length","requestAnimationFrame","cancelAnimationFrame","callback","element","currTime","Date","getTime","timeToCall","Math","max","id","setTimeout","clearTimeout","Array","isArray","arg","Object","toString","call","$isplainobject","obj","nodeType","hasOwnProperty","$extend","destination","source","i","property","$each","keys","$trigger","el","e","initEvent","dispatchEvent","JSONEditor","options","Element","Error","defaults","self","ready","theme_class","themes","theme","schema","template","refs","uuid","__data","icon_class","iconlibs","iconlib","root_container","getContainer","appendChild","translate","_loadExternalRefs","_getDefinitions","validator_options","custom_validators","validator","Validator","editor_class","getEditorClass","root","createEditor","jsoneditor","required","container","preBuild","build","postBuild","startval","setValue","validation_results","validate","getValue","showValidationErrors","trigger","value","destroy","destroyed","innerHTML","on","callbacks","push","off","newcallbacks","setOption","option","show_errors","onChange","classname","expandSchema","resolvers","resolver","editors","JSON","stringify","firing_change","compileTemplate","engine","templates","compile","_data","key","hasAttribute","getAttribute","setAttribute","registerEditor","editor","path","unregisterEditor","getEditor","watch","watchlist","unwatch","newlist","notifyWatchers","isEnabled","enable","disable","definitions","_getExternalRefs","merge_refs","newrefs","$ref","substr","j","done","waiting","callback_fired","url","ajax","r","XMLHttpRequest","open","onreadystatechange","readyState","status","console","log","response","parse","responseText","send","expandRefs","ref","decodeURIComponent","extendSchemas","extended","type","disallow","anyOf","dependencies","not","allOf","oneOf","obj1","obj2","val","filter","n","indexOf","concat","reduce","p","c","languages","_validateSchema","valid","errors","stringified","message","required_by_default","oneof_errors","_checkType","multipleOf","divisibleBy","divisor","floor","math","mod","bignumber","equals","Decimal","exclusiveMaximum","maximum","exclusiveMinimum","minimum","maxLength","minLength","pattern","RegExp","items","additionalItems","maxItems","minItems","uniqueItems","seen","maxProperties","minProperties","validated_properties","properties","patternProperties","regex","additionalProperties","no_additional_properties","AbstractEditor","onChildEditorChange","notify","change","parent","bubble","watch_listener","register","unregister","getNumColumns","template_engine","original_schema","formname","replace","form_name_root","split","pop","link_watchers","setContainer","setupWatchListeners","addLinks","getDefault","updateHeaderText","onWatchedFieldChange","watched","vars","watched_values","refreshWatchedFieldValues","path_parts","first","adjusted_path","closest","unshift","shift","join","headerTemplate","header_template","no_link_holder","link_holder","getLinksHolder","links","addLink","getLink","getButton","text","icon","title","btnClass","getIcon","btn","className","setButtonText","button","link","data","holder","mime","mediaType","href","download","getBlockLinkHolder","createElement","image","createImageLink","rel","getBlockLink","media","createMediaLink","textContent","changed","getWatchedFieldValues","header","children","childNodes","nodeValue","getHeaderText","title_only","header_text","getTitle","i0","i1","refreshValue","getChildEditors","parentNode","removeChild","disabled","isRequired","getDisplayText","arr","disp","used","description","format","descripton","inc","getOption","error","string","input","removeAttribute","initial","from_template","serialized","sanitized","sanitize","sceditor_instance","epiceditor","importFile","ace_editor","is_dirty","adjust_height","num","min","ceil","input_type","compact","label","getFormInputLabel","getFormInputDescription","default_format","getTextareaInput","step","getRangeInput","source_code","getFormInputField","input_width","style","width","readOnly","readonly","always_disabled","addEventListener","preventDefault","stopPropagation","input_height","height","expand_height","ch","offsetHeight","scrollHeight","control","getFormControl","afterInputReady","wysiwyg","jQuery","sceditor","plugins","emoticonsEnabled","sceditor_options","blur","remove","html","EpicEditor","epiceditor_container","insertBefore","display","clientSideStorage","load","exportFile","ace","mode","ace_container","position","edit","setTheme","require","getSession","setMode","Mode","unload","previous_error_setting","messages","addInputError","removeInputError","number","integer","object","maxwidth","editjson_button","addproperty_button","hideEditJSON","layoutEditors","row_container","property_order","sort","a","b","ordera","propertyOrder","orderb","rows","property_removed","found","hidden","grid_columns","minh","maxh","biggest","new_width","layout","row","getGridRow","setGridColumnSize","getPropertySchema","matched","cached_editors","object_layout","minwidth","table_row","table","defaultProperties","display_required_only","k","s","addObjectProperty","editor_holder","getTableCell","getHeader","editjson_holder","getModal","editjson_textarea","editjson_save","saveJSON","editjson_cancel","addproperty_holder","addproperty_list","maxHeight","padding","overflowY","overflowX","paddingLeft","addproperty_add","addproperty_input","marginBottom","alert","spacer","clear","getDescription","error_holder","getIndentedPanel","getGridContainer","getGridColumn","title_controls","getHeaderButtonHolder","editjson_controls","addproperty_controls","collapsed","toggle_button","disable_collapse","toggleEditJSON","disable_edit_json","toggleAddProperty","refreshAddProperties","showEditJSON","hideAddProperty","left","offsetLeft","top","offsetTop","editing_json","json","insertPropertyControlUsingPropertyOrder","child","addPropertyCheckbox","checkbox","labelText","getCheckbox","getCheckboxLabel","paddingBottom","paddingTop","marginTop","checked","removeObjectProperty","addproperty_checkboxes","showAddProperty","adding_property","prebuild_only","canHaveAdditionalProperties","getChildEditorHolder","result","remove_empty_properties","disable_properties","can_add","can_remove","num_props","show_modal","my_errors","other_errors","getErrorMessage","addTableRowError","removeTableRowError","array","info","getItemInfo","tabs_holder","add_row_button","remove_all_rows_button","delete_last_row_button","moveup_button","movedown_button","delete_button","row_cache","hide_delete_buttons","disable_array_delete","hide_delete_all_rows_buttons","disable_array_delete_all_rows","hide_delete_last_row_buttons","disable_array_delete_last_row","hide_move_buttons","disable_array_reorder","hide_add_button","disable_array_add","panel","controls","getButtonHolder","row_holder","getTabHolder","getTabContentHolder","active_tab","addControls","refreshTabs","getItemTitle","item_title","getItemSchema","item_info","default","child_editors","getElementEditor","getTabContent","array_controls","empty","hard","tab","destroyRow","getMax","Infinity","refresh_headers","tab_text","markTabActive","markTabInactive","slice","addRow","new_active_tab","force","oldi","controls_needed","getTab","addTab","controls_holder","newval","row_holder_display","controls_display","tabs","textAlign","item_schema","item_default","item_has_child_editors","getTable","thead","getTableHead","header_row","getTableRow","getTableBody","ce","order","th","getTableHeaderCell","controls_header_cell","getItemDefault","ignore","schema_copy","controls_cell","table_controls","margin","numrows_changed","refreshRowButtons","need_row_buttons","multiple","switcher","switchEditor","buildChildEditor","current_value","keep_values","refreshHeaderText","types","switcher_options","validators","keep_oneof_values","allowed_types","display_text","getSwitcher","getSwitcherOptions","check_part","check","new_errors","new_error","enum_titles","selected","select_options","html_values","getHTML","display_area","hide_display","select","typecast","enum_values","enum_options","select2","longest_text","enum_display","enumSource","enumValue","getSelectInput","setSelectOptions","onInputChange","new_val","setupSelect2","select2_options","select_titles","new_items","item","item_titles","item_values","prev_value","selectize","addItem","setupSelectize","selectize_options","create","updateSelectizeOptions","selectized","clearOptions","addOption","unlock","lock","multiselect","select_values","items_schema","t","option_keys","option_titles","inputs","getMultiCheckboxHolder","size","new_value","updateValue","base64","FileReader","uploader","files","fr","onload","target","refreshPreview","readAsDataURL","preview","last_preview","match","img","maxWidth","src","upload","preview_value","file","uploadButton","getProgressBar","progressBar","success","failure","updateProgress","progress","updateProgressBar","updateProgressBarUnknown","arraySelectize","group","delimiter","createOnBlur","forEach","matchKey","elem","documentElement","matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","AbstractTheme","getFloatRightLinkHolder","cssFloat","marginLeft","backgroundColor","border","boxShadow","zIndex","createTextNode","disableHeader","color","disableLabel","enableHeader","enableLabel","fontWeight","marginRight","fontStyle","getElementsByTagName","setSwitcherOptions","titles","boxSizing","firstChild","borderLeft","getCheckboxDescription","applyStyles","styles","selector","span","borderWidth","lineHeight","borderRadius","borderBottomRightRadius","borderTopRightRadius","cursor","tab_holder","opacity","background","bootstrap2","controlgroup","errmsg","bar","bootstrap3","fontSize","start","percentage","foundation","minWidth","paddingRight","verticalAlign","insertAdjacentHTML","getElementsByClassName","meter","foundation3","sizes","foundation4","foundation5","foundation6","errorEl","borderBottom","borderColor","jqueryui","barebones","AbstractIconLib","mapping","collapse","expand","delete","add","cancel","save","moveup","movedown","icon_prefix","getIconClass","iconclass","fontawesome3","fontawesome4","foundation2","l","replacements","get_replacement","func","trim","cur","ejs","EJS","compiled","context","render","handlebars","Handlebars","hogan","Hogan","markup","Mark","up","mustache","Mustache","view","swig","underscore","_","variables","lang","language","default_language","en","error_notset","error_notempty","error_enum","error_anyOf","error_oneOf","error_not","error_type_union","error_type","error_disallow_union","error_disallow","error_multipleOf","error_maximum_excl","error_maximum_incl","error_minimum_excl","error_minimum_incl","error_maxLength","error_minLength","error_pattern","error_additionalItems","error_maxItems","error_minItems","error_uniqueItems","error_maxProperties","error_minProperties","error_required","error_additional_properties","error_dependency","button_delete_all","button_delete_all_title","button_delete_last","button_delete_last_title","button_add_row_title","button_move_down_title","button_move_up_title","button_delete_row_title","button_delete_row_title_short","button_collapse","button_expand","binaryEncoding","Zepto","$","get"],"mappings":";;;;;;;;;CAWA;;;;;;AAQA,GAAIA,IACJ,WACE,GAAIC,IAAe,EAAOC,EAAS,MAAMC,KAAK,WAAWC,OAAOC,YAAY,SAAY,aAAe;;;AA0DvG,MAvDAL,GAAQ,aAGRA,EAAMM,OAAS,QAASA,GAAOC;;AAkC7B,QAASP;;CAEDC,GAAgBO,KAAKC,MACzBD,KAAKC,KAAKC,MAAMF,KAAMG,WApC1B,GAAIC,GAASJ,KAAKK;;;AAIlBZ,GAAe,CACf,IAAIY,GAAY,GAAIL,KACpBP,IAAe;;AAGf,IAAK,GAAIa,KAAQP;;AAEfM,EAAUC,GAA6B,kBAAdP,GAAKO,IACL,kBAAhBF,GAAOE,IAAuBZ,EAAOC,KAAKI,EAAKO,IACtD,SAAUA,EAAMC,GACd,MAAO,YACL,GAAIC,GAAMR,KAAKI;;;AAIfJ,KAAKI,OAASA,EAAOE;;;AAIrB,GAAIG,GAAMF,EAAGL,MAAMF,K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AO6G,MAAO,MAAO;;;AAM1C,WACE,GAAGzL,OAAOgY,QAAUhY,OAAOw2B,MAAO,CAChC,GAAIC,GAAIz2B,OAAOgY,QAAUhY,OAAOw2B,KAChCC,GAAEvwB,WAAahC,EAAWI,SAE1BmyB,EAAE91B,GAAGuF,WAAa,SAAS/B,GACzB,GAAII,GAAOnE,KACP0I,EAAS1I,KAAKkS,KAAK,aACvB,IAAe,UAAZnO,EAAqB,CACtB,IAAI2E,EAAQ,KAAM;;AAGlB,KAAGvI,UAAUuB,OAAS,GAKpB,MAAOgH,GAAOlC,UAJdkC,GAAOrC,SAASlG,UAAU,QAOzB,CAAA,GAAe,aAAZ4D,EAAwB,CAC9B,IAAI2E,EAAQ,KAAM;;;AAGlB,MAAGvI,WAAUuB,OAAS,EACbgH,EAAOnC,SAASpG,UAAU,IAI1BuI,EAAOnC,WAGE,YAAZxC,EACH2E,IACDA,EAAO9B,UACP5G,KAAKkS,KAAK,aAAa;;AAKtBxJ,GACDA,EAAO9B;;AAIT8B,EAAS,GAAI5E,GAAW9D,KAAKs2B,IAAI,GAAGvyB,GACpC/D,KAAKkS,KAAK,aAAaxJ;;AAGvBA,EAAO3B,GAAG,SAAS,WACjB5C,EAAKuC,QAAQ,YAEfgC,EAAO3B,GAAG,QAAQ,WAChB5C,EAAKuC,QAAQ,YAIjB,MAAO1G,WAKXJ,OAAOkE,WAAaA","file":"jsoneditor.min.js"} \ No newline at end of file diff --git a/libsrc/hyperion/hyperion.schema.json b/libsrc/hyperion/hyperion.schema.json index e0d12260..dd6baa8e 100644 --- a/libsrc/hyperion/hyperion.schema.json +++ b/libsrc/hyperion/hyperion.schema.json @@ -11,6 +11,7 @@ { "level" : { + "type" : "string", "enum" : ["silent", "warn", "verbose", "debug"], "title" : "Log-Level" } From f6a8c8eb01d381fc6af95f4f52fef6b6dccac679 Mon Sep 17 00:00:00 2001 From: brindosch Date: Tue, 30 Aug 2016 23:51:32 +0200 Subject: [PATCH 027/133] Events [skip ci] --- .travis/travis_build.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.travis/travis_build.sh b/.travis/travis_build.sh index f3148e6c..8129a208 100755 --- a/.travis/travis_build.sh +++ b/.travis/travis_build.sh @@ -24,15 +24,20 @@ if [[ -n $TRAVIS_TAG ]]; then cmake -DPLATFORM=x86 -DCMAKE_BUILD_TYPE=Release .. || exit 2 make -j$(nproc) || exit 3 -# Compile hyperion for cron or PR -else - cmake -DPLATFORM=x86-dev -DCMAKE_BUILD_TYPE=Debug .. || exit 4 +# Compile hyperion for cron +elif [[ $TRAVIS_EVENT_TYPE == 'cron' ]]; then + cmake -DPLATFORM=x86 -DCMAKE_BUILD_TYPE=Debug .. || exit 4 make -j$(nproc) || exit 5 + +# Compile for PR +else + cmake -DPLATFORM=x86-dev -DCMAKE_BUILD_TYPE=Debug .. || exit 6 + make -j$(nproc) || exit 7 fi # Build the package on Linux if [[ $TRAVIS_OS_NAME == 'linux' ]]; then - make -j$(nproc) package || exit 6 + make -j$(nproc) package || exit 8 fi From 019e3f5d0c0be3c5cc5b3d384d85321e257de80d Mon Sep 17 00:00:00 2001 From: b1rdhous3 Date: Wed, 31 Aug 2016 00:22:17 +0200 Subject: [PATCH 028/133] New JSON Editor --- assets/webconfig/generalconf.html | 2 +- assets/webconfig/js/hyperion.js | 16 ++++++++-------- libsrc/hyperion/hyperion.schema.json | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/assets/webconfig/generalconf.html b/assets/webconfig/generalconf.html index ce412e67..edba898c 100644 --- a/assets/webconfig/generalconf.html +++ b/assets/webconfig/generalconf.html @@ -90,7 +90,7 @@ - enableFormTranslation("generalConfForm", "generalConfForm"); + enableFormTranslation("generalConfForm", "editor_holder"); $("[type='checkbox']").bootstrapSwitch(); diff --git a/assets/webconfig/js/hyperion.js b/assets/webconfig/js/hyperion.js index 9fc67285..833152ff 100644 --- a/assets/webconfig/js/hyperion.js +++ b/assets/webconfig/js/hyperion.js @@ -12,7 +12,7 @@ * @param {String} formID */ function enableFormTranslation(tokenPrefix, formID) { -var $inputs = $("#" + formID + " :input"); +var $inputs = $("#" + formID + " label"); $inputs.each(function() { console.log("InputID: " + $(this).attr('id')); @@ -34,13 +34,13 @@ function button_reloaddata(){ hyperionport = $("#json_port").val(); loaddata(); }; - + function loaddata() { - + webSocket = new WebSocket('ws://'+document.location.hostname+':'+hyperionport); webSocket.onerror = function(event) { - $('#con_error_modal').modal('show'); + $('#con_error_modal').modal('show'); }; webSocket.onopen = function(event) { @@ -57,12 +57,12 @@ function loaddata() { // get host var hostname = parsedServerInfoJSON.info.hostname; $('#dash_systeminfo').html(hostname+':'+hyperionport); - + $.get( "https://raw.githubusercontent.com/hyperion-project/hyperion.ng/master/version.json", function( data ) { parsedUpdateJSON = JSON.parse(data); latestVersion = parsedUpdateJSON[0].versionnr; cleanLatestVersion = latestVersion.replace(/\./g, ''); - + $('#currentversion').html(' V'+currentVersion); $('#latestversion').html(' V'+latestVersion); @@ -73,6 +73,6 @@ function loaddata() { $('#versioninforesult').html('
    You run the latest version of Hyperion.
    '); } }); - + }; -}; \ No newline at end of file +}; diff --git a/libsrc/hyperion/hyperion.schema.json b/libsrc/hyperion/hyperion.schema.json index dd6baa8e..37bafee6 100644 --- a/libsrc/hyperion/hyperion.schema.json +++ b/libsrc/hyperion/hyperion.schema.json @@ -826,7 +826,7 @@ "port" : { "type" : "integer", - "description" : "Port", + "title" : "Port", "required" : true } }, From a6df8aef0db86911fe0698e358c317028ff62526 Mon Sep 17 00:00:00 2001 From: b1rdhous3 Date: Wed, 31 Aug 2016 00:28:07 +0200 Subject: [PATCH 029/133] Disabled Form Translatation since this isn't working with new JSON Editor looking for an other way --- assets/webconfig/generalconf.html | 24 ------------------------ assets/webconfig/js/hyperion.js | 4 ++-- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/assets/webconfig/generalconf.html b/assets/webconfig/generalconf.html index edba898c..fb545377 100644 --- a/assets/webconfig/generalconf.html +++ b/assets/webconfig/generalconf.html @@ -68,30 +68,6 @@ }); - /*$('form').jsonForm({ - schema: { - logger, - jsonServer, - protoServer, - boblightServer, - udpListener, - webConfig, - - }, - onSubmit: function (errors, values) { - if (errors) { - console.log(errors); - } - else { - console.log(values); - } - } - });*/ - - - - enableFormTranslation("generalConfForm", "editor_holder"); - $("[type='checkbox']").bootstrapSwitch(); diff --git a/assets/webconfig/js/hyperion.js b/assets/webconfig/js/hyperion.js index 833152ff..938ef4a9 100644 --- a/assets/webconfig/js/hyperion.js +++ b/assets/webconfig/js/hyperion.js @@ -10,7 +10,7 @@ * Default language in "lang" attribute will always be "en" * @param {String} tokenPrefix * @param {String} formID -*/ + function enableFormTranslation(tokenPrefix, formID) { var $inputs = $("#" + formID + " label"); @@ -20,7 +20,7 @@ $inputs.each(function() { $("label[for='" + $(this).attr('id') + "']").html('' + oldtext + ''); }); } - +*/ // global vars var currentVersion; var cleanCurrentVersion; From b6cec245966ccb9820b640399369e13f98e0a680 Mon Sep 17 00:00:00 2001 From: b1rdhous3 Date: Wed, 31 Aug 2016 00:46:39 +0200 Subject: [PATCH 030/133] Update --- assets/webconfig/generalconf.html | 3 ++- libsrc/hyperion/hyperion.schema.json | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/assets/webconfig/generalconf.html b/assets/webconfig/generalconf.html index fb545377..3c387a91 100644 --- a/assets/webconfig/generalconf.html +++ b/assets/webconfig/generalconf.html @@ -7,8 +7,9 @@
    - +
    +
    diff --git a/libsrc/hyperion/hyperion.schema.json b/libsrc/hyperion/hyperion.schema.json index 37bafee6..fcefe960 100644 --- a/libsrc/hyperion/hyperion.schema.json +++ b/libsrc/hyperion/hyperion.schema.json @@ -744,6 +744,7 @@ "enable" : { "type" : "boolean", + "format": "checkbox", "title" : "Activate" }, "port" : @@ -771,6 +772,7 @@ "enable" : { "type" : "boolean", + "format": "checkbox", "title" : "Activate" }, "address" : @@ -799,6 +801,7 @@ "shared" : { "type" : "boolean", + "format": "checkbox", "title" : "Shared" } }, @@ -814,6 +817,7 @@ "enable" : { "type" : "boolean", + "format": "checkbox", "title" : "Activate", "required" : true }, From 9a2b167db73eaf64171c39b20e84b9178c75d40d Mon Sep 17 00:00:00 2001 From: redpanther Date: Wed, 31 Aug 2016 00:54:47 +0200 Subject: [PATCH 031/133] fix typo in config spilt grabber components in "GRABBER" and "V4L" --- config/hyperion.config.json.commented | 2 +- config/hyperion.config.json.default | 2 +- include/hyperion/GrabberWrapper.h | 3 ++- include/utils/Components.h | 5 ++++- libsrc/grabber/v4l2/V4L2Wrapper.cpp | 2 +- libsrc/hyperion/GrabberWrapper.cpp | 5 +++-- libsrc/jsonserver/schema/schema-componentstate.json | 2 +- src/hyperion-remote/hyperion-remote.cpp | 4 ++-- 8 files changed, 15 insertions(+), 10 deletions(-) diff --git a/config/hyperion.config.json.commented b/config/hyperion.config.json.commented index 0734e54c..34266542 100644 --- a/config/hyperion.config.json.commented +++ b/config/hyperion.config.json.commented @@ -188,7 +188,7 @@ "greenSignalThreshold" : 0.0, "blueSignalThreshold" : 0.0 } - ] + ], /// The configuration for the frame-grabber, contains the following items: /// * enable : true if the framegrabber (platform grabber) should be activated diff --git a/config/hyperion.config.json.default b/config/hyperion.config.json.default index 1c406fb0..c5758253 100644 --- a/config/hyperion.config.json.default +++ b/config/hyperion.config.json.default @@ -117,7 +117,7 @@ "greenSignalThreshold" : 0.0, "blueSignalThreshold" : 0.0 } - ] + ], "framegrabber" : { diff --git a/include/hyperion/GrabberWrapper.h b/include/hyperion/GrabberWrapper.h index e6459899..fd8ef327 100644 --- a/include/hyperion/GrabberWrapper.h +++ b/include/hyperion/GrabberWrapper.h @@ -15,7 +15,7 @@ class GrabberWrapper : public QObject { Q_OBJECT public: - GrabberWrapper(std::string grabberName, const int priority); + GrabberWrapper(std::string grabberName, const int priority, hyperion::Components grabberComponentId=hyperion::COMP_GRABBER); virtual ~GrabberWrapper(); @@ -72,4 +72,5 @@ protected: /// The processor for transforming images to led colors ImageProcessor * _processor; + hyperion::Components _grabberComponentId; }; diff --git a/include/utils/Components.h b/include/utils/Components.h index b865d249..52729b89 100644 --- a/include/utils/Components.h +++ b/include/utils/Components.h @@ -15,7 +15,8 @@ enum Components COMP_FORWARDER, COMP_UDPLISTENER, COMP_BOBLIGHTSERVER, - COMP_GRABBER + COMP_GRABBER, + COMP_V4L }; inline const char* componentToString(Components c) @@ -29,6 +30,7 @@ inline const char* componentToString(Components c) case COMP_UDPLISTENER: return "UDP listener"; case COMP_BOBLIGHTSERVER:return "Boblight server"; case COMP_GRABBER: return "Framegrabber"; + case COMP_V4L: return "V4l Capture device"; default: return ""; } } @@ -43,6 +45,7 @@ inline Components stringToComponent(QString component) if (component == "UDPLISTENER") return COMP_UDPLISTENER; if (component == "BOBLIGHTSERVER")return COMP_BOBLIGHTSERVER; if (component == "GRABBER") return COMP_GRABBER; + if (component == "V4L") return COMP_V4L; return COMP_INVALID; } diff --git a/libsrc/grabber/v4l2/V4L2Wrapper.cpp b/libsrc/grabber/v4l2/V4L2Wrapper.cpp index cdae5ea8..423cc793 100644 --- a/libsrc/grabber/v4l2/V4L2Wrapper.cpp +++ b/libsrc/grabber/v4l2/V4L2Wrapper.cpp @@ -16,7 +16,7 @@ V4L2Wrapper::V4L2Wrapper(const std::string &device, double greenSignalThreshold, double blueSignalThreshold, const int priority) - : GrabberWrapper("V4L2:"+device, priority) + : GrabberWrapper("V4L2:"+device, priority, hyperion::COMP_V4L) , _timeout_ms(1000) , _grabber(device, input, diff --git a/libsrc/hyperion/GrabberWrapper.cpp b/libsrc/hyperion/GrabberWrapper.cpp index c75fa942..989b9716 100644 --- a/libsrc/hyperion/GrabberWrapper.cpp +++ b/libsrc/hyperion/GrabberWrapper.cpp @@ -4,7 +4,7 @@ #include -GrabberWrapper::GrabberWrapper(std::string grabberName, const int priority) +GrabberWrapper::GrabberWrapper(std::string grabberName, const int priority, hyperion::Components grabberComponentId) : _grabberName(grabberName) , _hyperion(Hyperion::getInstance()) , _priority(priority) @@ -12,6 +12,7 @@ GrabberWrapper::GrabberWrapper(std::string grabberName, const int priority) , _log(Logger::getInstance(grabberName.c_str())) , _forward(true) , _processor(ImageProcessorFactory::getInstance().newImageProcessor()) + , _grabberComponentId(grabberComponentId) { _timer.setSingleShot(false); @@ -44,7 +45,7 @@ void GrabberWrapper::stop() void GrabberWrapper::componentStateChanged(const hyperion::Components component, bool enable) { - if (component == hyperion::COMP_GRABBER && _timer.isActive() != enable) + if (component == _grabberComponentId && _timer.isActive() != enable) { if (enable) start(); else stop(); diff --git a/libsrc/jsonserver/schema/schema-componentstate.json b/libsrc/jsonserver/schema/schema-componentstate.json index 3a0dfabd..28a8a362 100644 --- a/libsrc/jsonserver/schema/schema-componentstate.json +++ b/libsrc/jsonserver/schema/schema-componentstate.json @@ -21,7 +21,7 @@ "component": { "type" : "string", - "enum" : ["SMOOTHING", "BLACKBORDER", "KODICHECKER", "FORWARDER", "UDPLISTENER", "BOBLIGHTSERVER", "GRABBER"], + "enum" : ["SMOOTHING", "BLACKBORDER", "KODICHECKER", "FORWARDER", "UDPLISTENER", "BOBLIGHTSERVER", "GRABBER", "V4L"], "required": true }, "state": diff --git a/src/hyperion-remote/hyperion-remote.cpp b/src/hyperion-remote/hyperion-remote.cpp index a5aaa669..2f0c3cff 100644 --- a/src/hyperion-remote/hyperion-remote.cpp +++ b/src/hyperion-remote/hyperion-remote.cpp @@ -65,8 +65,8 @@ int main(int argc, char * argv[]) BooleanOption & argServerInfo = parser.add ('l', "list" , "List server info and active effects with priority and duration"); BooleanOption & argClear = parser.add ('x', "clear" , "Clear data for the priority channel provided by the -p option"); BooleanOption & argClearAll = parser.add (0x0, "clearall" , "Clear data for all active priority channels"); - Option & argEnableComponent = parser.add
    +
    +
    + + + + diff --git a/assets/webconfig/kodiconf.html b/assets/webconfig/content/kodiconf.html similarity index 100% rename from assets/webconfig/kodiconf.html rename to assets/webconfig/content/kodiconf.html diff --git a/assets/webconfig/lighttest.html b/assets/webconfig/content/lighttest.html similarity index 63% rename from assets/webconfig/lighttest.html rename to assets/webconfig/content/lighttest.html index 76829aac..b93d6d6e 100644 --- a/assets/webconfig/lighttest.html +++ b/assets/webconfig/content/lighttest.html @@ -1,7 +1,7 @@
    -
    -
    -

    Colors

    +
    +
    +

    Colors

    Set color:
    @@ -25,12 +25,13 @@ $('#cp2').colorpicker({ format: 'rgb', - colorSelectors: {'default': '#777777', + colorSelectors: { + 'default': '#777777', 'primary': '#337ab7', 'success': '#5cb85c', - 'info': '#5bc0de', + 'info' : '#5bc0de', 'warning': '#f0ad4e', - 'danger': '#d9534f' + 'danger' : '#d9534f' }, customClass: 'colorpicker-2x', sliders: { @@ -48,19 +49,10 @@ }); $('#cp2').colorpicker().on('changeColor', function(e) { - //console.log(e.color.toRGB()); - webSocket.send('{"command":"color", "color":['+e.color.toRGB().r+','+e.color.toRGB().g+','+e.color.toRGB().b+'], "priority":1}'); + color = e.color.toRGB(); + requestSetColor(color.r, color.g, color.b); }); }); - - $("#reset_color").on("click", function() { - webSocket.send('{"command":"clear", "priority":1}'); - }); - - - - webSocket.onmessage = function(event){ - console.log(event.data); - } + $("#reset_color").on("click", requestPriorityClear); diff --git a/assets/webconfig/content/remote_components.html b/assets/webconfig/content/remote_components.html new file mode 100644 index 00000000..e8a5765b --- /dev/null +++ b/assets/webconfig/content/remote_components.html @@ -0,0 +1,26 @@ +
    +
    +
    +

    Effects

    +
    +

    The components remote enables you to disable and enable certain components of Hyperion during runtime. Keep in mind this persist just until the next reboot! To enable/disable components permament, use the configuration section.

    +
    +
    +
    +
    +
    +
    +
    + + diff --git a/assets/webconfig/support.html b/assets/webconfig/content/support.html similarity index 99% rename from assets/webconfig/support.html rename to assets/webconfig/content/support.html index 0d96648b..fce63158 100644 --- a/assets/webconfig/support.html +++ b/assets/webconfig/content/support.html @@ -110,4 +110,4 @@
    -
    \ No newline at end of file +
    diff --git a/assets/webconfig/content/update.html b/assets/webconfig/content/update.html new file mode 100644 index 00000000..853d1e23 --- /dev/null +++ b/assets/webconfig/content/update.html @@ -0,0 +1,23 @@ +
    +
    +
    +

    Update

    +
    +

    This page gives you an overview of all Hyperion versions available. On top you could update or downgrade your version of Hyperion whenever you want. Sorted from newest to oldest

    +
    +
    +

    +
    +
    +
    +
    +
    +
    + + diff --git a/assets/webconfig/effects.html b/assets/webconfig/effects.html deleted file mode 100644 index 917f4e92..00000000 --- a/assets/webconfig/effects.html +++ /dev/null @@ -1,39 +0,0 @@ -
    -
    -
    -

    Effects

    -
    -

    The Effects remote enables you to set an effect for testing or demonstration purposes. Don't forget to stop it afterwards.

    -
    -
    -
    - Stop Effect
    -
    -
    -
    -
    - - diff --git a/assets/webconfig/generalconf.html b/assets/webconfig/generalconf.html deleted file mode 100644 index b0d9fda4..00000000 --- a/assets/webconfig/generalconf.html +++ /dev/null @@ -1,105 +0,0 @@ -
    -
    -
    -

    General

    -
    -

    You can edit the general configuration here.

    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    - - - diff --git a/assets/webconfig/index.html b/assets/webconfig/index.html index 2d82cc24..fcbcd600 100644 --- a/assets/webconfig/index.html +++ b/assets/webconfig/index.html @@ -3,31 +3,32 @@ - - - - + + + + - Hyperion - WebUI + Hyperion - WebUI - + - + + - - + + - - + + - - + + @@ -49,481 +50,279 @@ - - + + - - + + - - + + - - + + - - - + + + -
    +
    - - - - + +
    - - +
    + + +
    @@ -53,9 +54,11 @@ } - $("#create_user_first").on("click", function() { + $("#create_user").on("click", function() { + var connectionRetries = 15; var data = {"devicetype":"hyperion#"+Date.now()}; - $.ajax({ + var UserInterval = setInterval(function(){ + $.ajax({ type: "POST", url: 'http://'+$("#ip").val()+'/api', processData: false, @@ -63,42 +66,39 @@ contentType: 'application/json', data: JSON.stringify(data), success: function(r) { - $("#ip_alert").hide(); - if (typeof r[0].error != 'undefined') { - if (r[0].error.description == "link button not pressed"){ - $('#pairmodal').modal('show') - } - } - }, + connectionRetries--; + $("#connectionTime").html(connectionRetries); + if(connectionRetries == 0) { + abortConnection(UserInterval); + } + else{ + $("#abortConnection").hide(); + $('#pairmodal').modal('show'); + $("#ip_alert").hide(); + if (typeof r[0].error != 'undefined') { + console.log("link not pressed"); + } + if (typeof r[0].success != 'undefined') { + $('#pairmodal').modal('hide'); + $('#user').val(r[0].success.username); + get_hue_lights(); + clearInterval(UserInterval); + } + } + }, error: function(XMLHttpRequest, textStatus, errorThrown) { $("#ip_alert").show(); + clearInterval(UserInterval); } }); + },1000); }); - - $("#create_user_second").on("click", function() { - var data = {"devicetype":"my_hue_app#iphone pet2er"}; - $.ajax({ - type: "POST", - url: 'http://'+$("#ip").val()+'/api', - processData: false, - contentType: 'application/json', - data: JSON.stringify(data), - success: function(r) { - if (typeof r[0].error != 'undefined') { - $("#link_not_pressed").show(); - } - if (typeof r[0].success != 'undefined') { - $('#pairmodal').modal('hide'); - $('#user').val(r[0].success.username); - $("#link_not_pressed").hide(); - get_hue_lights(); - } - } - }); - }); - + function abortConnection(UserInterval){ + clearInterval(UserInterval); + $("#abortConnection").show(); + $('#pairmodal').modal('hide'); + } function get_hue_lights(){ $.ajax({ diff --git a/assets/webconfig/img/hyperion/ring-alt.svg b/assets/webconfig/img/hyperion/ring-alt.svg new file mode 100644 index 00000000..b1844c4e --- /dev/null +++ b/assets/webconfig/img/hyperion/ring-alt.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/webconfig/lang/de.json b/assets/webconfig/lang/de.json index 14ed9307..57735fac 100644 --- a/assets/webconfig/lang/de.json +++ b/assets/webconfig/lang/de.json @@ -32,6 +32,7 @@ "main_menu_system_token" : "System", "main_menu_input_selection_token" : "Eingabeauswahl", "main_menu_general_conf_token":"Allgemein", + "main_menu_leds_conf_token":"LEDs", "remote_colors_label_color":"Farbe: ", "remote_colors_button_reset":"Farbe zurücksetzen", "remote_effects_intro" : "Die Effekt-Fernbedienung ermöglicht es dir Effekte zu starten für Demonstrations- oder Testzwecke. Vergessse nicht den Effekt wieder zu stoppen, wenn du fertig bist.", @@ -39,8 +40,8 @@ "remote_effects_label_stopeffect":"Stoppe Effekte", "remote_components_intro" : "Die Komponenten-Fenbedienung ermöglicht es dir Komponenten von Hyperion zu starten und stoppen. Beachte: Dies ist nur temporär und geht nach einem Neustart verloren. Möchtest du dauerhaft Komponenten aktivieren/deaktivieren benutze die Konfigurationsseiten.", "hue_button_create_user_token":"Benutzer anlegen", - "hue_press_link_modal":"Link Taste auf der Hue Bridge drücken und mit Button bestätigen.", - "hue_press_link_modal_failure":"Bitte drücke die Link Taste auf deiner Hue Bridge.", + "hue_press_link_modal":"Bitte Link Taste auf der Hue Bridge drücken.", + "hue_failure_connection_token":"Connection Timeout. Bitte drücke die Taste rechtzeitig.", "hue_button_pair":"Verbinden", "hue_failure_ip_token":"Bitte überprüfe deine IP Adresse.", "hue_label_username":"Benutzername:", From a6d12611a8452fb86c1d6776014117cddcf055f8 Mon Sep 17 00:00:00 2001 From: redPanther Date: Tue, 6 Sep 2016 10:14:54 +0200 Subject: [PATCH 046/133] webui: enhance led config (#224) * split content and js tune leds config * implement connection lost page * split js/html in huebridge * add js action for connection lost --- assets/webconfig/content/connection_lost.html | 16 ++ assets/webconfig/content/huebridge.html | 115 +++------------ assets/webconfig/content/leds.html | 138 +++++------------- assets/webconfig/css/jquery-linedtextarea.css | 68 +++++++++ assets/webconfig/index.html | 93 ++---------- assets/webconfig/js/content_huebridge.js | 69 +++++++++ assets/webconfig/js/content_index.js | 65 +++++++++ assets/webconfig/js/content_leds.js | 130 +++++++++++++++++ assets/webconfig/js/hyperion.js | 23 ++- .../webconfig/js/lib/jquery-linedtextarea.js | 126 ++++++++++++++++ assets/webconfig/js/ui_utils.js | 21 +++ 11 files changed, 588 insertions(+), 276 deletions(-) create mode 100644 assets/webconfig/content/connection_lost.html create mode 100644 assets/webconfig/css/jquery-linedtextarea.css create mode 100644 assets/webconfig/js/content_huebridge.js create mode 100644 assets/webconfig/js/content_index.js create mode 100644 assets/webconfig/js/content_leds.js create mode 100644 assets/webconfig/js/lib/jquery-linedtextarea.js diff --git a/assets/webconfig/content/connection_lost.html b/assets/webconfig/content/connection_lost.html new file mode 100644 index 00000000..030a3732 --- /dev/null +++ b/assets/webconfig/content/connection_lost.html @@ -0,0 +1,16 @@ +
    +
    + connection lost: reconnect +
    +
    + + + + diff --git a/assets/webconfig/content/huebridge.html b/assets/webconfig/content/huebridge.html index ea44bee2..9ceb9855 100644 --- a/assets/webconfig/content/huebridge.html +++ b/assets/webconfig/content/huebridge.html @@ -1,119 +1,44 @@
    -
    -
    -

    Hue Bridge

    +
    +
    +

    Hue Bridge

    - +
    - - - - -
    - + + + + +
    +

    -
    - -
    +
    - @@ -202,9 +202,10 @@
  • Configuration
  • @@ -237,7 +238,7 @@
    - diff --git a/assets/webconfig/content/huebridge.html b/assets/webconfig/content/huebridge.html deleted file mode 100644 index 9ceb9855..00000000 --- a/assets/webconfig/content/huebridge.html +++ /dev/null @@ -1,44 +0,0 @@ -
    -
    -
    -

    Hue Bridge

    -
    -
    - - -
    - - - - -
    - -
    -
    -
    -
    -
    -
    -
    -
    - - - @@ -122,4 +170,5 @@ start
    + diff --git a/assets/webconfig/content/lighttest.html b/assets/webconfig/content/lighttest.html deleted file mode 100644 index b93d6d6e..00000000 --- a/assets/webconfig/content/lighttest.html +++ /dev/null @@ -1,58 +0,0 @@ -
    -
    -
    -

    Colors

    -
    - Set color: -
    -
    -
    - - -
    -
    -
    - -
    -
    -
    -
    - - - - diff --git a/assets/webconfig/content/remote.html b/assets/webconfig/content/remote.html new file mode 100644 index 00000000..49f4822c --- /dev/null +++ b/assets/webconfig/content/remote.html @@ -0,0 +1,52 @@ +
    +

    Remote Control

    +
    + +
    + +
    +
    +
    +
    +
    Colors / Effects
    +
    + color: +
    + +
    +
    effect:
    + + + +
    +
    +
    + +
    +
    + + +
    +
    +
    +
    +
    Input Selection
    +
    +
    +
    +
    +
    + +
    +
    +
    Components
    +
    +
    +
    +
    +
    +
    +
    +
    + + diff --git a/assets/webconfig/content/remote_components.html b/assets/webconfig/content/remote_components.html deleted file mode 100644 index 2c0542e1..00000000 --- a/assets/webconfig/content/remote_components.html +++ /dev/null @@ -1,71 +0,0 @@ -
    -
    -
    -

    Effects

    -
    -

    The components remote enables you to disable and enable certain components of Hyperion during runtime. Keep in mind this persist just until the next reboot! To enable/disable components permament, use the configuration section.

    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - diff --git a/assets/webconfig/index.html b/assets/webconfig/index.html index 0031d2b4..fe6ca3f7 100644 --- a/assets/webconfig/index.html +++ b/assets/webconfig/index.html @@ -206,21 +206,12 @@
  • Capturing Hardware
  • LED Hardware
  • KODI Connector
  • -
  • Hue Bridge
  • - - -
  • - Remote Control -
  • +
  • Remote Control
  • Support
  • - System + System diff --git a/assets/webconfig/js/content_generalconf.js b/assets/webconfig/js/content_generalconf.js index c3af938a..3daf9d6c 100644 --- a/assets/webconfig/js/content_generalconf.js +++ b/assets/webconfig/js/content_generalconf.js @@ -21,9 +21,7 @@ function removeAdvanced(obj,searchStack) $(hyperion).one("cmd-config-getschema", function(event) { parsedConfSchemaJSON = event.response.result; - // remove all "advanced" options from schema - //removeAdvanced(parsedConfSchemaJSON, []); // not working atm - //console.log(JSON.stringify(parsedConfSchemaJSON)); + schema = parsedConfSchemaJSON.properties; blackborderdetector = schema.blackborderdetector; color = schema.color; @@ -40,7 +38,6 @@ $(hyperion).one("cmd-config-getschema", function(event) { webConfig = schema.webConfig; var element = document.getElementById('editor_holder'); - //JSONEditor.defaults.options.theme = 'bootstrap3'; var general_conf_editor = new JSONEditor(element,{ theme: 'bootstrap3', @@ -70,13 +67,13 @@ $(hyperion).one("cmd-config-getschema", function(event) { }); //Called everytime a Input Field is changed = No need for save button - general_conf_editor.on('change',function() { + general_conf_editor.off().on('change',function() { console.log(JSON.stringify(general_conf_editor.getValue())); requestWriteConfig(general_conf_editor.getValue()); }); //Alternative Function with submit button to get Values - document.getElementById('submit').addEventListener('click',function() { + $('btn_submit').off().on('click',function() { console.log(general_conf_editor.getValue()); }); diff --git a/assets/webconfig/js/content_index.js b/assets/webconfig/js/content_index.js index f7bafe1a..a6d33603 100644 --- a/assets/webconfig/js/content_index.js +++ b/assets/webconfig/js/content_index.js @@ -2,10 +2,7 @@ $(document).ready( function() { loadContentTo("#container_connection_lost","connection_lost"); initWebSocket(); bindNavToContent("#load_dashboard","dashboard",true); - bindNavToContent("#load_lighttest","lighttest",false); - bindNavToContent("#load_effects","effects",false); - bindNavToContent("#load_components","remote_components",false); - bindNavToContent("#load_input_selection","input_selection",false); + bindNavToContent("#load_remote","remote",false); bindNavToContent("#load_huebridge","huebridge",false); bindNavToContent("#load_support","support",false); bindNavToContent("#load_confKodi","kodiconf",false); diff --git a/assets/webconfig/js/content_leds.js b/assets/webconfig/js/content_leds.js index 113ef1db..2c37bede 100644 --- a/assets/webconfig/js/content_leds.js +++ b/assets/webconfig/js/content_leds.js @@ -68,19 +68,19 @@ $(document).ready(function() { }); // ------------------------------------------------------------------ - $('#leds_toggle_num').on("click", function() { + $('#leds_toggle_num').off().on("click", function() { $('.led_num').toggle(); toggleClass('#leds_toggle_num', "btn-danger", "btn-success"); }); // ------------------------------------------------------------------ - $('#leds_toggle').on("click", function() { + $('#leds_toggle').off().on("click", function() { $('.led').toggle(); toggleClass('#leds_toggle', "btn-success", "btn-danger"); }); // ------------------------------------------------------------------ - $('#leds_toggle_live').on("click", function() { + $('#leds_toggle_live').off().on("click", function() { setClassByBool('#leds_toggle_live',ledStreamActive,"btn-success","btn-danger"); if ( ledStreamActive ) { @@ -93,7 +93,7 @@ $(document).ready(function() { }); // ------------------------------------------------------------------ - $("#leds_custom_check").on("click", function() { + $("#leds_custom_check").off().on("click", function() { e = isJsonString($("#ledconfig").val()); if (e.length == 0) @@ -103,11 +103,11 @@ $(document).ready(function() { }); // ------------------------------------------------------------------ - $("#leds_custom_save").on("click", function() { + $("#leds_custom_save").off().on("click", function() { }); - $('#leds_cfg_nav a[data-toggle="tab"]').on('shown.bs.tab', function (e) { + $('#leds_cfg_nav a[data-toggle="tab"]').off().on('shown.bs.tab', function (e) { var target = $(e.target).attr("href") // activated tab if (target == "#menu_gencfg" && !ledsCustomCfgInitialized) { @@ -119,6 +119,17 @@ $(document).ready(function() { } }); + $("#leddevices").off().on("change", function(event) { + if ($(this).val() == "philipshue") + { + $("#huebridge").show(); + } + else + { + $("#huebridge").hide(); + } + }); + requestServerConfig(); }); diff --git a/assets/webconfig/js/content_remote.js b/assets/webconfig/js/content_remote.js new file mode 100644 index 00000000..85fc680e --- /dev/null +++ b/assets/webconfig/js/content_remote.js @@ -0,0 +1,126 @@ + + function updateInputSelect() + { + var data = ""; + var i; + for(i = 0; i < parsedServerInfoJSON.info.priorities.length; i++) { + var owner = parsedServerInfoJSON.info.priorities[i].owner; + var active = parsedServerInfoJSON.info.priorities[i].active; + var visible = parsedServerInfoJSON.info.priorities[i].visible; + var priority = parsedServerInfoJSON.info.priorities[i].priority; + var btn_type = "default"; + if (active) btn_type = "warning"; + if (visible) btn_type = "success"; + + data += '
    '; + } + data += '
    '; + $('#hyperion_inputs').html(data); + + var max_width=200; + $('.btn_input_selection').each(function() { + if ($(this).innerWidth() > max_width) + max_width = $(this).innerWidth(); + }); + $('.btn_input_selection').css("min-width",max_width+"px"); + } + + function updateComponents(event) { + if ($('#componentsbutton').length == 0) + { + $(hyperion).off("cmd-serverinfo",updateComponents); + } + else + { + updateInputSelect(); + components = event.response.info.components; + // create buttons + $('#componentsbutton').html(""); + for ( idx=0; idx'; + enable_style = (components[idx].enabled? "btn-success" : "btn-danger"); + enable_icon = (components[idx].enabled? "fa-play" : "fa-stop"); + comp_name = components[idx].name; + comp_btn_id = "comp_btn_"+comp_name; + + // create btn if not there + if ($("#"+comp_btn_id).length == 0) + { + d='

    '+components[idx].title+'

    '; + $('#componentsbutton').append(d); + } + else // already create, update state + { + setClassByBool( $('#'+comp_btn_id) , components[idx].enabled, "btn-danger", "btn-success" ); + setClassByBool( $('#'+comp_btn_id+"_icon"), components[idx].enabled, "fa-stop" , "fa-play" ); + $('#'+comp_btn_id).attr("onclick",'requestSetComponentState(\''+comp_name+'\','+(!components[idx].enabled)+')'); + } + + } + } +} + + + +$(document).ready(function() { + // color + $(function() { + $('#cp2').colorpicker({ + format: 'rgb', + + colorSelectors: { + 'default': '#777777', + 'primary': '#337ab7', + 'success': '#5cb85c', + 'info' : '#5bc0de', + 'warning': '#f0ad4e', + 'danger' : '#d9534f' + }, + customClass: 'colorpicker-2x', + sliders: { + saturation: { + maxLeft: 200, + maxTop: 200 + }, + hue: { + maxTop: 200 + }, + alpha: { + maxTop: 200 + }, + } + }); + + $('#cp2').colorpicker().on('changeColor', function(e) { + color = e.color.toRGB(); + requestSetColor(color.r, color.g, color.b); + }); + }); + + $("#reset_color").off().on("click", requestPriorityClear); + + $("#effect_select").off().on("change", function(event) { + efx = $(this).val(); + if(efx != "__none__") + { + requestPlayEffect(efx); + } + }); + + // effects + effects_html = ''; + for(i = 0; i < parsedServerInfoJSON.info.effects.length; i++) { + //console.log(parsedServerInfoJSON.info.effects[i].name); + effectName = parsedServerInfoJSON.info.effects[i].name; + effects_html += ''; + } + $('#effect_select').html(effects_html); + + + // components + $(hyperion).on("cmd-serverinfo",updateComponents); + +}); From 2d88cdc2d338573f8f68a17deae83b01d78e3277 Mon Sep 17 00:00:00 2001 From: redPanther Date: Sat, 10 Sep 2016 19:08:08 +0200 Subject: [PATCH 058/133] webui: initial support for leddevice options (#232) * initial support for leddevice options * fix schema and editor init * fix led editor labels and schema * add some led schemas * led config: insert current values. not yet perfect, but it works --- assets/webconfig/content/grabber.html | 2 +- assets/webconfig/content/leds.html | 5 +- assets/webconfig/js/content_grabber.js | 2 +- assets/webconfig/js/content_index.js | 15 +++-- assets/webconfig/js/content_leds.js | 43 ++++++++++++++ include/leddevice/LedDevice.h | 2 + libsrc/hyperion/hyperion.schema.json | 19 +++--- libsrc/jsonserver/JsonClientConnection.cpp | 3 + libsrc/leddevice/LedDevice.cpp | 36 +++++++++++- libsrc/leddevice/LedDeviceSchemas.qrc | 2 +- libsrc/leddevice/LedDeviceSk6812SPI.cpp | 2 +- libsrc/leddevice/schemas/schema-e131.json | 11 +++- .../leddevice/schemas/schema-fadecandy.json | 58 +++++++++++++++++++ libsrc/leddevice/schemas/schema-file.json | 2 +- .../leddevice/schemas/schema-philipshue.json | 2 +- libsrc/leddevice/schemas/schema-udpraw.json | 9 +++ 16 files changed, 191 insertions(+), 22 deletions(-) diff --git a/assets/webconfig/content/grabber.html b/assets/webconfig/content/grabber.html index f8eee33d..982c594f 100644 --- a/assets/webconfig/content/grabber.html +++ b/assets/webconfig/content/grabber.html @@ -10,7 +10,7 @@
    - +
  • diff --git a/assets/webconfig/content/leds.html b/assets/webconfig/content/leds.html index a8a178f8..11792abd 100644 --- a/assets/webconfig/content/leds.html +++ b/assets/webconfig/content/leds.html @@ -49,7 +49,10 @@
    -
    diff --git a/assets/webconfig/js/content_generalconf.js b/assets/webconfig/js/content_generalconf.js index 3daf9d6c..e9d0bd18 100644 --- a/assets/webconfig/js/content_generalconf.js +++ b/assets/webconfig/js/content_generalconf.js @@ -37,17 +37,18 @@ $(hyperion).one("cmd-config-getschema", function(event) { udpListener = schema.udpListener; webConfig = schema.webConfig; - var element = document.getElementById('editor_holder'); + var element = document.getElementById('editor_container'); var general_conf_editor = new JSONEditor(element,{ theme: 'bootstrap3', + iconlib: "fontawesome4", disable_collapse: 'true', form_name_root: 'sa', disable_edit_json: 'true', disable_properties: 'true', no_additional_properties: 'true', schema: { - title:' ', + title:'', properties: { /*blackborderdetector, color, @@ -66,6 +67,12 @@ $(hyperion).one("cmd-config-getschema", function(event) { } }); +// $('#editor_container .well').css("background-color","white"); +// $('#editor_container .well').css("border","none"); +// $('#editor_container .well').css("box-shadow","none"); + $('#editor_container .btn').addClass("btn-primary"); + $('#editor_container h3').first().remove(); + //Called everytime a Input Field is changed = No need for save button general_conf_editor.off().on('change',function() { console.log(JSON.stringify(general_conf_editor.getValue())); diff --git a/assets/webconfig/js/content_grabber.js b/assets/webconfig/js/content_grabber.js index 49495b53..f6d2234b 100644 --- a/assets/webconfig/js/content_grabber.js +++ b/assets/webconfig/js/content_grabber.js @@ -30,19 +30,27 @@ $(hyperion).one("cmd-config-getschema", function(event) { var grabber_conf_editor = new JSONEditor(element,{ theme: 'bootstrap3', + iconlib: "fontawesome4", disable_collapse: 'true', form_name_root: 'sa', disable_edit_json: 'true', disable_properties: 'true', no_additional_properties: 'true', schema: { - title:' ', + title:'', properties: { schema_framegrabber, schema_grabberv4l2, } } }); + + $('#editor_container .well').css("background-color","white"); + $('#editor_container .well').css("border","none"); + $('#editor_container .well').css("box-shadow","none"); + $('#editor_container .btn').addClass("btn-primary"); + $('#editor_container h3').first().remove(); + }); diff --git a/assets/webconfig/js/content_leds.js b/assets/webconfig/js/content_leds.js index 6a81ca68..60ac0f1c 100644 --- a/assets/webconfig/js/content_leds.js +++ b/assets/webconfig/js/content_leds.js @@ -130,6 +130,7 @@ $(document).ready(function() { var grabber_conf_editor = new JSONEditor(element,{ theme: 'bootstrap3', + iconlib: "fontawesome4", disable_collapse: 'true', form_name_root: 'sa', disable_edit_json: 'true', @@ -162,7 +163,13 @@ $(document).ready(function() { }; grabber_conf_editor.getEditor("root.specificOptions").setValue( values_specific ); }; - + + $('#editor_container .well').css("background-color","white"); + $('#editor_container .well').css("border","none"); + $('#editor_container .well').css("box-shadow","none"); + $('#editor_container .btn').addClass("btn-primary"); + $('#editor_container h3').first().remove(); + if ($(this).val() == "philipshue") { $("#huebridge").show(); diff --git a/libsrc/leddevice/schemas/schema-philipshue.json b/libsrc/leddevice/schemas/schema-philipshue.json index c0a444a0..2ac74497 100644 --- a/libsrc/leddevice/schemas/schema-philipshue.json +++ b/libsrc/leddevice/schemas/schema-philipshue.json @@ -12,8 +12,11 @@ "default": "newdeveloper" }, "lightIds": { - "type": "integer", - "title":"Light ids" + "type": "array", + "title":"Light ids", + "items": { + "type" : "integer" + } }, "transitiontime": { "type": "integer", From 0b8d41ed69d4368c005340913f5100a5316f2b73 Mon Sep 17 00:00:00 2001 From: brindosch Date: Sun, 11 Sep 2016 13:21:34 +0200 Subject: [PATCH 061/133] Update travis_deploy.sh --- .travis/travis_deploy.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis/travis_deploy.sh b/.travis/travis_deploy.sh index 660a4d6d..fc6eba6f 100644 --- a/.travis/travis_deploy.sh +++ b/.travis/travis_deploy.sh @@ -4,7 +4,7 @@ sf_upload() { /usr/bin/expect <<-EOD - spawn scp $1 $2 hyperionsf37@frs.sourceforge.net:/home/frs/project/hyperion-project/$3 + spawn scp $1 $2 hyperionsf37@frs.sourceforge.net:/home/frs/project/hyperion-project/dev/$3 expect "*(yes/no)*" send "yes\r" expect "*password:*" @@ -22,7 +22,7 @@ if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sf_upload $deploylist release elif [[ $TRAVIS_EVENT_TYPE == 'cron' ]]; then echo "cron upload" - sf_upload $deploylist nightly + sf_upload $deploylist alpha else echo "PR can't be uploaded for security reasons" fi From d097995a74481b7fdfeea36947e50c1fcf890472 Mon Sep 17 00:00:00 2001 From: b1rdhous3 Date: Sun, 11 Sep 2016 22:20:57 +0200 Subject: [PATCH 062/133] Small Hue improvements (#235) * Small Hue Bridge improvements * Small Lang fixing --- assets/webconfig/content/leds.html | 47 +++++++++++++----------- assets/webconfig/content/remote.html | 4 +- assets/webconfig/js/content_huebridge.js | 21 +---------- assets/webconfig/js/content_leds.js | 25 ++++++++----- assets/webconfig/js/hyperion.js | 15 ++++++++ 5 files changed, 60 insertions(+), 52 deletions(-) diff --git a/assets/webconfig/content/leds.html b/assets/webconfig/content/leds.html index 1712f0cc..bbe6165b 100644 --- a/assets/webconfig/content/leds.html +++ b/assets/webconfig/content/leds.html @@ -3,7 +3,7 @@ background-image:url(/img/hyperion/hyperionlogo.png); background-repeat:no-repeat; background-position: center; border-radius:2px; } .led { display:inline-block; border: 1px solid black; position:absolute; opacity:0.8; text-align:center; vertical-align:middle; padding:4px; border-radius:2px;} - .led_num {display:none; position:relative; color:black; background-color: white; + .led_num {display:none; position:relative; color:black; background-color: white; border-radius:2px; padding:1px; vertical-align:middle; text-align:center; font-size:0.8em;} #leds_controls {white-space:nowrap; margin-top:500px;} @@ -53,42 +53,46 @@
    - - + +
    - +