diff --git a/ADApp/ADSrc/Codec.h b/ADApp/ADSrc/Codec.h index 9012783df..d22ab3ff1 100644 --- a/ADApp/ADSrc/Codec.h +++ b/ADApp/ADSrc/Codec.h @@ -6,6 +6,7 @@ static std::string codecName[] = { "jpeg", "blosc", "lz4", + "lz4hdf5", "bslz4" }; @@ -14,6 +15,7 @@ typedef enum { NDCODEC_JPEG, NDCODEC_BLOSC, NDCODEC_LZ4, + NDCODEC_LZ4HDF5, NDCODEC_BSLZ4 } NDCodecCompressor_t; diff --git a/ADApp/Db/NDCodec.template b/ADApp/Db/NDCodec.template index 1ecfeae4a..3f3eb47de 100644 --- a/ADApp/Db/NDCodec.template +++ b/ADApp/Db/NDCodec.template @@ -42,8 +42,10 @@ record(mbbo, "$(P)$(R)Compressor") field(TWVL, "2") field(THST, "LZ4") field(THVL, "3") - field(FRST, "BSLZ4") + field(FRST, "LZ4HDF5") field(FRVL, "4") + field(FVST, "BSLZ4") + field(FVVL, "5") info(autosaveFields, "VAL") } @@ -59,8 +61,10 @@ record(mbbi, "$(P)$(R)Compressor_RBV") field(TWVL, "2") field(THST, "LZ4") field(THVL, "3") - field(FRST, "BSLZ4") + field(FRST, "LZ4HDF5") field(FRVL, "4") + field(FVST, "BSLZ4") + field(FVVL, "5") field(SCAN, "I/O Intr") } @@ -193,6 +197,23 @@ record(longin, "$(P)$(R)BloscNumThreads_RBV") field(SCAN, "I/O Intr") } +record(longout, "$(P)$(R)LZ4HDF5BlockSize") +{ + field(PINI, "YES") + field(DTYP, "asynInt32") + field(OUT, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))LZ4HDF5_BLOCKSIZE") + field(VAL, "0") + field(DRVL, "0") + info(autosaveFields, "VAL") +} + +record(longin, "$(P)$(R)LZ4HDF5BlockSize_RBV") +{ + field(DTYP, "asynInt32") + field(INP, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))LZ4HDF5_BLOCKSIZE") + field(SCAN, "I/O Intr") +} + record(mbbi, "$(P)$(R)CodecStatus") { field(DTYP, "asynInt32") diff --git a/ADApp/Db/NDCodec_settings.req b/ADApp/Db/NDCodec_settings.req index 65dc43cb3..8c2a34986 100644 --- a/ADApp/Db/NDCodec_settings.req +++ b/ADApp/Db/NDCodec_settings.req @@ -5,4 +5,5 @@ $(P)$(R)BloscCompressor $(P)$(R)BloscCLevel $(P)$(R)BloscShuffle $(P)$(R)BloscNumThreads +$(P)$(R)LZ4HDF5BlockSize file "NDPluginBase_settings.req", P=$(P), R=$(R) diff --git a/ADApp/commonDriverMakefile b/ADApp/commonDriverMakefile index a579265fc..5895e184e 100644 --- a/ADApp/commonDriverMakefile +++ b/ADApp/commonDriverMakefile @@ -153,6 +153,7 @@ ifeq ($(WITH_BITSHUFFLE),YES) PROD_SYS_LIBS += bitshuffle endif endif + PROD_LIBS += lz4hdf5 endif ifeq ($(WITH_BLOSC),YES) diff --git a/ADApp/commonLibraryMakefile b/ADApp/commonLibraryMakefile index e209723bb..03d2681e8 100644 --- a/ADApp/commonLibraryMakefile +++ b/ADApp/commonLibraryMakefile @@ -118,6 +118,7 @@ ifeq ($(WITH_BITSHUFFLE),YES) LIB_SYS_LIBS += bitshuffle endif endif + LIB_LIBS += lz4hdf5 endif ifeq ($(WITH_BLOSC),YES) diff --git a/ADApp/op/adl/NDCodec.adl b/ADApp/op/adl/NDCodec.adl index 0aba846f9..1964c812f 100644 --- a/ADApp/op/adl/NDCodec.adl +++ b/ADApp/op/adl/NDCodec.adl @@ -1,7 +1,7 @@ file { - name="/home/epics/devel/areaDetector-3-3-2/ADCore/ADApp/op/adl/NDCodec.adl" - version=030109 + name="/home/epics/devel/areaDetector-3-14/ADCore/ADApp/op/adl/NDCodec.adl" + version=030117 } display { object { @@ -116,7 +116,7 @@ rectangle { x=390 y=40 width=380 - height=260 + height=285 } "basic attribute" { clr=14 @@ -135,7 +135,7 @@ composite { } "text update" { object { - x=676 + x=675 y=51 width=90 height=18 @@ -151,7 +151,7 @@ composite { } "text update" { object { - x=666 + x=665 y=76 width=100 height=18 @@ -167,7 +167,7 @@ composite { } menu { object { - x=581 + x=580 y=51 width=90 height=18 @@ -180,7 +180,7 @@ menu { } menu { object { - x=581 + x=580 y=76 width=80 height=18 @@ -193,7 +193,7 @@ menu { } text { object { - x=536 + x=535 y=50 width=40 height=20 @@ -206,7 +206,7 @@ text { } text { object { - x=476 + x=475 y=75 width=100 height=20 @@ -219,7 +219,7 @@ text { } "text update" { object { - x=666 + x=665 y=126 width=100 height=18 @@ -234,7 +234,7 @@ text { } "text entry" { object { - x=581 + x=580 y=125 width=80 height=20 @@ -249,7 +249,7 @@ text { } text { object { - x=456 + x=455 y=125 width=120 height=20 @@ -262,7 +262,7 @@ text { } "text update" { object { - x=666 + x=665 y=151 width=100 height=18 @@ -278,7 +278,7 @@ text { } "text update" { object { - x=666 + x=665 y=176 width=100 height=18 @@ -293,7 +293,7 @@ text { } "text update" { object { - x=666 + x=665 y=201 width=100 height=18 @@ -307,24 +307,9 @@ text { limits { } } -"text update" { - object { - x=666 - y=226 - width=100 - height=18 - } - monitor { - chan="$(P)$(R)BloscNumThreads_RBV" - clr=54 - bclr=4 - } - limits { - } -} menu { object { - x=581 + x=580 y=151 width=80 height=18 @@ -337,7 +322,7 @@ menu { } "text entry" { object { - x=581 + x=580 y=175 width=80 height=20 @@ -352,7 +337,7 @@ menu { } menu { object { - x=581 + x=580 y=201 width=80 height=18 @@ -363,24 +348,9 @@ menu { bclr=51 } } -"text entry" { - object { - x=581 - y=225 - width=80 - height=20 - } - control { - chan="$(P)$(R)BloscNumThreads" - clr=14 - bclr=51 - } - limits { - } -} text { object { - x=416 + x=415 y=150 width=160 height=20 @@ -393,7 +363,7 @@ text { } text { object { - x=406 + x=405 y=175 width=170 height=20 @@ -406,7 +376,7 @@ text { } text { object { - x=446 + x=445 y=200 width=130 height=20 @@ -419,20 +389,7 @@ text { } text { object { - x=406 - y=225 - width=170 - height=20 - } - "basic attribute" { - clr=14 - } - textix="Blosc Num Threads" - align="horiz. right" -} -text { - object { - x=396 + x=395 y=100 width=180 height=20 @@ -445,7 +402,7 @@ text { } "text update" { object { - x=581 + x=580 y=101 width=80 height=18 @@ -460,8 +417,8 @@ text { } text { object { - x=456 - y=250 + x=455 + y=275 width=120 height=20 } @@ -473,8 +430,8 @@ text { } "text update" { object { - x=581 - y=251 + x=580 + y=276 width=80 height=18 } @@ -491,8 +448,8 @@ text { } text { object { - x=396 - y=275 + x=395 + y=300 width=110 height=20 } @@ -504,8 +461,8 @@ text { } "text update" { object { - x=511 - y=278 + x=510 + y=303 width=255 height=14 } @@ -518,3 +475,89 @@ text { limits { } } +"text update" { + object { + x=665 + y=226 + width=100 + height=18 + } + monitor { + chan="$(P)$(R)BloscNumThreads_RBV" + clr=54 + bclr=4 + } + limits { + } +} +"text entry" { + object { + x=580 + y=225 + width=80 + height=20 + } + control { + chan="$(P)$(R)BloscNumThreads" + clr=14 + bclr=51 + } + limits { + } +} +text { + object { + x=405 + y=225 + width=170 + height=20 + } + "basic attribute" { + clr=14 + } + textix="Blosc Num Threads" + align="horiz. right" +} +"text update" { + object { + x=664 + y=251 + width=100 + height=18 + } + monitor { + chan="$(P)$(R)LZ4HDF5BlockSize_RBV" + clr=54 + bclr=4 + } + limits { + } +} +"text entry" { + object { + x=579 + y=250 + width=80 + height=20 + } + control { + chan="$(P)$(R)LZ4HDF5BlockSize" + clr=14 + bclr=51 + } + limits { + } +} +text { + object { + x=394 + y=250 + width=180 + height=20 + } + "basic attribute" { + clr=14 + } + textix="LZ4HDF5 Block Size" + align="horiz. right" +} diff --git a/ADApp/op/bob/autoconvert/NDCodec.bob b/ADApp/op/bob/autoconvert/NDCodec.bob index 81839000d..30818bf07 100644 --- a/ADApp/op/bob/autoconvert/NDCodec.bob +++ b/ADApp/op/bob/autoconvert/NDCodec.bob @@ -1,5 +1,5 @@ - + NDCodec 330 @@ -46,7 +46,7 @@ 390 40 380 - 260 + 285 1 @@ -69,7 +69,7 @@ text update #17 $(P)$(R)Mode_RBV - 676 + 675 51 90 18 @@ -92,7 +92,7 @@ text update #21 $(P)$(R)Compressor_RBV - 666 + 665 76 18 @@ -114,7 +114,7 @@ menu #25 $(P)$(R)Mode - 581 + 580 51 90 18 @@ -127,7 +127,7 @@ menu #28 $(P)$(R)Compressor - 581 + 580 76 80 18 @@ -140,7 +140,7 @@ text #31 Mode - 536 + 535 50 40 @@ -152,7 +152,7 @@ text #34 Compressor - 476 + 475 75 @@ -163,7 +163,7 @@ text update #37 $(P)$(R)JPEGQuality_RBV - 666 + 665 126 18 @@ -185,7 +185,7 @@ text entry #41 $(P)$(R)JPEGQuality - 581 + 580 125 80 @@ -203,7 +203,7 @@ text #45 JPEG Quality - 456 + 455 125 120 @@ -215,7 +215,7 @@ text update #48 $(P)$(R)BloscCompressor_RBV - 666 + 665 151 18 @@ -237,7 +237,7 @@ text update #52 $(P)$(R)BloscCLevel_RBV - 666 + 665 176 18 @@ -259,7 +259,7 @@ text update #56 $(P)$(R)BloscShuffle_RBV - 666 + 665 201 18 @@ -278,32 +278,10 @@ false false - - text update #60 - $(P)$(R)BloscNumThreads_RBV - 666 - 226 - 18 - - - - - - - - - - - - - 1 - false - false - - menu #64 + menu #60 $(P)$(R)BloscCompressor - 581 + 580 151 80 18 @@ -314,9 +292,9 @@ false - text entry #67 + text entry #63 $(P)$(R)BloscCLevel - 581 + 580 175 80 @@ -332,9 +310,9 @@ false - menu #71 + menu #67 $(P)$(R)BloscShuffle - 581 + 580 201 80 18 @@ -344,28 +322,10 @@ false - - text entry #74 - $(P)$(R)BloscNumThreads - 581 - 225 - 80 - - - - - - - - - 1 - false - false - - text #78 + text #70 Blosc Compressor - 416 + 415 150 160 @@ -375,9 +335,9 @@ 2 - text #81 + text #73 Blosc Comp. Level - 406 + 405 175 170 @@ -387,9 +347,9 @@ 2 - text #84 + text #76 Blosc Shuffle - 446 + 445 200 130 @@ -399,21 +359,9 @@ 2 - text #87 - Blosc Num Threads - 406 - 225 - 170 - - - - - 2 - - - text #90 + text #79 Compression Factor - 396 + 395 100 180 @@ -423,9 +371,9 @@ 2 - text update #93 + text update #82 $(P)$(R)CompFactor_RBV - 581 + 580 101 80 18 @@ -446,10 +394,10 @@ false - text #97 + text #86 Codec Status - 456 - 250 + 455 + 275 120 @@ -458,10 +406,10 @@ 2 - text update #100 + text update #89 $(P)$(R)CodecStatus - 581 - 251 + 580 + 276 80 18 @@ -481,10 +429,10 @@ 1 - text #104 + text #93 Codec Error - 396 - 275 + 395 + 300 110 @@ -493,10 +441,10 @@ 2 - text update #107 + text update #96 $(P)$(R)CodecError - 511 - 278 + 510 + 303 255 14 @@ -511,4 +459,108 @@ false false + + text update #100 + $(P)$(R)BloscNumThreads_RBV + 665 + 226 + 18 + + + + + + + + + + + + + 1 + false + false + + + text entry #104 + $(P)$(R)BloscNumThreads + 580 + 225 + 80 + + + + + + + + + 1 + false + false + + + text #108 + Blosc Num Threads + 405 + 225 + 170 + + + + + 2 + + + text update #111 + $(P)$(R)LZ4HDF5BlockSize_RBV + 664 + 251 + 18 + + + + + + + + + + + + + 1 + false + false + + + text entry #115 + $(P)$(R)LZ4HDF5BlockSize + 579 + 250 + 80 + + + + + + + + + 1 + false + false + + + text #119 + LZ4HDF5 Block Size + 394 + 250 + 180 + + + + + 2 + diff --git a/ADApp/op/edl/autoconvert/NDCodec.edl b/ADApp/op/edl/autoconvert/NDCodec.edl index e215dfd47..5d51e295f 100644 --- a/ADApp/op/edl/autoconvert/NDCodec.edl +++ b/ADApp/op/edl/autoconvert/NDCodec.edl @@ -69,7 +69,7 @@ release 0 x 390 y 40 w 380 -h 260 +h 285 lineColor rgb 0 0 0 fillColor rgb 0 0 0 lineWidth 0 @@ -105,7 +105,7 @@ beginObjectProperties major 4 minor 7 release 0 -x 676 +x 675 y 51 w 90 h 18 @@ -129,7 +129,7 @@ beginObjectProperties major 4 minor 7 release 0 -x 666 +x 665 y 76 w 100 h 18 @@ -153,7 +153,7 @@ beginObjectProperties major 4 minor 1 release 1 -x 525 +x 524 y 50 w 51 h 20 @@ -173,7 +173,7 @@ beginObjectProperties major 4 minor 1 release 1 -x 476 +x 475 y 75 w 100 h 20 @@ -193,7 +193,7 @@ beginObjectProperties major 4 minor 7 release 0 -x 666 +x 665 y 126 w 100 h 18 @@ -217,7 +217,7 @@ beginObjectProperties major 4 minor 7 release 0 -x 581 +x 580 y 125 w 80 h 20 @@ -243,7 +243,7 @@ beginObjectProperties major 4 minor 1 release 1 -x 456 +x 455 y 125 w 120 h 20 @@ -263,7 +263,7 @@ beginObjectProperties major 4 minor 7 release 0 -x 666 +x 665 y 151 w 100 h 18 @@ -287,7 +287,7 @@ beginObjectProperties major 4 minor 7 release 0 -x 666 +x 665 y 176 w 100 h 18 @@ -311,7 +311,7 @@ beginObjectProperties major 4 minor 7 release 0 -x 666 +x 665 y 201 w 100 h 18 @@ -329,37 +329,13 @@ newPos objType "controls" endObjectProperties -# (Text Monitor) -object activeXTextDspClass:noedit -beginObjectProperties -major 4 -minor 7 -release 0 -x 666 -y 226 -w 100 -h 18 -controlPv "$(P)$(R)BloscNumThreads_RBV" -format "decimal" -font "helvetica-medium-r-14.0" -fontAlign "left" -fgColor rgb 2560 0 47104 -bgColor rgb 47872 47872 47872 -limitsFromDb -nullColor rgb 60928 46592 11008 -smartRefresh -fastUpdate -newPos -objType "controls" -endObjectProperties - # (Text Control) object activeXTextDspClass beginObjectProperties major 4 minor 7 release 0 -x 581 +x 580 y 175 w 80 h 20 @@ -379,39 +355,13 @@ newPos objType "controls" endObjectProperties -# (Text Control) -object activeXTextDspClass -beginObjectProperties -major 4 -minor 7 -release 0 -x 581 -y 225 -w 80 -h 20 -controlPv "$(P)$(R)BloscNumThreads" -format "decimal" -font "helvetica-medium-r-12.0" -fontAlign "left" -fgColor rgb 0 0 0 -bgColor rgb 29440 57088 65280 -editable -motifWidget -limitsFromDb -nullColor rgb 60928 46592 11008 -smartRefresh -fastUpdate -newPos -objType "controls" -endObjectProperties - # (Static Text) object activeXTextClass beginObjectProperties major 4 minor 1 release 1 -x 416 +x 415 y 150 w 160 h 20 @@ -431,7 +381,7 @@ beginObjectProperties major 4 minor 1 release 1 -x 406 +x 405 y 175 w 170 h 20 @@ -451,7 +401,7 @@ beginObjectProperties major 4 minor 1 release 1 -x 446 +x 445 y 200 w 130 h 20 @@ -471,27 +421,7 @@ beginObjectProperties major 4 minor 1 release 1 -x 406 -y 225 -w 170 -h 20 -font "helvetica-medium-r-14.0" -fontAlign "right" -fgColor rgb 0 0 0 -bgColor index 3 -useDisplayBg -value { - "Blosc Num Threads" -} -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 396 +x 395 y 100 w 180 h 20 @@ -511,7 +441,7 @@ beginObjectProperties major 4 minor 7 release 0 -x 581 +x 580 y 101 w 80 h 18 @@ -535,8 +465,8 @@ beginObjectProperties major 4 minor 1 release 1 -x 456 -y 250 +x 455 +y 275 w 120 h 20 font "helvetica-medium-r-14.0" @@ -555,8 +485,8 @@ beginObjectProperties major 4 minor 7 release 0 -x 581 -y 251 +x 580 +y 276 w 80 h 18 controlPv "$(P)$(R)CodecStatus" @@ -580,8 +510,8 @@ beginObjectProperties major 4 minor 1 release 1 -x 396 -y 275 +x 395 +y 300 w 110 h 20 font "helvetica-medium-r-14.0" @@ -600,8 +530,8 @@ beginObjectProperties major 4 minor 7 release 0 -x 511 -y 278 +x 510 +y 303 w 255 h 14 controlPv "$(P)$(R)CodecError" @@ -618,13 +548,153 @@ newPos objType "controls" endObjectProperties +# (Text Monitor) +object activeXTextDspClass:noedit +beginObjectProperties +major 4 +minor 7 +release 0 +x 665 +y 226 +w 100 +h 18 +controlPv "$(P)$(R)BloscNumThreads_RBV" +format "decimal" +font "helvetica-medium-r-14.0" +fontAlign "left" +fgColor rgb 2560 0 47104 +bgColor rgb 47872 47872 47872 +limitsFromDb +nullColor rgb 60928 46592 11008 +smartRefresh +fastUpdate +newPos +objType "controls" +endObjectProperties + +# (Text Control) +object activeXTextDspClass +beginObjectProperties +major 4 +minor 7 +release 0 +x 580 +y 225 +w 80 +h 20 +controlPv "$(P)$(R)BloscNumThreads" +format "decimal" +font "helvetica-medium-r-12.0" +fontAlign "left" +fgColor rgb 0 0 0 +bgColor rgb 29440 57088 65280 +editable +motifWidget +limitsFromDb +nullColor rgb 60928 46592 11008 +smartRefresh +fastUpdate +newPos +objType "controls" +endObjectProperties + +# (Static Text) +object activeXTextClass +beginObjectProperties +major 4 +minor 1 +release 1 +x 405 +y 225 +w 170 +h 20 +font "helvetica-medium-r-14.0" +fontAlign "right" +fgColor rgb 0 0 0 +bgColor index 3 +useDisplayBg +value { + "Blosc Num Threads" +} +endObjectProperties + +# (Text Monitor) +object activeXTextDspClass:noedit +beginObjectProperties +major 4 +minor 7 +release 0 +x 664 +y 251 +w 100 +h 18 +controlPv "$(P)$(R)LZ4HDF5BlockSize_RBV" +format "decimal" +font "helvetica-medium-r-14.0" +fontAlign "left" +fgColor rgb 2560 0 47104 +bgColor rgb 47872 47872 47872 +limitsFromDb +nullColor rgb 60928 46592 11008 +smartRefresh +fastUpdate +newPos +objType "controls" +endObjectProperties + +# (Text Control) +object activeXTextDspClass +beginObjectProperties +major 4 +minor 7 +release 0 +x 579 +y 250 +w 80 +h 20 +controlPv "$(P)$(R)LZ4HDF5BlockSize" +format "decimal" +font "helvetica-medium-r-12.0" +fontAlign "left" +fgColor rgb 0 0 0 +bgColor rgb 29440 57088 65280 +editable +motifWidget +limitsFromDb +nullColor rgb 60928 46592 11008 +smartRefresh +fastUpdate +newPos +objType "controls" +endObjectProperties + +# (Static Text) +object activeXTextClass +beginObjectProperties +major 4 +minor 1 +release 1 +x 394 +y 250 +w 180 +h 20 +font "helvetica-medium-r-14.0" +fontAlign "right" +fgColor rgb 0 0 0 +bgColor index 3 +useDisplayBg +value { + "LZ4HDF5 Block Size" +} +endObjectProperties + # (Menu Button) object activeMenuButtonClass beginObjectProperties major 4 minor 0 release 0 -x 581 +x 580 y 51 w 90 h 18 @@ -644,7 +714,7 @@ beginObjectProperties major 4 minor 0 release 0 -x 581 +x 580 y 76 w 80 h 18 @@ -664,7 +734,7 @@ beginObjectProperties major 4 minor 0 release 0 -x 581 +x 580 y 151 w 80 h 18 @@ -684,7 +754,7 @@ beginObjectProperties major 4 minor 0 release 0 -x 581 +x 580 y 201 w 80 h 18 diff --git a/ADApp/op/opi/autoconvert/NDCodec.opi b/ADApp/op/opi/autoconvert/NDCodec.opi index 0a7223efb..ce3d93c84 100644 --- a/ADApp/op/opi/autoconvert/NDCodec.opi +++ b/ADApp/op/opi/autoconvert/NDCodec.opi @@ -118,7 +118,7 @@ $(pv_value) false - 260 + 285 true @@ -271,7 +271,7 @@ $(pv_value) Text Update 90 false - 676 + 675 51 @@ -322,7 +322,7 @@ $(pv_value) Text Update 100 false - 666 + 665 76 @@ -366,7 +366,7 @@ $(pv_value) true Menu Button 90 - 581 + 580 51 @@ -410,7 +410,7 @@ $(pv_value) true Menu Button 80 - 581 + 580 76 @@ -450,7 +450,7 @@ $(pv_value) Label 40 false - 536 + 535 50 @@ -490,7 +490,7 @@ $(pv_value) Label 100 false - 476 + 475 75 @@ -541,7 +541,7 @@ $(pv_value) Text Update 100 false - 666 + 665 126 @@ -603,7 +603,7 @@ $(pv_value) true Text Input 80 - 581 + 580 125 @@ -643,7 +643,7 @@ $(pv_value) Label 120 false - 456 + 455 125 @@ -694,7 +694,7 @@ $(pv_value) Text Update 100 false - 666 + 665 151 @@ -745,7 +745,7 @@ $(pv_value) Text Update 100 false - 666 + 665 176 @@ -796,60 +796,9 @@ $(pv_value) Text Update 100 false - 666 + 665 201 - - - false - false - false - - - - true - - - - 0 - 1 - true - - - - false - - - - 1 - 18 - 0 - Text Update - 0 - true - $(P)$(R)BloscNumThreads_RBV - - 0.0 - - - true - true - false - - - false - ###### - $(pv_name) -$(pv_value) - false - 1 - true - Text Update - 100 - false - 666 - 226 - true @@ -891,7 +840,7 @@ $(pv_value) true Menu Button 80 - 581 + 580 151 @@ -953,7 +902,7 @@ $(pv_value) true Text Input 80 - 581 + 580 175 @@ -997,48 +946,30 @@ $(pv_value) true Menu Button 80 - 581 + 580 201 - + - false false - false - + - false - 3 + 0 1 - true - false - 1 20 - 0 - false - Infinity - -Infinity - false - Text Input - 0 - false - 0 - true - $(P)$(R)BloscNumThreads - - false - 0.0 + 2 + Label true @@ -1046,21 +977,17 @@ $(pv_value) false - 0 - false - true - false - false - - - $(pv_name) -$(pv_value) - false + false + Blosc Compressor + + true + 1 true - Text Input - 80 - 581 - 225 + Label + 160 + false + 415 + 150 @@ -1091,16 +1018,16 @@ $(pv_value) false - Blosc Compressor + Blosc Comp. Level true 1 true Label - 160 + 170 false - 416 - 150 + 405 + 175 @@ -1131,16 +1058,16 @@ $(pv_value) false - Blosc Comp. Level + Blosc Shuffle true 1 true Label - 170 + 130 false - 406 - 175 + 445 + 200 @@ -1171,23 +1098,26 @@ $(pv_value) false - Blosc Shuffle + Compression Factor true 1 true Label - 130 + 180 false - 446 - 200 + 395 + 100 - + + false false + false - + + true @@ -1197,12 +1127,19 @@ $(pv_value) + false - + - 20 - 2 - Label + 1 + 18 + 0 + Text Update + 0 + true + $(P)$(R)CompFactor_RBV + + 0.0 true @@ -1210,17 +1147,18 @@ $(pv_value) false - false - Blosc Num Threads - - true + false + ###### + $(pv_name) +$(pv_value) + false 1 true - Label - 170 + Text Update + 80 false - 406 - 225 + 580 + 101 @@ -1251,16 +1189,16 @@ $(pv_value) false - Compression Factor + Codec Status true 1 true Label - 180 + 120 false - 396 - 100 + 455 + 275 @@ -1268,9 +1206,9 @@ $(pv_value) false false - + - true + false @@ -1280,17 +1218,17 @@ $(pv_value) - false + true - + - 1 + 4 18 - 0 + 1 Text Update 0 true - $(P)$(R)CompFactor_RBV + $(P)$(R)CodecStatus 0.0 @@ -1310,8 +1248,8 @@ $(pv_value) Text Update 80 false - 581 - 101 + 580 + 276 @@ -1342,16 +1280,16 @@ $(pv_value) false - Codec Status + Codec Error true 1 true Label - 120 + 110 false - 456 - 250 + 395 + 300 @@ -1359,9 +1297,9 @@ $(pv_value) false false - + - false + true @@ -1369,19 +1307,70 @@ $(pv_value) 1 true - + - true + false - + 4 + 14 + 0 + Text Update + 0 + true + $(P)$(R)CodecError + + 0.0 + + + true + true + false + + + false + ###### + $(pv_name) +$(pv_value) + false + 1 + true + Text Update + 255 + false + 510 + 303 + + + + false + false + false + + + + true + + + + 0 + 1 + true + + + + false + + + + 1 18 - 1 + 0 Text Update 0 true - $(P)$(R)CodecStatus + $(P)$(R)BloscNumThreads_RBV 0.0 @@ -1399,10 +1388,72 @@ $(pv_value) 1 true Text Update - 80 + 100 false - 581 - 251 + 665 + 226 + + + + false + false + false + + + + false + + + + 3 + 1 + + true + + + + false + + + + 1 + 20 + 0 + false + Infinity + -Infinity + false + Text Input + 0 + false + 0 + true + $(P)$(R)BloscNumThreads + + false + 0.0 + + + true + true + false + + + 0 + false + true + false + false + + + $(pv_name) +$(pv_value) + false + true + Text Input + 80 + 580 + 225 @@ -1433,16 +1484,16 @@ $(pv_value) false - Codec Error + Blosc Num Threads true 1 true Label - 110 + 170 false - 396 - 275 + 405 + 225 @@ -1460,19 +1511,19 @@ $(pv_value) 1 true - + false - 4 - 14 + 1 + 18 0 Text Update 0 true - $(P)$(R)CodecError + $(P)$(R)LZ4HDF5BlockSize_RBV 0.0 @@ -1490,9 +1541,111 @@ $(pv_value) 1 true Text Update - 255 + 100 false - 511 - 278 + 664 + 251 + + + + false + false + false + + + + false + + + + 3 + 1 + + true + + + + false + + + + 1 + 20 + 0 + false + Infinity + -Infinity + false + Text Input + 0 + false + 0 + true + $(P)$(R)LZ4HDF5BlockSize + + false + 0.0 + + + true + true + false + + + 0 + false + true + false + false + + + $(pv_name) +$(pv_value) + false + true + Text Input + 80 + 579 + 250 + + + + false + + + + + + + 0 + 1 + true + + + + + + + 20 + 2 + Label + + + true + true + false + + + false + LZ4HDF5 Block Size + + true + 1 + true + Label + 180 + false + 394 + 250 diff --git a/ADApp/pluginSrc/NDFileHDF5.cpp b/ADApp/pluginSrc/NDFileHDF5.cpp index abe65a6b3..ff6163715 100644 --- a/ADApp/pluginSrc/NDFileHDF5.cpp +++ b/ADApp/pluginSrc/NDFileHDF5.cpp @@ -40,6 +40,7 @@ enum HDF5Compression_t {HDF5CompressNone=0, HDF5CompressBlosc, HDF5CompressBshuf, HDF5CompressLZ4, + HDF5CompressLZ4HDF5, HDF5CompressJPEG}; /* Filter ID officially assigned to blosc */ #define FILTER_BLOSC 32001 @@ -1940,6 +1941,7 @@ asynStatus NDFileHDF5::writeInt32(asynUser *pasynUser, epicsInt32 value) filterId = FILTER_BSHUF; break; case HDF5CompressLZ4: + case HDF5CompressLZ4HDF5: filterId = FILTER_LZ4; break; case HDF5CompressJPEG: @@ -3325,6 +3327,8 @@ asynStatus NDFileHDF5::configureCompression(NDArray *pArray) setIntegerParam(NDFileHDF5_compressionType, HDF5CompressBshuf); } else if (pArray->codec.name == codecName[NDCODEC_LZ4]) { setIntegerParam(NDFileHDF5_compressionType, HDF5CompressLZ4); + } else if (pArray->codec.name == codecName[NDCODEC_LZ4HDF5]) { + setIntegerParam(NDFileHDF5_compressionType, HDF5CompressLZ4HDF5); } else if (pArray->codec.name == codecName[NDCODEC_JPEG]) { setIntegerParam(NDFileHDF5_compressionType, HDF5CompressJPEG); } @@ -3411,7 +3415,8 @@ asynStatus NDFileHDF5::configureCompression(NDArray *pArray) this->codec.name = codecName[NDCODEC_BSLZ4]; } break; - case HDF5CompressLZ4: { + case HDF5CompressLZ4: + case HDF5CompressLZ4HDF5: { unsigned int cds[2]; cds[0] = 0; /* lz4 selects the block size automatically */ cds[1] = 0; /* Number of threads (not implemented) */ @@ -3420,7 +3425,11 @@ asynStatus NDFileHDF5::configureCompression(NDArray *pArray) asynPrint(this->pasynUserSelf, ASYN_TRACE_ERROR, "Failed to set h5 lz4 filter\n"); break; } - this->codec.name = codecName[NDCODEC_LZ4]; + if (compressionScheme == HDF5CompressLZ4) { + this->codec.name = codecName[NDCODEC_LZ4]; + } else { + this->codec.name = codecName[NDCODEC_LZ4HDF5]; + } } break; case HDF5CompressJPEG: { diff --git a/ADApp/pluginSrc/NDPluginCodec.cpp b/ADApp/pluginSrc/NDPluginCodec.cpp index 91a777523..5ce79c872 100644 --- a/ADApp/pluginSrc/NDPluginCodec.cpp +++ b/ADApp/pluginSrc/NDPluginCodec.cpp @@ -460,6 +460,7 @@ NDArray *decompressBlosc(NDArray *input, int numThreads, NDCodecStatus_t *status #ifdef HAVE_BITSHUFFLE #include #include +#include NDArray *compressLZ4(NDArray *input, NDCodecStatus_t *status, char *errorMessage) { @@ -531,6 +532,79 @@ NDArray *decompressLZ4(NDArray *input, NDCodecStatus_t *status, char *errorMessa return output; } +NDArray *compressLZ4HDF5(NDArray *input, size_t blockSize, NDCodecStatus_t *status, char *errorMessage) +{ + if (!input->codec.empty()) { + sprintf(errorMessage, "Array is already compressed"); + *status = NDCODEC_WARNING; + return NULL; + } + + NDArrayInfo_t info; + input->getInfo(&info); + size_t nBlocks; + + int outputSize = lz4hdf5_compressBound(info.totalBytes, &blockSize, &nBlocks); + + NDArray *output = allocArray(input, -1, outputSize); + + if (!output) { + sprintf(errorMessage, "Failed to allocate LZ4HDF5 output array"); + *status = NDCODEC_ERROR; + return NULL; + } + + int compSize = compress_lz4hdf5((const char*)input->pData, (char*)output->pData, info.totalBytes, outputSize, blockSize); + + if (compSize <= 0) { + output->release(); + sprintf(errorMessage, "Internal LZ4HDF5 error"); + *status = NDCODEC_ERROR; + return NULL; + } + + output->codec.name = codecName[NDCODEC_LZ4HDF5]; + output->compressedSize = compSize; + + return output; +} + + +NDArray *decompressLZ4HDF5(NDArray *input, size_t *blockSize, NDCodecStatus_t *status, char *errorMessage) +{ + // Sanity check + if (input->codec.name != codecName[NDCODEC_LZ4HDF5]) { + sprintf(errorMessage, "Invalid codec '%s', expected '%s'", + input->codec.name.c_str(), codecName[NDCODEC_LZ4HDF5].c_str()); + *status = NDCODEC_ERROR; + return NULL; + } + + NDArrayInfo_t info; + input->getInfo(&info); + + NDArray *output = allocArray(input); + + if (!output) { + sprintf(errorMessage, "Failed to allocate LZ4HDF5 output array"); + *status = NDCODEC_ERROR; + return NULL; + } + + int ret = decompress_lz4hdf5((const char*)input->pData, (char*)output->pData, info.totalBytes, blockSize); + + if (ret <= 0){ + output->release(); + sprintf(errorMessage, "Failed to LZ4HDF5 decompress"); + *status = NDCODEC_ERROR; + return NULL; + } + + output->codec.clear(); + + return output; +} + NDArray *compressBSLZ4(NDArray *input, NDCodecStatus_t *status, char *errorMessage) { @@ -623,6 +697,20 @@ NDArray *decompressLZ4(NDArray *input, NDCodecStatus_t *status, char *errorMessa return NULL; } +NDArray *compressLZ4HDF5(NDArray *input, size_t blockSize, NDCodecStatus_t *status, char *errorMessage) +{ + sprintf(errorMessage, "No LZ4 support"); + *status = NDCODEC_ERROR; + return NULL; +} + +NDArray *decompressLZ4HDF5(NDArray *input, size_t *blockSize, NDCodecStatus_t *status, char *errorMessage) +{ + sprintf(errorMessage, "No LZ4 support"); + *status = NDCODEC_ERROR; + return NULL; +} + NDArray *compressBSLZ4(NDArray *input, NDCodecStatus_t *status, char *errorMessage) { sprintf(errorMessage, "No Bitshuffle support"); @@ -714,6 +802,17 @@ void NDPluginCodec::processCallbacks(NDArray *pArray) break; } + case NDCODEC_LZ4HDF5: { + size_t blockSize; + int iTemp; + getIntegerParam(NDCodecLZ4HDF5BlockSize, &iTemp); + blockSize = iTemp; + unlock(); + result = compressLZ4HDF5(pArray, blockSize, &codecStatus, errorMessage); + lock(); + break; + } + case NDCODEC_BSLZ4: { unlock(); result = compressBSLZ4(pArray, &codecStatus, errorMessage); @@ -750,6 +849,13 @@ void NDPluginCodec::processCallbacks(NDArray *pArray) result = decompressLZ4(pArray, &codecStatus, errorMessage); lock(); setIntegerParam(NDCodecCompressor, NDCODEC_LZ4); + } else if (pArray->codec.name == codecName[NDCODEC_LZ4HDF5]) { + size_t blockSize; + unlock(); + result = decompressLZ4HDF5(pArray, &blockSize, &codecStatus, errorMessage); + lock(); + setIntegerParam(NDCodecLZ4HDF5BlockSize, (int) blockSize); + setIntegerParam(NDCodecCompressor, NDCODEC_LZ4HDF5); } else if (pArray->codec.name == codecName[NDCODEC_BSLZ4]) { unlock(); result = decompressBSLZ4(pArray, &codecStatus, errorMessage); @@ -871,28 +977,30 @@ NDPluginCodec::NDPluginCodec(const char *portName, int queueSize, int blockingCa { //static const char *functionName = "NDPluginCodec"; - createParam(NDCodecModeString, asynParamInt32, &NDCodecMode); - createParam(NDCodecCompressorString, asynParamInt32, &NDCodecCompressor); - createParam(NDCodecCompFactorString, asynParamFloat64, &NDCodecCompFactor); - createParam(NDCodecCodecStatusString, asynParamInt32, &NDCodecCodecStatus); - createParam(NDCodecCodecErrorString, asynParamOctet, &NDCodecCodecError); - createParam(NDCodecJPEGQualityString, asynParamInt32, &NDCodecJPEGQuality); - createParam(NDCodecBloscCompressorString, asynParamInt32, &NDCodecBloscCompressor); - createParam(NDCodecBloscCLevelString, asynParamInt32, &NDCodecBloscCLevel); - createParam(NDCodecBloscShuffleString, asynParamInt32, &NDCodecBloscShuffle); - createParam(NDCodecBloscNumThreadsString, asynParamInt32, &NDCodecBloscNumThreads); + createParam(NDCodecModeString, asynParamInt32, &NDCodecMode); + createParam(NDCodecCompressorString, asynParamInt32, &NDCodecCompressor); + createParam(NDCodecCompFactorString, asynParamFloat64, &NDCodecCompFactor); + createParam(NDCodecCodecStatusString, asynParamInt32, &NDCodecCodecStatus); + createParam(NDCodecCodecErrorString, asynParamOctet, &NDCodecCodecError); + createParam(NDCodecJPEGQualityString, asynParamInt32, &NDCodecJPEGQuality); + createParam(NDCodecBloscCompressorString, asynParamInt32, &NDCodecBloscCompressor); + createParam(NDCodecBloscCLevelString, asynParamInt32, &NDCodecBloscCLevel); + createParam(NDCodecBloscShuffleString, asynParamInt32, &NDCodecBloscShuffle); + createParam(NDCodecBloscNumThreadsString, asynParamInt32, &NDCodecBloscNumThreads); + createParam(NDCodecLZ4HDF5BlockSizeString, asynParamInt32, &NDCodecLZ4HDF5BlockSize); /* Set the plugin type string */ setStringParam(NDPluginDriverPluginType, "NDPluginCodec"); - setIntegerParam(NDCodecCompressor, NDCODEC_NONE); - setDoubleParam (NDCodecCompFactor, 1.0); - setIntegerParam(NDCodecCodecStatus, NDCODEC_SUCCESS); + setIntegerParam(NDCodecCompressor, NDCODEC_NONE); + setDoubleParam (NDCodecCompFactor, 1.0); + setIntegerParam(NDCodecCodecStatus, NDCODEC_SUCCESS); setStringParam(NDCodecCodecError, ""); - setIntegerParam(NDCodecJPEGQuality, 85); - setIntegerParam(NDCodecBloscCompressor, NDCODEC_BLOSC_BLOSCLZ); - setIntegerParam(NDCodecBloscCLevel, 5); - setIntegerParam(NDCodecBloscNumThreads, 1); + setIntegerParam(NDCodecJPEGQuality, 85); + setIntegerParam(NDCodecBloscCompressor, NDCODEC_BLOSC_BLOSCLZ); + setIntegerParam(NDCodecBloscCLevel, 5); + setIntegerParam(NDCodecBloscNumThreads, 1); + setIntegerParam(NDCodecLZ4HDF5BlockSize, 0); // Enable ArrayCallbacks. // This plugin currently ignores this setting and always does callbacks, so make the setting reflect the behavior diff --git a/ADApp/pluginSrc/NDPluginCodec.h b/ADApp/pluginSrc/NDPluginCodec.h index b86ce599b..b6084ad3e 100644 --- a/ADApp/pluginSrc/NDPluginCodec.h +++ b/ADApp/pluginSrc/NDPluginCodec.h @@ -3,26 +3,21 @@ #include "NDPluginDriver.h" -#define NDCodecModeString "MODE" /* (NDCodecMode_t r/w) Mode: Compress/Decompress */ -#define NDCodecCompressorString "COMPRESSOR" /* (NDCodecCompressor_t r/w) Which codec to use */ -#define NDCodecCompFactorString "COMP_FACTOR" /* (double r/o) Compression percentage (0 = no compression) */ -#define NDCodecCodecStatusString "CODEC_STATUS" /* (int r/o) Compression status: success or failure */ -#define NDCodecCodecErrorString "CODEC_ERROR" /* (string r/o) Error message if compression fails */ -#define NDCodecJPEGQualityString "JPEG_QUALITY" /* (int r/w) JPEG Compression quality */ -#define NDCodecBloscCompressorString "BLOSC_COMPRESSOR" /* (NDCodecBloscComp_t r/w) Which Blosc compressor to use */ -#define NDCodecBloscCLevelString "BLOSC_CLEVEL" /* (int r/w) Blosc compression level */ -#define NDCodecBloscShuffleString "BLOSC_SHUFFLE" /* (bool r/w) Should Blosc apply shuffling? */ -#define NDCodecBloscNumThreadsString "BLOSC_NUMTHREADS" /* (int r/w) Number of threads to be used by Blosc */ +#define NDCodecModeString "MODE" /* (NDCodecMode_t r/w) Mode: Compress/Decompress */ +#define NDCodecCompressorString "COMPRESSOR" /* (NDCodecCompressor_t r/w) Which codec to use */ +#define NDCodecCompFactorString "COMP_FACTOR" /* (double r/o) Compression percentage (0 = no compression) */ +#define NDCodecCodecStatusString "CODEC_STATUS" /* (int r/o) Compression status: success or failure */ +#define NDCodecCodecErrorString "CODEC_ERROR" /* (string r/o) Error message if compression fails */ +#define NDCodecJPEGQualityString "JPEG_QUALITY" /* (int r/w) JPEG Compression quality */ +#define NDCodecBloscCompressorString "BLOSC_COMPRESSOR" /* (NDCodecBloscComp_t r/w) Which Blosc compressor to use */ +#define NDCodecBloscCLevelString "BLOSC_CLEVEL" /* (int r/w) Blosc compression level */ +#define NDCodecBloscShuffleString "BLOSC_SHUFFLE" /* (bool r/w) Should Blosc apply shuffling? */ +#define NDCodecBloscNumThreadsString "BLOSC_NUMTHREADS" /* (int r/w) Number of threads to be used by Blosc */ +#define NDCodecLZ4HDF5BlockSizeString "LZ4HDF5_BLOCKSIZE" /* (int r/w) Block size for lz4hdf5 compression */ /** Compress/decompress NDArrays according to available codecs. * This plugin is a source of NDArray callbacks, passing the (possibly * compressed/decompressed) NDArray data to clients that register for callbacks. - * The plugin currently supports the following codecs (if available at compile - * time): - *
    - *
  • JPEG
  • - *
  • Blosc
  • - *
*/ typedef enum { @@ -33,6 +28,7 @@ typedef enum { typedef enum { NDCODEC_BLOSC_BLOSCLZ, NDCODEC_BLOSC_LZ4, + NDCODEC_BLOSC_LZ4HDF5, NDCODEC_BLOSC_LZ4HC, NDCODEC_BLOSC_SNAPPY, NDCODEC_BLOSC_ZLIB, @@ -60,6 +56,8 @@ NDArray *compressBlosc(NDArray *input, int clevel, int shuffle, NDCodecBloscComp NDArray *decompressBlosc(NDArray *input, int numThreads, NDCodecStatus_t *status, char *errorMessage); NDArray *compressLZ4(NDArray *input, NDCodecStatus_t *status, char *errorMessage); NDArray *decompressLZ4(NDArray *input, NDCodecStatus_t *status, char *errorMessage); +NDArray *compressLZ4HDF5(NDArray *input, size_t blockSize, NDCodecStatus_t *status, char *errorMessage); +NDArray *decompressLZ4HDF5(NDArray *input, size_t *blockSize, NDCodecStatus_t *status, char *errorMessage); NDArray *compressBSLZ4(NDArray *input, NDCodecStatus_t *status, char *errorMessage); NDArray *decompressBSLZ4(NDArray *input, NDCodecStatus_t *status, char *errorMessage); @@ -87,6 +85,7 @@ class NDPLUGIN_API NDPluginCodec : public NDPluginDriver { int NDCodecBloscCLevel; int NDCodecBloscShuffle; int NDCodecBloscNumThreads; + int NDCodecLZ4HDF5BlockSize; }; diff --git a/RELEASE.md b/RELEASE.md index 92250a20e..4d786aeee 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -19,15 +19,37 @@ the EXAMPLE_RELEASE_PATHS.local, EXAMPLE_RELEASE_LIBS.local, and EXAMPLE_RELEASE files respectively, in the configure/ directory of the appropriate release of the [top-level areaDetector](https://github.com/areaDetector/areaDetector) repository. -## __R3-15 (July XXX 1, 2025)__ +## __R3-15 (April XXX, 2026)__ ### Fixes for Github Actions * Fixed problem with TIRPC in asyn. * Updated from windows-2019 to windows-2022. + +### New NDPluginPvxs plugin + * This is similar NDPluginPva except that it uses the external PVXS library + rather than the pvAccess library from EPICS base. + This support will be included if WITH_PVXS=YES. + Thanks to James Souter for this. ### NDPluginCodec + * Added support for the lz4hdf5 codec. This does LZ4 compression in blocks. + It is the codec used for LZ4 compression on Dectris detectors with the Stream2 interface. + It is also the codec used for writing LZ4 compressed data to HDF5 files. + There are new records LZ4HDF5BlockSize and LZ4HDF5BlockSize_RBV for writing and + reading the blocksize for this codec. + * NOTE: The order of the enums in the Compressor mbbo record has changed so that + LZ4 and LZ4HDF5 are adjacent. + This breaks backwards compatibility for autosave files, and for scripts that use + the enum index rather than string for this record. * Fixed memory leaks in the JPEG compressor and decompressor. Thanks to Evan Daykin for this. +### NDFileHDF + * Added support for direct chunk write for NDArrays compressed with the lz4hd5 codec. + +### Database template files + * Fixed record names in NDROIStat.template to avoid record name duplication. + * Added optional default transform type macro (DFLTTRANSTYPE) in NDTransform.template. + ### ADTop.adl * Added ADHamammatsuDCAM and BlackflyS PGE 23S6C. * Reformatted into 2 columns.