diff --git a/CMakeLists.txt b/CMakeLists.txt old mode 100755 new mode 100644 index 23f4fad04..a2281fb21 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,12 +1,17 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package cmake_minimum_required(VERSION 3.12) project(slsDetectorPackage) -set(PROJECT_VERSION 5.1.0) -include(CheckIPOSupported) +set(PROJECT_VERSION 6.0.0) + set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG") cmake_policy(SET CMP0074 NEW) include(cmake/project_version.cmake) +#functions to add compiler flags +include(cmake/SlsAddFlag.cmake) + # Include additional modules that are used unconditionally include(GNUInstallDirs) @@ -51,7 +56,7 @@ option(SLS_TUNE_LOCAL "tune to local machine" OFF) option(SLS_DEVEL_HEADERS "install headers for devel" OFF) option(SLS_USE_MOENCH "compile zmq and post processing for Moench" OFF) -# set(ClangFormat_BIN_NAME clang-format) + set(ClangFormat_EXCLUDE_PATTERNS "build/" "libs/" "slsDetectorCalibration/" @@ -63,6 +68,7 @@ set(ClangFormat_EXCLUDE_PATTERNS "build/" find_package(ClangFormat) #Enable LTO if available +include(CheckIPOSupported) check_ipo_supported(RESULT SLS_LTO_AVAILABLE) message(STATUS "SLS_LTO_AVAILABLE:" ${SLS_LTO_AVAILABLE}) @@ -82,7 +88,7 @@ target_compile_features(slsProjectOptions INTERFACE cxx_std_11) target_compile_options(slsProjectWarnings INTERFACE -Wall -Wextra - -Wno-unused-parameter #Needs to be slowly mitigated + -Wno-unused-parameter # -Wold-style-cast -Wnon-virtual-dtor -Woverloaded-virtual @@ -93,13 +99,12 @@ target_compile_options(slsProjectWarnings INTERFACE -Wvla -Wdouble-promotion -Werror=return-type - ) #Settings for C code add_library(slsProjectCSettings INTERFACE) -target_compile_features(slsProjectCSettings INTERFACE c_std_99) target_compile_options(slsProjectCSettings INTERFACE + -std=gnu99 #fixed -Wall -Wextra -Wno-unused-parameter @@ -116,31 +121,24 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.2) message(FATAL_ERROR "Clang version must be at least 3.2!") endif() - target_compile_options(slsProjectWarnings INTERFACE -Wshadow) #Clag does not warn on constructor elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) message(FATAL_ERROR "GCC version must be at least 4.8!") endif() - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5) target_compile_options(slsProjectWarnings INTERFACE -Wno-missing-field-initializers) endif() - - if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0) - target_compile_options(slsProjectWarnings INTERFACE - -Wno-misleading-indentation # mostly in rapidjson remove using clang format - -Wduplicated-cond - -Wnull-dereference ) - - endif() - if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0) - target_compile_options(slsProjectWarnings INTERFACE - -Wno-class-memaccess ) - - endif() endif() +# Add or disable warnings depending on if the compiler supports them +# The function checks internally and sets HAS_warning-name +sls_enable_cxx_warning("-Wnull-dereference") +sls_enable_cxx_warning("-Wduplicated-cond") +sls_disable_cxx_warning("-Wclass-memaccess") +sls_disable_c_warning("-Wstringop-truncation") +sls_disable_c_warning("-Wformat-nonliteral") + if(SLS_USE_SANITIZER) target_compile_options(slsProjectOptions INTERFACE -fsanitize=address,undefined -fno-omit-frame-pointer) @@ -187,8 +185,6 @@ if (NOT TARGET libzmq) find_package(ZeroMQ 4 QUIET) endif() - - # libzmq autotools install: fallback to pkg-config if(NOT ZeroMQ_FOUND) message(STATUS "CMake libzmq package not found, trying again with pkg-config (normal install of zeromq)") @@ -212,8 +208,6 @@ if (SLS_USE_TESTS) endif(SLS_USE_TESTS) - - # Common functionallity to detector and receiver add_subdirectory(slsSupportLib) @@ -259,16 +253,12 @@ if(SLS_BUILD_DOCS) add_subdirectory(docs) endif(SLS_BUILD_DOCS) - if(SLS_USE_MOENCH) add_subdirectory(slsDetectorCalibration/moenchExecutables) endif(SLS_USE_MOENCH) if(SLS_MASTER_PROJECT) - # Set install dir CMake packages set(CMAKE_INSTALL_DIR "share/cmake/${PROJECT_NAME}") - # Set the list of exported targets set(PROJECT_LIBRARIES slsSupportShared slsDetectorShared slsReceiverShared) - # Generate and install package config file and version include(cmake/package_config.cmake) endif() diff --git a/COPYING b/COPYING new file mode 100644 index 000000000..59fcd11b7 --- /dev/null +++ b/COPYING @@ -0,0 +1,17 @@ +The SLS Detector Package is provided under: + + SPDX-License-Identifier: LGPL-3.0-or-later + +Being under the terms of the GNU Lesser General Public License version 3 or later, +according with: + + LICENSES/LGPL-3.0 + +Source code under the Apache 2.0 License have the SPDX Identifier and are +according with: + + LICENSES/ThirdParty/Apache-2.0 + +All contributions to the SLS Detector Package are subject to this COPYING file. + + diff --git a/LICENSES/GPL-3.0 b/LICENSES/GPL-3.0 new file mode 100644 index 000000000..16d2eeb5e --- /dev/null +++ b/LICENSES/GPL-3.0 @@ -0,0 +1,688 @@ +Valid-License-Identifier: GPL-3.0 +Valid-License-Identifier: GPL-3.0+ +SPDX-URL: https://spdx.org/licenses/GPL-3.0-or-later.html +Usage-Guide: + To use this license in source code, put one of the following SPDX + tag/value pairs into a comment according to the placement + guidelines in the licensing rules documentation. + For 'GNU Library General Public License (LGPL) version 3.0 only' use: + SPDX-License-Identifier: GPL-3.0 + For 'GNU Library General Public License (LGPL) version 3.0 or any later + version' use: + SPDX-License-Identifier: GPL-3.0-or-later +License-Text: + + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU 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 +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 + (at your option) 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 . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/LICENSES/LGPL-3.0 b/LICENSES/LGPL-3.0 new file mode 100644 index 000000000..4f5dc3f1a --- /dev/null +++ b/LICENSES/LGPL-3.0 @@ -0,0 +1,179 @@ +Valid-License-Identifier: LGPL-3.0 +Valid-License-Identifier: LGPL-3.0+ +SPDX-URL: https://spdx.org/licenses/LGPL-3.0-or-later.html +Usage-Guide: + To use this license in source code, put one of the following SPDX + tag/value pairs into a comment according to the placement + guidelines in the licensing rules documentation. + For 'GNU Library General Public License (LGPL) version 3.0 only' use: + SPDX-License-Identifier: LGPL-3.0 + For 'GNU Library General Public License (LGPL) version 3.0 or any later + version' use: + SPDX-License-Identifier: LGPL-3.0-or-later +License-Text: + + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 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: + + 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. + + 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/LICENSES/Third Party/Apache-2.0 b/LICENSES/Third Party/Apache-2.0 new file mode 100644 index 000000000..ffd8b79df --- /dev/null +++ b/LICENSES/Third Party/Apache-2.0 @@ -0,0 +1,210 @@ +Valid-License-Identifier: Apache-2.0 +SPDX-URL: https://spdx.org/licenses/Apache-2.0.html +Usage-Guide: + To use this license in source code, put one of the following SPDX + tag/value pairs into a comment according to the placement + guidelines in the licensing rules documentation. + SPDX-License-Identifier: Apache-2.0 +License-Text: + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md index a97088365..a646d587a 100755 --- a/README.md +++ b/README.md @@ -4,7 +4,11 @@ Please do not update to any xxxx.xx.xx.dev0 tags. They are not releases, but tag Use only releases with tags such as x.x.x or x.x.x-rcx. ### Documentation -Detailed documentation on the latest release of 5.0.0 can be found in the [software wiki](https://slsdetectorgroup.github.io/devdoc/index.html) and on the [official site](https://www.psi.ch/en/detectors/software). +##### 5.0.0 - Latest Release +Detailed documentation on the latest release can be found in the [software wiki](https://slsdetectorgroup.github.io/devdoc/index.html) and on the [official site](https://www.psi.ch/en/detectors/software). + +##### Older Releases +Documentation is found in the package. ### Binaries Binaries for the slsDetectorPackage are available through conda. @@ -45,7 +49,7 @@ These are mainly aimed at those not familiar with using ccmake and cmake. ``` The binaries are generated in slsDetectorPackage/build/bin directory. - Usage: $0 [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [m] [n] [-h] [z] [-d ] [-l Install directory] [-k ] [-j ] + Usage: ./cmk.sh [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [m] [n] [-h] [z] [-d ] [-l Install directory] [-k ] [-j ] -[no option]: only make -c: Clean -b: Builds/Rebuilds CMake files normal mode @@ -65,6 +69,7 @@ These are mainly aimed at those not familiar with using ccmake and cmake. -m: Manuals -n: Manuals without compiling doxygen (only rst) -z: Moench zmq processor + # get all options ./cmk.sh -? @@ -90,3 +95,8 @@ To install binaries using CMake make -j12 #or whatever number of cores you are using to build make install ``` + + +### Support + dhanya.thattil@psi.ch + erik.frojdh@psi.ch \ No newline at end of file diff --git a/RELEASE.txt b/RELEASE.txt index dcd4f14d8..27cd5cec7 100755 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -1,7 +1,7 @@ -SLS Detector Package 6.0.0 released on xx.10.2021 (Major Release) -=================================================================== +SLS Detector Package 6.0.0 released on 21.10.2021 +================================================== -This document describes the differences between 6.0.0 and 5.2.0 releases. +This document describes the differences between v6.0.0 and v5.1.0. @@ -10,8 +10,9 @@ This document describes the differences between 6.0.0 and 5.2.0 releases. 1. New or Changed Features 2. Resolved Issues 3. Known Issues - 4. Firmware Requirements - 5. Download, Documentation & Support + 4. Changes in Next Major Release + 5. Firmware Requirements + 6. Download, Documentation & Support @@ -21,52 +22,47 @@ This document describes the differences between 6.0.0 and 5.2.0 releases. Client ------ + 1. Shared libraries + They are versioned from this release on. - 1. [Jungfrau] Chip version + 2. [Jungfrau] Chip version Features for chipv1.1 incorporated Command line: chipversion, API: getchipVersion gets chip version (1.0 or 1.1) chipv1.1 requires config_jungfrau.txt on detector server. - 2. [Jungfrau] Chip configuration (only chipv1.1) + 3. [Jungfrau] Chip configuration (only chipv1.1) powering on the chip and changing settings will configure the chip. Hence, required before acquisition. - 3. [Jungfrau] Settings and Gain mode + 4. [Jungfrau] Settings and Gain mode Settings can be gain0 and highgain0. Gain mode can be dynamicgain, forceswitchg1, forceswitchg2, fixg1, fixg2, fixg0. fixg0 must be used with EXTRA caution as you can damage the detector. Changing settings also changes dac values of 3 dacs () and reconfigures chip (only v1.1) - 4. [Jungfrau] Storage cells (only chipv1.1) + 5. [Jungfrau] Storage cells (only chipv1.1) Additional number of storage cells not applicable for chipv1.1. Storage cell start is only allowed from 0 - 3 for chipv1.1 (0 - 15 for chipv1.0). - 5. [Gotthard2][Jungfrau] Filter Resistor + 6. [Gotthard2][Jungfrau] Filter Resistor Command line: filterresistor, API: getFilterResistor/ setFilterResistor Previous Command: filter, setFilter/ getFilter Set Filter resistor. Increasing values for increasing resistance. [Jungfrau] only for chipv1.1. Options: [0|1]. Default is 1. [Gotthard2] Options: [0|1|2|3]. Default is 0. - 6. [Jungfrau] Filter cell (only chipv1.1) + 7. [Jungfrau] Filter cell (only chipv1.1) Command line: filtercell, API: getFilterCell/ setFilterCell Set filter cell. Options: [0-12]. Advanced user command. - 7. [Jungfrau] Comparator disable time (only chipv1.1) + 8. [Jungfrau] Comparator disable time (only chipv1.1) Command line: comp_disable_time, API: getComparatorDisableTime/ setComparatorDisableTime One can customize the period to disable comparator. - 8. [Eiger][Jungfrau] Flip rows - Command line: fliprows, API: getFlipRows/ setFlipRows - Previous command: flippeddatax, setBottom/ getBottom - [Jungfrau] Flips rows in detector only for HW v2.0. - slsReceiver and slsDetectorGui will not flip them again. - [Eiger] same as before. - 9. [Eiger][Jungfrau] Read n rows Command line: readnrows, API: getReadNRows/ setReadNRows Previous Command: readnlines, getPartialReadout/ setPartialReadout @@ -164,6 +160,20 @@ This document describes the differences between 6.0.0 and 5.2.0 releases. This will only affect shared memory and will not try to change the current tcp port of the control/stop server in detector. + 26. [Eiger][Jungfrau][Gotthard2] Speed + Command line: readoutspeed, readoutspeedlist API: getReadoutSpeed/ setReadoutSpeed / + getReadoutSpeedList + Previous command: speed, setSpeed/ getSpeed + [Eiger][Jungfrau] same as before. + [Gotthard2] New command to set readout speed. Options: 108, 144 (in MHz) + + 27. [Eiger][Jungfrau] Flip rows + Command line: fliprows, API: getFlipRows/ setFlipRows + Previous command: flippeddatax, setBottom/ getBottom + [Jungfrau] Flips rows in detector only for HW v2.0. + slsReceiver and slsDetectorGui will not flip them again. + [Eiger] same as before. + Detector servers ---------------- @@ -200,6 +210,8 @@ This document describes the differences between 6.0.0 and 5.2.0 releases. 1. [Mythen3] counters added in settings tab + + 2. Resolved Issues ================== @@ -230,6 +242,10 @@ This document describes the differences between 6.0.0 and 5.2.0 releases. values. 7. [Eiger] fast quad fix for loading trimbits + + 8. [Eiger] Can also use copydetectorserver command. + [All] copydetectorserver command also creates a link to the binary compied + with a shorter name ([detector]DetectorServer only) Receiver -------- @@ -237,21 +253,46 @@ This document describes the differences between 6.0.0 and 5.2.0 releases. 1. Disabled port or deactivated (half) modules will not create files. -- better control of what is built (PR)? -- cmake package has hardcoded path to zeromq library -3. Firmware Requirements +3. Known Issues +=============== + + Receiver + -------- + 1. It does not handle readnrows or partial readout. Only the summary + is adjusted to print in red. However, it will still write complete + images with missing data padded. Roi will be implemented in future + that can be complimented with this feature to remove the additional + data in files. + + 2. Round robin is not implemented in receiver side, ie. one cannot configure + more than 1 receiver at a time. This will/might be done in the future. + + + + +4. Changes in Next Major Release +================================ + + 1. Naming of Package + The package might be renamed and so might the binaries, libraries, + namespace,include paths in the next major release (which is breaking API). + + + + +5. Firmware Requirements ======================== Eiger ===== - Compatible version : 08.09.2020 (v27) + Compatible version : 08.10.2021 (v29) Jungfrau ======== Compatible version : 31.08.2021 (v1.2, PCB v1.0) - : 10.09.2021 (v2.2, PCB v2.0) + : 08.10.2021 (v2.2, PCB v2.0) Gotthard ======== @@ -264,7 +305,7 @@ This document describes the differences between 6.0.0 and 5.2.0 releases. Gotthard2 ========= - Compatible version : 27.05.2021 (development) + Compatible version : 27.05.2021 (v1.0) Moench ====== @@ -296,23 +337,6 @@ This document describes the differences between 6.0.0 and 5.2.0 releases. - -5. Known Issues -=============== - - Receiver - -------- - 1. It does not handle readnrows or partial readout. Only the summary - is adjusted to print in red. However, it will still write complete - images with missing data padded. Roi will be implemented in future - that can be complimented with this feature to remove the additional - data in files. - - 2. Round robin is not implemented in receiver side, ie. one cannot configure - more than 1 receiver at a time. This will/might be done in the future. - - - 6. Download, Documentation & Support ==================================== diff --git a/cmake/SlsAddFlag.cmake b/cmake/SlsAddFlag.cmake new file mode 100644 index 000000000..b4f754afc --- /dev/null +++ b/cmake/SlsAddFlag.cmake @@ -0,0 +1,64 @@ +include(CheckCXXCompilerFlag) +include(CheckCCompilerFlag) + + +function(enable_cxx_warning flag target) + string(REPLACE "-W" "HAS_" flag_name ${flag}) + check_cxx_compiler_flag(${flag} ${flag_name}) + if(${flag_name}) + target_compile_options(${target} INTERFACE ${flag}) + message("Adding: ${flag} to ${target}") + else() + message("Flag: ${flag} not supported") + endif() +endfunction() + +function(enable_c_warning flag target) + string(REPLACE "-W" "HAS_" flag_name ${flag}) + check_c_compiler_flag(${flag} ${flag_name}) + if(${flag_name}) + target_compile_options(${target} INTERFACE ${flag}) + message("Adding: ${flag} to ${target}") + else() + message("Flag: ${flag} not supported") + endif() +endfunction() + + +function(disable_cxx_warning flag target) + string(REPLACE "-W" "HAS_" flag_name ${flag}) + check_cxx_compiler_flag(${flag} ${flag_name}) + + if(${flag_name}) + string(REPLACE "-W" "-Wno-" neg_flag ${flag}) + message("Adding: ${neg_flag} to ${target}") + target_compile_options(${target} INTERFACE ${neg_flag}) + else() + message("Warning: ${flag} not supported no need to disable") + endif() +endfunction() + +function(disable_c_warning flag target) + string(REPLACE "-W" "HAS_" flag_name ${flag}) + check_c_compiler_flag(${flag} ${flag_name}) + if(${flag_name}) + string(REPLACE "-W" "-Wno-" neg_flag ${flag}) + message("Adding: ${neg_flag} to ${target}") + target_compile_options(${target} INTERFACE ${neg_flag}) + else() + message("Warning: ${flag} not supported no need to disable") + endif() +endfunction() + + +function(sls_disable_c_warning flag) + disable_c_warning(${flag} slsProjectCSettings) +endfunction() + +function(sls_enable_cxx_warning flag) + enable_cxx_warning(${flag} slsProjectWarnings) +endfunction() + +function(sls_disable_cxx_warning flag) + disable_cxx_warning(${flag} slsProjectWarnings) +endfunction() \ No newline at end of file diff --git a/cmk.sh b/cmk.sh index bceabc589..0bfe0d918 100755 --- a/cmk.sh +++ b/cmk.sh @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package #!/bin/bash CMAKE="cmake3" BUILDDIR="build" diff --git a/conda-recepie/build.sh b/conda-recepie/build.sh index d7558adc5..62b9ca1d9 100755 --- a/conda-recepie/build.sh +++ b/conda-recepie/build.sh @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package mkdir build mkdir install diff --git a/conda-recepie/build_pylib.sh b/conda-recepie/build_pylib.sh index fb8723e22..f7cbdc496 100755 --- a/conda-recepie/build_pylib.sh +++ b/conda-recepie/build_pylib.sh @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package echo "|<-------- starting python build" cd python diff --git a/conda-recepie/copy_ctbgui.sh b/conda-recepie/copy_ctbgui.sh index 91ebc1a6d..b4f52efce 100644 --- a/conda-recepie/copy_ctbgui.sh +++ b/conda-recepie/copy_ctbgui.sh @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package mkdir $PREFIX/lib mkdir $PREFIX/bin mkdir $PREFIX/include diff --git a/conda-recepie/copy_gui.sh b/conda-recepie/copy_gui.sh index c35d018b0..a6bce55d8 100755 --- a/conda-recepie/copy_gui.sh +++ b/conda-recepie/copy_gui.sh @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package #Copy the GUI mkdir -p $PREFIX/bin cp build/install/bin/slsDetectorGui $PREFIX/bin/. diff --git a/conda-recepie/copy_lib.sh b/conda-recepie/copy_lib.sh index e153ad869..71870c916 100755 --- a/conda-recepie/copy_lib.sh +++ b/conda-recepie/copy_lib.sh @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package mkdir -p $PREFIX/lib mkdir -p $PREFIX/bin diff --git a/conda-recepie/copy_moench.sh b/conda-recepie/copy_moench.sh index 7b4d34c74..7c4742f32 100644 --- a/conda-recepie/copy_moench.sh +++ b/conda-recepie/copy_moench.sh @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package #Copy the Moench executables mkdir -p $PREFIX/bin cp build/install/bin/moench04ZmqProcess $PREFIX/bin/. diff --git a/conda-recepie/run_test.sh b/conda-recepie/run_test.sh index e707b86f7..24068d625 100755 --- a/conda-recepie/run_test.sh +++ b/conda-recepie/run_test.sh @@ -1 +1,3 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package ctest -j2 \ No newline at end of file diff --git a/ctbGui/CMakeLists.txt b/ctbGui/CMakeLists.txt index 758d8175d..c6371ea92 100644 --- a/ctbGui/CMakeLists.txt +++ b/ctbGui/CMakeLists.txt @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package find_package(ROOT CONFIG REQUIRED COMPONENTS Core Gui) diff --git a/ctbGui/Makefile.root5 b/ctbGui/Makefile.root5 index 698a06e4c..050acbc17 100644 --- a/ctbGui/Makefile.root5 +++ b/ctbGui/Makefile.root5 @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package INCS=ctbMain.h ctbDacs.h ctbPattern.h ctbSignals.h ctbAdcs.h ctbAcquisition.h ctbPowers.h ctbSlowAdcs.h diff --git a/ctbGui/Makefile.root6 b/ctbGui/Makefile.root6 index 1c4c552ce..338949617 100644 --- a/ctbGui/Makefile.root6 +++ b/ctbGui/Makefile.root6 @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package INCS=ctbMain.h ctbDacs.h ctbPattern.h ctbSignals.h ctbAdcs.h ctbAcquisition.h ctbPowers.h ctbSlowAdcs.h diff --git a/ctbGui/ctbAcquisition.cpp b/ctbGui/ctbAcquisition.cpp old mode 100755 new mode 100644 index d719802ff..d545ac680 --- a/ctbGui/ctbAcquisition.cpp +++ b/ctbGui/ctbAcquisition.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package //#define TESTADC diff --git a/ctbGui/ctbAcquisition.h b/ctbGui/ctbAcquisition.h old mode 100755 new mode 100644 index 212bc5e1a..7693b177b --- a/ctbGui/ctbAcquisition.h +++ b/ctbGui/ctbAcquisition.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef CTBACQUISITION_H #define CTBACQUISITION_H #include diff --git a/ctbGui/ctbAdcs.cpp b/ctbGui/ctbAdcs.cpp old mode 100755 new mode 100644 index dbf2b4e63..694f5ff13 --- a/ctbGui/ctbAdcs.cpp +++ b/ctbGui/ctbAdcs.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include #include #include diff --git a/ctbGui/ctbAdcs.h b/ctbGui/ctbAdcs.h old mode 100755 new mode 100644 index 5e85891de..3a4cf35da --- a/ctbGui/ctbAdcs.h +++ b/ctbGui/ctbAdcs.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package diff --git a/ctbGui/ctbDacs.cpp b/ctbGui/ctbDacs.cpp old mode 100755 new mode 100644 index f386492f6..dd2763fdf --- a/ctbGui/ctbDacs.cpp +++ b/ctbGui/ctbDacs.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include #include diff --git a/ctbGui/ctbDacs.h b/ctbGui/ctbDacs.h old mode 100755 new mode 100644 index aa19720f3..818c0c42d --- a/ctbGui/ctbDacs.h +++ b/ctbGui/ctbDacs.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef CTBDACS_H diff --git a/ctbGui/ctbDefs.h b/ctbGui/ctbDefs.h old mode 100755 new mode 100644 index 6cfad7fa1..85d7e1b8a --- a/ctbGui/ctbDefs.h +++ b/ctbGui/ctbDefs.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include diff --git a/ctbGui/ctbGui.cpp b/ctbGui/ctbGui.cpp old mode 100755 new mode 100644 index 50df983eb..5c34d8ee0 --- a/ctbGui/ctbGui.cpp +++ b/ctbGui/ctbGui.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include #include diff --git a/ctbGui/ctbLinkDef.h b/ctbGui/ctbLinkDef.h old mode 100755 new mode 100644 index dd61a0bba..f041a01fd --- a/ctbGui/ctbLinkDef.h +++ b/ctbGui/ctbLinkDef.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma link C++ class ctbMain; #pragma link C++ class ctbDacs; #pragma link C++ class ctbDac; diff --git a/ctbGui/ctbMain.cpp b/ctbGui/ctbMain.cpp old mode 100755 new mode 100644 index d5d698e74..0308589bb --- a/ctbGui/ctbMain.cpp +++ b/ctbGui/ctbMain.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include #include #include diff --git a/ctbGui/ctbMain.h b/ctbGui/ctbMain.h old mode 100755 new mode 100644 index 9f2b9b3fb..34ff8d429 --- a/ctbGui/ctbMain.h +++ b/ctbGui/ctbMain.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef CTBMAIN_H #define CTBMAIN_H #include diff --git a/ctbGui/ctbPattern.cpp b/ctbGui/ctbPattern.cpp old mode 100755 new mode 100644 index 7e902db50..5d3d49a5e --- a/ctbGui/ctbPattern.cpp +++ b/ctbGui/ctbPattern.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include #include #include diff --git a/ctbGui/ctbPattern.h b/ctbGui/ctbPattern.h old mode 100755 new mode 100644 index 0bb565f4b..6f85974a1 --- a/ctbGui/ctbPattern.h +++ b/ctbGui/ctbPattern.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef CTBPATTERN_H #define CTBPATTERN_H #include diff --git a/ctbGui/ctbPowers.cpp b/ctbGui/ctbPowers.cpp index 42a3eca81..498ec2c13 100644 --- a/ctbGui/ctbPowers.cpp +++ b/ctbGui/ctbPowers.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include diff --git a/ctbGui/ctbPowers.h b/ctbGui/ctbPowers.h index e7a47bdfe..d0c39f1c7 100644 --- a/ctbGui/ctbPowers.h +++ b/ctbGui/ctbPowers.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef CTBPOWERS_H #define CTBPOWERS_H diff --git a/ctbGui/ctbSignals.cpp b/ctbGui/ctbSignals.cpp old mode 100755 new mode 100644 index 84cd221fc..f1e0c840f --- a/ctbGui/ctbSignals.cpp +++ b/ctbGui/ctbSignals.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include #include #include diff --git a/ctbGui/ctbSignals.h b/ctbGui/ctbSignals.h old mode 100755 new mode 100644 index 08e524f74..eb3deb221 --- a/ctbGui/ctbSignals.h +++ b/ctbGui/ctbSignals.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef CTBSIGNALS_H #define CTBSIGNALS_H #include diff --git a/ctbGui/ctbSlowAdcs.cpp b/ctbGui/ctbSlowAdcs.cpp index 8228fe117..6507e0d17 100644 --- a/ctbGui/ctbSlowAdcs.cpp +++ b/ctbGui/ctbSlowAdcs.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include #include diff --git a/ctbGui/ctbSlowAdcs.h b/ctbGui/ctbSlowAdcs.h index f49daeb3d..a25bbe5b1 100644 --- a/ctbGui/ctbSlowAdcs.h +++ b/ctbGui/ctbSlowAdcs.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef CTBSLOWADCS_H diff --git a/ctbGui/patternGenerator/deserializer.cpp b/ctbGui/patternGenerator/deserializer.cpp index c315ca419..0a52f4ad9 100644 --- a/ctbGui/patternGenerator/deserializer.cpp +++ b/ctbGui/patternGenerator/deserializer.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include #include diff --git a/ctbGui/patternGenerator/generate.sh b/ctbGui/patternGenerator/generate.sh index 6f5512c8c..0887503be 100755 --- a/ctbGui/patternGenerator/generate.sh +++ b/ctbGui/patternGenerator/generate.sh @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package if [ "$#" -eq 0 ]; then echo "Wrong number of arguments: usage should be $0 patname" exit 1 diff --git a/ctbGui/patternGenerator/generator.c b/ctbGui/patternGenerator/generator.c old mode 100755 new mode 100644 index ae3e1c8b7..c6c7406a8 --- a/ctbGui/patternGenerator/generator.c +++ b/ctbGui/patternGenerator/generator.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package /**************************************************************************** usage to generate a patter test.pat from test.p diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 524c41f93..7f3fa8c04 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package find_package(Doxygen REQUIRED) find_package(Sphinx REQUIRED) diff --git a/docs/src/gendoc.cpp b/docs/src/gendoc.cpp index 6d3278850..9044f563e 100644 --- a/docs/src/gendoc.cpp +++ b/docs/src/gendoc.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package /** * Utility program to generate input files for the command line * documentation. Uses the string returned from sls_detector_help cmd diff --git a/evalVersionVariables.sh b/evalVersionVariables.sh index 5824ca13c..6cd4d8b8f 100755 --- a/evalVersionVariables.sh +++ b/evalVersionVariables.sh @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package GITREPO1='git remote -v' GITREPO2=" | grep \"fetch\" | cut -d' ' -f1" BRANCH1='git branch -v' diff --git a/genVersionHeader.sh b/genVersionHeader.sh index 12b5d8c26..5b1ee9076 100755 --- a/genVersionHeader.sh +++ b/genVersionHeader.sh @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package #####! /bin/awk -f diff --git a/integrationTests/CMakeLists.txt b/integrationTests/CMakeLists.txt index 5aba78ee0..a270593fe 100755 --- a/integrationTests/CMakeLists.txt +++ b/integrationTests/CMakeLists.txt @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package # MESSAGE( STATUS "CMAKE_CURRENT_SOURCE_DIR: " ${CMAKE_CURRENT_SOURCE_DIR} ) # MESSAGE( STATUS "PROJECT_SOURCE_DIR: " ${PROJECT_SOURCE_DIR} ) diff --git a/integrationTests/test-eigerIntegration.cpp b/integrationTests/test-eigerIntegration.cpp index a02b85677..0f7fea11f 100644 --- a/integrationTests/test-eigerIntegration.cpp +++ b/integrationTests/test-eigerIntegration.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "DetectorImpl.h" #include "catch.hpp" #include "sls/string_utils.h" diff --git a/integrationTests/test-integrationDectector.cpp b/integrationTests/test-integrationDectector.cpp index 3dc71326a..9d0847b4f 100644 --- a/integrationTests/test-integrationDectector.cpp +++ b/integrationTests/test-integrationDectector.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "catch.hpp" diff --git a/integrationTests/test-integrationMulti.cpp b/integrationTests/test-integrationMulti.cpp index eaa5edd11..3dd6b1903 100644 --- a/integrationTests/test-integrationMulti.cpp +++ b/integrationTests/test-integrationMulti.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "DetectorImpl.h" #include "catch.hpp" #include "sls/string_utils.h" diff --git a/integrationTests/test.cpp b/integrationTests/test.cpp index 8daed99c4..39e7230ab 100755 --- a/integrationTests/test.cpp +++ b/integrationTests/test.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package // tests-main.cpp #define CATCH_CONFIG_MAIN #include "catch.hpp" \ No newline at end of file diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 8337a811b..21c02761a 100755 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package pybind11_add_module(_slsdet src/main.cpp diff --git a/python/README.md b/python/README.md deleted file mode 100755 index 619ff6def..000000000 --- a/python/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# sls_detector: Python interface to slsDetectorPackage -Python interface to the Sls Detector Software. - -### Documentation ### -Sphinx built documentation is available here: -[https://slsdetectorgroup.github.io/sls_detector/](https://slsdetectorgroup.github.io/sls_detector/) - - -### Install using conda ### - -Binaries are available using conda. This installs both the detector software and the Python -interface. - -```bash -#Add conda channels -conda config --add channels conda-forge -conda config --add channels slsdetectorgroup - -#Install latest version -conda install sls_detector - -#Install specific version -conda install sls_detector=3.0.1 - -#Scientific Linux 6 version (GLIBC2.12) -conda install sls_detector=SL6_3.0.1 -``` - -### Building using conda-build ### - -Needs [sls_detector_software](https://github.com/slsdetectorgroup/sls_detector_software) installed. - -```bash -#Clone source code -git clone https://github.com/slsdetectorgroup/sls_detector.git - -#Checkout the branch needed -git checkout 3.0.1 - -#Build and install the local version -conda-build sls_detector -conda install --use-local sls_detector - - -``` -### Developer build ### - -IF you if you are developing and are making constant changes to the code it's a bit cumbersome -to build with conda and install. Then an easier way is to build the C/C++ parts in the package -directory and temporary add this to the path - -```bash -#in path/to/sls_detector -python setup.py build_ext --inplace -``` -Then in your Python script -```python - -import sys -sys.path.append('/path/to/sls_detector') -from sls_detector import Detector -``` - diff --git a/python/examples/exposure_time.py b/python/examples/exposure_time.py index eab8c12f0..510562f27 100644 --- a/python/examples/exposure_time.py +++ b/python/examples/exposure_time.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package """ Example showing how to set and get exposure times """ diff --git a/python/examples/manipulate_pattern.py b/python/examples/manipulate_pattern.py index 0e11979c3..9d5263ef8 100644 --- a/python/examples/manipulate_pattern.py +++ b/python/examples/manipulate_pattern.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package from slsdet import Detector, patternParameters diff --git a/python/examples/non-blocking-acquire-process.py b/python/examples/non-blocking-acquire-process.py index 486a3dd93..0d7c41f98 100644 --- a/python/examples/non-blocking-acquire-process.py +++ b/python/examples/non-blocking-acquire-process.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package import time from multiprocessing import Process from slsdet import Detector, runStatus diff --git a/python/examples/non-blocking-acquire.py b/python/examples/non-blocking-acquire.py index dd434b2a0..de430f677 100644 --- a/python/examples/non-blocking-acquire.py +++ b/python/examples/non-blocking-acquire.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package import time from slsdet import Detector, runStatus diff --git a/python/examples/reading_dacs.py b/python/examples/reading_dacs.py index 8a17b1b61..8b208f0ce 100644 --- a/python/examples/reading_dacs.py +++ b/python/examples/reading_dacs.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package from slsdet import Detector, Eiger, dacIndex diff --git a/python/examples/reading_temperature.py b/python/examples/reading_temperature.py index e167e3860..2b88d3ddb 100644 --- a/python/examples/reading_temperature.py +++ b/python/examples/reading_temperature.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package from slsdet import Detector, Eiger, dacIndex diff --git a/python/examples/threshold_scan.py b/python/examples/threshold_scan.py index 6505b64b3..aa81b57a0 100644 --- a/python/examples/threshold_scan.py +++ b/python/examples/threshold_scan.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package from slsdet import Eiger d = Eiger() diff --git a/python/examples/use_currentsource.py b/python/examples/use_currentsource.py index a895126b0..7b61f3199 100644 --- a/python/examples/use_currentsource.py +++ b/python/examples/use_currentsource.py @@ -1,10 +1,12 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package from slsdet import Detector, currentSrcParameters s = currentSrcParameters() -s.enable_ = 1 -s.fix_= 1 -s.normal_ = 1 -s.select_ = 10 +s.enable = 1 +s.fix= 1 +s.normal = 1 +s.select = 10 d = Detector() diff --git a/python/examples/use_enum.py b/python/examples/use_enum.py index 8e8eaf210..1b7298298 100644 --- a/python/examples/use_enum.py +++ b/python/examples/use_enum.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package # Most settings are represented as enums that can be # explicitly imported diff --git a/python/examples/using_scan.py b/python/examples/using_scan.py index 2d8f5a74a..c665eb40a 100644 --- a/python/examples/using_scan.py +++ b/python/examples/using_scan.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package from slsdet import Mythen3, scanParameters, dacIndex diff --git a/python/scripts/basic.py b/python/scripts/basic.py index 2135b4a58..f07e8285b 100755 --- a/python/scripts/basic.py +++ b/python/scripts/basic.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package import os import sys import numpy as np diff --git a/python/scripts/compare_with_commandline.py b/python/scripts/compare_with_commandline.py index 9d4474b20..3a584252c 100644 --- a/python/scripts/compare_with_commandline.py +++ b/python/scripts/compare_with_commandline.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package import subprocess import locale out = subprocess.run(['g', 'list'], stdout = subprocess.PIPE, encoding=locale.getpreferredencoding()) diff --git a/python/scripts/compile_servers.py b/python/scripts/compile_servers.py index e3395a06f..30422d110 100644 --- a/python/scripts/compile_servers.py +++ b/python/scripts/compile_servers.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package import subprocess import os import sys diff --git a/python/scripts/generate_enums.py b/python/scripts/generate_enums.py index bfc02897b..a3e9b534e 100644 --- a/python/scripts/generate_enums.py +++ b/python/scripts/generate_enums.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package """ Code generator for enum bindings in the Python extension. Reads the sls_detector_defs.h and enums_in.cpp then outputs diff --git a/python/scripts/generate_functions.py b/python/scripts/generate_functions.py index 5a955e63b..242cd2bb3 100644 --- a/python/scripts/generate_functions.py +++ b/python/scripts/generate_functions.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package """ This file is used to auto generate Python bindings for the sls::Detector class. The tool needs the libclang bindings diff --git a/python/scripts/list_tested_cmd.py b/python/scripts/list_tested_cmd.py index 4e4cbe6c8..4ccda78d9 100755 --- a/python/scripts/list_tested_cmd.py +++ b/python/scripts/list_tested_cmd.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package """ Utility to find and list which command line functions have tests and where the tests are located diff --git a/python/scripts/parse.py b/python/scripts/parse.py index c8b44ec8c..310a6af36 100644 --- a/python/scripts/parse.py +++ b/python/scripts/parse.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package import re import subprocess from subprocess import PIPE diff --git a/python/scripts/test_virtual.py b/python/scripts/test_virtual.py index 2024194ac..f7d11b03b 100644 --- a/python/scripts/test_virtual.py +++ b/python/scripts/test_virtual.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package import pytest import subprocess import os diff --git a/python/setup.py b/python/setup.py index 2e6422031..6a4c6bbed 100755 --- a/python/setup.py +++ b/python/setup.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package """ Setup file for slsdet Build upon the pybind11 example found here: https://github.com/pybind/python_example @@ -25,6 +27,7 @@ ext_modules = [ Pybind11Extension( '_slsdet', ['src/main.cpp', + 'src/current.cpp', 'src/enums.cpp', 'src/detector.cpp', 'src/network.cpp', diff --git a/python/slsdet/__init__.py b/python/slsdet/__init__.py index 698224525..4055393e8 100755 --- a/python/slsdet/__init__.py +++ b/python/slsdet/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package # from .detector import Detector, DetectorError, free_shared_memory from .eiger import Eiger from .ctb import Ctb diff --git a/python/slsdet/adcs.py b/python/slsdet/adcs.py index 9534a38cb..e57d3e260 100755 --- a/python/slsdet/adcs.py +++ b/python/slsdet/adcs.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package from functools import partial class Adc: def __init__(self, name, enum, detector): diff --git a/python/slsdet/ctb.py b/python/slsdet/ctb.py index 73a2328e7..10afd3ae3 100644 --- a/python/slsdet/ctb.py +++ b/python/slsdet/ctb.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package from .detector import Detector from .utils import element_if_equal from .dacs import DetectorDacs diff --git a/python/slsdet/dacs.py b/python/slsdet/dacs.py index 2ce69a4a1..5628eb3a6 100755 --- a/python/slsdet/dacs.py +++ b/python/slsdet/dacs.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package from .detector_property import DetectorProperty from functools import partial import numpy as np diff --git a/python/slsdet/decorators.py b/python/slsdet/decorators.py index 8e8f2c600..6fb1d06cf 100755 --- a/python/slsdet/decorators.py +++ b/python/slsdet/decorators.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ diff --git a/python/slsdet/detector.py b/python/slsdet/detector.py index 94f9ec483..6c610de27 100755 --- a/python/slsdet/detector.py +++ b/python/slsdet/detector.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package from _slsdet import CppDetectorApi from _slsdet import slsDetectorDefs from _slsdet import IpAddr, MacAddr @@ -1645,20 +1647,22 @@ class Detector(CppDetectorApi): @property @element - def speed(self): + def readoutspeed(self): """ - [Eiger][Jungfrau] Readout speed of chip. Enum: speedLevel + [Eiger][Jungfrau|Gotthard2] Readout speed of chip. Enum: speedLevel Note ----- - Options: FULL_SPEED, HALF_SPEED, QUARTER_SPEED \n - [Jungfrau] FULL_SPEED option only available from v2.0 boards and with setting number of interfaces to 2. \n + [Jungfrau] FULL_SPEED, HALF_SPEED (Default), QUARTER_SPEED + [Eiger] FULL_SPEED (Default), HALF_SPEED, QUARTER_SPEED + [Gottthard2] G2_108MHZ (Default), G2_144MHZ + [Jungfrau] FULL_SPEED option only available from v2.0 boards and is recommended to set number of interfaces to 2. \n Also overwrites adcphase to recommended default. """ - return element_if_equal(self.getSpeed()) + return element_if_equal(self.getReadoutSpeed()) - @speed.setter - def speed(self, value): - ut.set_using_dict(self.setSpeed, value) + @readoutspeed.setter + def readoutspeed(self, value): + ut.set_using_dict(self.setReadoutSpeed, value) @property def rx_jsonpara(self): @@ -2216,6 +2220,7 @@ class Detector(CppDetectorApi): def gainmode(self): """ [Jungfrau] Detector gain mode. Enum: gainMode + Note ----- [Jungfrau] DYNAMIC, FORCE_SWITCH_G1, FORCE_SWITCH_G2, FIX_G1, FIX_G2, FIX_G0 \n diff --git a/python/slsdet/detector_property.py b/python/slsdet/detector_property.py index 3ca69ed36..c7b49b03e 100755 --- a/python/slsdet/detector_property.py +++ b/python/slsdet/detector_property.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package from collections.abc import Iterable import numpy as np diff --git a/python/slsdet/eiger.py b/python/slsdet/eiger.py index 3e45b1e1d..a65532677 100755 --- a/python/slsdet/eiger.py +++ b/python/slsdet/eiger.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ diff --git a/python/slsdet/enums.py b/python/slsdet/enums.py index fdbfe7d2f..02e3c5126 100644 --- a/python/slsdet/enums.py +++ b/python/slsdet/enums.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package """ Automatically improt all enums from slsDetectorDefs and give an alias with their name in the enum module. All names from the enum diff --git a/python/slsdet/errors.py b/python/slsdet/errors.py index f16ceeb9f..51a24a5cb 100755 --- a/python/slsdet/errors.py +++ b/python/slsdet/errors.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ diff --git a/python/slsdet/gotthard.py b/python/slsdet/gotthard.py index ea33b7462..9468c78a3 100644 --- a/python/slsdet/gotthard.py +++ b/python/slsdet/gotthard.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ diff --git a/python/slsdet/gotthard2.py b/python/slsdet/gotthard2.py index 8194c7a96..bdb36097f 100644 --- a/python/slsdet/gotthard2.py +++ b/python/slsdet/gotthard2.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ diff --git a/python/slsdet/jungfrau.py b/python/slsdet/jungfrau.py index bd92ac757..9da5b7771 100644 --- a/python/slsdet/jungfrau.py +++ b/python/slsdet/jungfrau.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ diff --git a/python/slsdet/lookup.py b/python/slsdet/lookup.py index be157841d..9bb99fe29 100644 --- a/python/slsdet/lookup.py +++ b/python/slsdet/lookup.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package from .detector import Detector def view(name, det = Detector): diff --git a/python/slsdet/moench.py b/python/slsdet/moench.py index 0398841b1..6ed49a43d 100644 --- a/python/slsdet/moench.py +++ b/python/slsdet/moench.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ diff --git a/python/slsdet/mythen3.py b/python/slsdet/mythen3.py index 055ee343a..b018699df 100644 --- a/python/slsdet/mythen3.py +++ b/python/slsdet/mythen3.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ diff --git a/python/slsdet/pattern.py b/python/slsdet/pattern.py index fc223ff8e..a2d80fdfe 100644 --- a/python/slsdet/pattern.py +++ b/python/slsdet/pattern.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package import _slsdet from _slsdet import Pattern diff --git a/python/slsdet/proxy.py b/python/slsdet/proxy.py index 0cc498ba6..440433ccb 100644 --- a/python/slsdet/proxy.py +++ b/python/slsdet/proxy.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package from .utils import element_if_equal from .enums import dacIndex diff --git a/python/slsdet/registers.py b/python/slsdet/registers.py index ae7eeda5e..79da39fff 100755 --- a/python/slsdet/registers.py +++ b/python/slsdet/registers.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package class Register: def __init__(self, detector): self._detector = detector diff --git a/python/slsdet/temperature.py b/python/slsdet/temperature.py index ef609eeb8..c34e2f02b 100644 --- a/python/slsdet/temperature.py +++ b/python/slsdet/temperature.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package from functools import partial from collections.abc import Iterable import numpy as np diff --git a/python/slsdet/utils.py b/python/slsdet/utils.py index f7d4fbd9d..989cf93e0 100755 --- a/python/slsdet/utils.py +++ b/python/slsdet/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package """ Utility functions that are useful for testing and troubleshooting but not directly used in controlling the detector diff --git a/python/src/current.cpp b/python/src/current.cpp index e6d0d62b7..487f9e35f 100644 --- a/python/src/current.cpp +++ b/python/src/current.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include #include #include @@ -15,10 +17,10 @@ void init_source(py::module &m) { py::class_ currentSrcParameters(m, "currentSrcParameters"); currentSrcParameters.def(py::init()); - currentSrcParameters.def_readwrite("enable_", &src::enable_); - currentSrcParameters.def_readwrite("fix_", &src::fix_); - currentSrcParameters.def_readwrite("normal_", &src::normal_); - currentSrcParameters.def_readwrite("select_", &src::select_); + currentSrcParameters.def_readwrite("enable", &src::enable); + currentSrcParameters.def_readwrite("fix", &src::fix); + currentSrcParameters.def_readwrite("normal", &src::normal); + currentSrcParameters.def_readwrite("select", &src::select); currentSrcParameters.def(pybind11::self == pybind11::self); currentSrcParameters.def("__repr__", diff --git a/python/src/detector.cpp b/python/src/detector.cpp index b68758577..9bc381c5a 100644 --- a/python/src/detector.cpp +++ b/python/src/detector.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package /* WARINING This file is auto generated any edits might be overwritten without * warning */ @@ -254,14 +256,17 @@ void init_det(py::module &m) { .def("getTimingModeList", (std::vector(Detector::*)() const) & Detector::getTimingModeList) - .def("getSpeed", + .def("getReadoutSpeed", (Result(Detector::*)(sls::Positions) const) & - Detector::getSpeed, + Detector::getReadoutSpeed, py::arg() = Positions{}) - .def("setSpeed", + .def("setReadoutSpeed", (void (Detector::*)(defs::speedLevel, sls::Positions)) & - Detector::setSpeed, + Detector::setReadoutSpeed, py::arg(), py::arg() = Positions{}) + .def("getReadoutSpeedList", + (std::vector(Detector::*)() const) & + Detector::getReadoutSpeedList) .def("getADCPhase", (Result(Detector::*)(sls::Positions) const) & Detector::getADCPhase, diff --git a/python/src/detector_in.cpp b/python/src/detector_in.cpp index c08cdf764..b2f8afc9b 100644 --- a/python/src/detector_in.cpp +++ b/python/src/detector_in.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include #include #include @@ -14,15 +16,14 @@ #include namespace py = pybind11; void init_det(py::module &m) { + using sls::defs; using sls::Detector; + using sls::ns; using sls::Positions; using sls::Result; - using sls::defs; - using sls::ns; - - py::class_ CppDetectorApi(m, "CppDetectorApi"); - CppDetectorApi - .def(py::init()) - [[FUNCTIONS]] + py::class_ CppDetectorApi(m, "CppDetectorApi"); + CppDetectorApi.def(py::init()) + + [[FUNCTIONS]] } diff --git a/python/src/enums.cpp b/python/src/enums.cpp index 96db8bca9..5c2528e80 100644 --- a/python/src/enums.cpp +++ b/python/src/enums.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package /* WARINING This file is auto generated any edits might be overwritten without * warning */ @@ -250,6 +252,8 @@ void init_enums(py::module &m) { .value("FULL_SPEED", slsDetectorDefs::speedLevel::FULL_SPEED) .value("HALF_SPEED", slsDetectorDefs::speedLevel::HALF_SPEED) .value("QUARTER_SPEED", slsDetectorDefs::speedLevel::QUARTER_SPEED) + .value("G2_108MHZ", slsDetectorDefs::speedLevel::G2_108MHZ) + .value("G2_144MHZ", slsDetectorDefs::speedLevel::G2_144MHZ) .export_values(); py::enum_(Defs, "burstMode") @@ -269,8 +273,7 @@ void init_enums(py::module &m) { slsDetectorDefs::timingSourceType::TIMING_EXTERNAL) .export_values(); - py::enum_(Defs, "M3_GainCaps", - py::arithmetic()) + py::enum_(Defs, "M3_GainCaps") .value("M3_C10pre", slsDetectorDefs::M3_GainCaps::M3_C10pre) .value("M3_C15sh", slsDetectorDefs::M3_GainCaps::M3_C15sh) .value("M3_C30sh", slsDetectorDefs::M3_GainCaps::M3_C30sh) @@ -287,10 +290,12 @@ void init_enums(py::module &m) { .export_values(); py::enum_(Defs, "streamingInterface", - py::arithmetic()) + py::arithmetic()) .value("NONE", slsDetectorDefs::streamingInterface::NONE) - .value("LOW_LATENCY_LINK", slsDetectorDefs::streamingInterface::LOW_LATENCY_LINK) - .value("ETHERNET_10GB", slsDetectorDefs::streamingInterface::ETHERNET_10GB) + .value("LOW_LATENCY_LINK", + slsDetectorDefs::streamingInterface::LOW_LATENCY_LINK) + .value("ETHERNET_10GB", + slsDetectorDefs::streamingInterface::ETHERNET_10GB) .value("ALL", slsDetectorDefs::streamingInterface::ALL) .export_values() .def("__or__", diff --git a/python/src/enums_in.cpp b/python/src/enums_in.cpp index 129114845..12d72b262 100644 --- a/python/src/enums_in.cpp +++ b/python/src/enums_in.cpp @@ -1,11 +1,13 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include #include #include #include #include -#include "sls/sls_detector_defs.h" #include "sls/Pattern.h" +#include "sls/sls_detector_defs.h" namespace py = pybind11; void init_enums(py::module &m) { py::class_ Defs(m, "slsDetectorDefs"); diff --git a/python/src/main.cpp b/python/src/main.cpp old mode 100755 new mode 100644 index 7afa194b2..76657d374 --- a/python/src/main.cpp +++ b/python/src/main.cpp @@ -1,17 +1,18 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include #include #include #include +#include "mythenFileIO.h" #include "sls/Detector.h" #include "sls/Result.h" -#include "mythenFileIO.h" #include #include #include "typecaster.h" - using ds = std::chrono::duration; namespace py = pybind11; @@ -33,14 +34,13 @@ PYBIND11_MODULE(_slsdet, m) { )pbdoc"; - init_enums(m); - init_det(m); - init_network(m); - init_pattern(m); - init_scan(m); - init_source(m); + init_enums(m); + init_det(m); + init_network(m); + init_pattern(m); + init_scan(m); + init_source(m); // init_experimental(m); - py::module io = m.def_submodule("io", "Submodule for io"); io.def("read_my302_file", &read_my302_file, "some"); diff --git a/python/src/mythenFileIO.h b/python/src/mythenFileIO.h index 1a89b18c3..1771c96f1 100644 --- a/python/src/mythenFileIO.h +++ b/python/src/mythenFileIO.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include @@ -79,7 +81,7 @@ std::vector ReadFile(const std::string &fname, int byte_offset = 8, } py::array_t read_my302_file(const std::string &fname, int offset = 8, - int dr = 24) { + int dr = 24) { auto data = ExtractBits<17, 6>(ReadFile(fname, offset, dr)); return py::array(data.size(), data.data()); } diff --git a/python/src/network.cpp b/python/src/network.cpp index 8130c3e96..17e90d78c 100644 --- a/python/src/network.cpp +++ b/python/src/network.cpp @@ -1,9 +1,10 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package /* This file contains Python bindings for the IpAddr and MacAddr -classes. +classes. */ - #include #include #include @@ -15,27 +16,25 @@ using sls::IpAddr; using sls::MacAddr; void init_network(py::module &m) { - py::class_ (m, "IpAddr") - .def(py::init()) - .def(py::init()) - .def(py::init()) - .def(py::init()) - .def("hex", &IpAddr::hex) - .def("uint32", &IpAddr::uint32) - .def(py::self == py::self) - .def("__repr__", &IpAddr::str) - .def("str", &IpAddr::str); - - - py::class_ (m, "MacAddr") - .def(py::init()) - .def(py::init()) - .def(py::init()) - .def(py::init()) - .def("hex", &MacAddr::hex) - .def(py::self == py::self) - .def("uint64", &MacAddr::uint64) - .def("__repr__", &MacAddr::str) - .def("str", &MacAddr::str); + py::class_(m, "IpAddr") + .def(py::init()) + .def(py::init()) + .def(py::init()) + .def(py::init()) + .def("hex", &IpAddr::hex) + .def("uint32", &IpAddr::uint32) + .def(py::self == py::self) + .def("__repr__", &IpAddr::str) + .def("str", &IpAddr::str); + py::class_(m, "MacAddr") + .def(py::init()) + .def(py::init()) + .def(py::init()) + .def(py::init()) + .def("hex", &MacAddr::hex) + .def(py::self == py::self) + .def("uint64", &MacAddr::uint64) + .def("__repr__", &MacAddr::str) + .def("str", &MacAddr::str); } diff --git a/python/src/pattern.cpp b/python/src/pattern.cpp index c12bc96d9..e618f2954 100644 --- a/python/src/pattern.cpp +++ b/python/src/pattern.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include #include #include diff --git a/python/src/scan.cpp b/python/src/scan.cpp index afd83832b..13e0e4bf2 100644 --- a/python/src/scan.cpp +++ b/python/src/scan.cpp @@ -1,10 +1,12 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package +#include "sls/sls_detector_defs.h" #include #include #include #include #include #include -#include "sls/sls_detector_defs.h" namespace py = pybind11; void init_scan(py::module &m) { @@ -14,26 +16,24 @@ void init_scan(py::module &m) { scanParameters.def(py::init()); scanParameters.def(py::init()); - scanParameters.def(py::init()); + scanParameters.def(py::init()); scanParameters.def_readwrite("enable", &sp::enable); scanParameters.def_readwrite("dacInd", &sp::dacInd); scanParameters.def_readwrite("startOffset", &sp::startOffset); scanParameters.def_readwrite("stopOffset", &sp::stopOffset); scanParameters.def_readwrite("stepSize", &sp::stepSize); scanParameters.def_readwrite("dacSettleTime_ns", &sp::dacSettleTime_ns); - scanParameters.def("__repr__", [](const sp &a){ + scanParameters.def("__repr__", [](const sp &a) { std::ostringstream oss; auto indent = " "; oss << "\n"; - oss << indent << "enable: " << a.enable << '\n'; - oss << indent << "dacInd: " << a.dacInd << '\n'; - oss << indent << "startOffset: " << a.startOffset << '\n'; - oss << indent << "stopOffset: " << a.stopOffset << '\n'; - oss << indent << "stepSize: " << a.stepSize << '\n'; - oss << indent << "dacSettleTime_ns: " << a.dacSettleTime_ns; + oss << indent << "enable: " << a.enable << '\n'; + oss << indent << "dacInd: " << a.dacInd << '\n'; + oss << indent << "startOffset: " << a.startOffset << '\n'; + oss << indent << "stopOffset: " << a.stopOffset << '\n'; + oss << indent << "stepSize: " << a.stepSize << '\n'; + oss << indent << "dacSettleTime_ns: " << a.dacSettleTime_ns; return oss.str(); }); - - - } diff --git a/python/src/typecaster.h b/python/src/typecaster.h index 15f884b45..8e2aa6d4d 100644 --- a/python/src/typecaster.h +++ b/python/src/typecaster.h @@ -1,6 +1,8 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once -#include #include "sls/Result.h" +#include // Add type_typecaster to pybind for our wrapper type namespace pybind11 { namespace detail { diff --git a/python/tests/test_utils.py b/python/tests/test_utils.py index 500b7858c..1dd8dd152 100755 --- a/python/tests/test_utils.py +++ b/python/tests/test_utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ diff --git a/sample/CMakeLists.txt b/sample/CMakeLists.txt index 98ae46d35..d73e539c5 100644 --- a/sample/CMakeLists.txt +++ b/sample/CMakeLists.txt @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package add_executable(using_logger using_logger.cpp) target_link_libraries(using_logger slsSupportShared diff --git a/sample/api.cpp b/sample/api.cpp index 705fba788..c39d84544 100644 --- a/sample/api.cpp +++ b/sample/api.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include #include diff --git a/sample/time.cpp b/sample/time.cpp index 96f10e349..09beca9e7 100644 --- a/sample/time.cpp +++ b/sample/time.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include #include #include diff --git a/sample/udp.cpp b/sample/udp.cpp index b647992c9..dcc9689d5 100644 --- a/sample/udp.cpp +++ b/sample/udp.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "sls/UdpRxSocket.h" #include "sls/sls_detector_defs.h" #include diff --git a/sample/useResult.cpp b/sample/useResult.cpp index e7944f628..eda206e83 100644 --- a/sample/useResult.cpp +++ b/sample/useResult.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package /** Examples on how to use Result */ #include "sls/Result.h" diff --git a/sample/using_logger.cpp b/sample/using_logger.cpp index ec46588af..7557d5c83 100644 --- a/sample/using_logger.cpp +++ b/sample/using_logger.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "sls/logger.h" #include #include @@ -7,7 +9,8 @@ int main() { std::cout << "Compare output between old and new:\n"; LOG(logINFO) << "Some info message"; LOG(logERROR) << "This is an error"; - LOG(logWARNING) << "While this is only a warning"; + LOG(logWARNING) << "While this is only a warning"; prefix="/afs/psi.ch/project/sls_det_software/dhanya_softwareDevelopment/mySoft/slsDetectorPackage/" + p=${file#"$prefix"} //Logging level can be configure at runtime std::cout << "\n\n"; diff --git a/serverBin/ctbDetectorServer_developer b/serverBin/ctbDetectorServer_developer deleted file mode 120000 index 2304a2043..000000000 --- a/serverBin/ctbDetectorServer_developer +++ /dev/null @@ -1 +0,0 @@ -../slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer \ No newline at end of file diff --git a/serverBin/ctbDetectorServerv6.0.0-rc1 b/serverBin/ctbDetectorServerv6.0.0-rc1 new file mode 120000 index 000000000..4f75c85de --- /dev/null +++ b/serverBin/ctbDetectorServerv6.0.0-rc1 @@ -0,0 +1 @@ +../slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServerv6.0.0-rc1 \ No newline at end of file diff --git a/serverBin/eigerDetectorServer_developer b/serverBin/eigerDetectorServer_developer deleted file mode 120000 index 117c94c37..000000000 --- a/serverBin/eigerDetectorServer_developer +++ /dev/null @@ -1 +0,0 @@ -../slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer \ No newline at end of file diff --git a/serverBin/eigerDetectorServerv6.0.0-rc2 b/serverBin/eigerDetectorServerv6.0.0-rc2 new file mode 120000 index 000000000..9e919fe4b --- /dev/null +++ b/serverBin/eigerDetectorServerv6.0.0-rc2 @@ -0,0 +1 @@ +../slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServerv6.0.0-rc2 \ No newline at end of file diff --git a/serverBin/gotthard2DetectorServer_developer b/serverBin/gotthard2DetectorServer_developer deleted file mode 120000 index 7c8e54bee..000000000 --- a/serverBin/gotthard2DetectorServer_developer +++ /dev/null @@ -1 +0,0 @@ -../slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer \ No newline at end of file diff --git a/serverBin/gotthard2DetectorServerv6.0.0-rc1 b/serverBin/gotthard2DetectorServerv6.0.0-rc1 new file mode 120000 index 000000000..28ca091f4 --- /dev/null +++ b/serverBin/gotthard2DetectorServerv6.0.0-rc1 @@ -0,0 +1 @@ +../slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServerv6.0.0-rc1 \ No newline at end of file diff --git a/serverBin/gotthardDetectorServer_developer b/serverBin/gotthardDetectorServer_developer deleted file mode 120000 index 28e8385e0..000000000 --- a/serverBin/gotthardDetectorServer_developer +++ /dev/null @@ -1 +0,0 @@ -../slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer \ No newline at end of file diff --git a/serverBin/gotthardDetectorServerv6.0.0-rc1 b/serverBin/gotthardDetectorServerv6.0.0-rc1 new file mode 120000 index 000000000..cc6f48d93 --- /dev/null +++ b/serverBin/gotthardDetectorServerv6.0.0-rc1 @@ -0,0 +1 @@ +../slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServerv6.0.0-rc1 \ No newline at end of file diff --git a/serverBin/jungfrauDetectorServer_developer b/serverBin/jungfrauDetectorServer_developer deleted file mode 120000 index 8ae22b591..000000000 --- a/serverBin/jungfrauDetectorServer_developer +++ /dev/null @@ -1 +0,0 @@ -../slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer \ No newline at end of file diff --git a/serverBin/moenchDetectorServer_developer b/serverBin/moenchDetectorServer_developer deleted file mode 120000 index 147ecfb53..000000000 --- a/serverBin/moenchDetectorServer_developer +++ /dev/null @@ -1 +0,0 @@ -../slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer \ No newline at end of file diff --git a/serverBin/moenchDetectorServerv6.0.0-rc1 b/serverBin/moenchDetectorServerv6.0.0-rc1 new file mode 120000 index 000000000..7a0aa1f2d --- /dev/null +++ b/serverBin/moenchDetectorServerv6.0.0-rc1 @@ -0,0 +1 @@ +../slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServerv6.0.0-rc1 \ No newline at end of file diff --git a/serverBin/mythen3DetectorServer_developer b/serverBin/mythen3DetectorServer_developer deleted file mode 120000 index cc8b2c91f..000000000 --- a/serverBin/mythen3DetectorServer_developer +++ /dev/null @@ -1 +0,0 @@ -../slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer \ No newline at end of file diff --git a/serverBin/mythen3DetectorServerv6.0.0-rc1 b/serverBin/mythen3DetectorServerv6.0.0-rc1 new file mode 120000 index 000000000..1530adf0e --- /dev/null +++ b/serverBin/mythen3DetectorServerv6.0.0-rc1 @@ -0,0 +1 @@ +../slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServerv6.0.0-rc1 \ No newline at end of file diff --git a/slsDetectorCalibration/MovingStat.h b/slsDetectorCalibration/MovingStat.h old mode 100755 new mode 100644 index 31fb59c59..d069cc6d0 --- a/slsDetectorCalibration/MovingStat.h +++ b/slsDetectorCalibration/MovingStat.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef MOVINGSTAT_H #define MOVINGSTAT_H diff --git a/slsDetectorCalibration/RunningStat.h b/slsDetectorCalibration/RunningStat.h old mode 100755 new mode 100644 index 1197ffc0f..aca704097 --- a/slsDetectorCalibration/RunningStat.h +++ b/slsDetectorCalibration/RunningStat.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package class RunningStat { public: diff --git a/slsDetectorCalibration/Stat.h b/slsDetectorCalibration/Stat.h index 196f5bbb7..6521aa933 100644 --- a/slsDetectorCalibration/Stat.h +++ b/slsDetectorCalibration/Stat.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package class Stat { public: diff --git a/slsDetectorCalibration/analogDetector.h b/slsDetectorCalibration/analogDetector.h index 56b3feb29..bda071176 100644 --- a/slsDetectorCalibration/analogDetector.h +++ b/slsDetectorCalibration/analogDetector.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef ANALOGDETECTOR_H #define ANALOGDETECTOR_H diff --git a/slsDetectorCalibration/circularFifo.h b/slsDetectorCalibration/circularFifo.h index f0b4eeb34..cf373d279 100644 --- a/slsDetectorCalibration/circularFifo.h +++ b/slsDetectorCalibration/circularFifo.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once /* CircularFifo.h * Code & platform dependent issues with it was originally diff --git a/slsDetectorCalibration/commonModeSubtraction.h b/slsDetectorCalibration/commonModeSubtraction.h index 0484e6746..3ab9f896f 100644 --- a/slsDetectorCalibration/commonModeSubtraction.h +++ b/slsDetectorCalibration/commonModeSubtraction.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef COMMONMODESUBTRACTION_H #define COMMONMODESUBTRACTION_H diff --git a/slsDetectorCalibration/commonModeSubtractionNew.h b/slsDetectorCalibration/commonModeSubtractionNew.h index 1add20cc2..b0bb311ee 100644 --- a/slsDetectorCalibration/commonModeSubtractionNew.h +++ b/slsDetectorCalibration/commonModeSubtractionNew.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef COMMONMODESUBTRACTION_H #define COMMONMODESUBTRACTION_H diff --git a/slsDetectorCalibration/dataStructures/Mythen3_01_jctbData.h b/slsDetectorCalibration/dataStructures/Mythen3_01_jctbData.h index 63352bbce..0a33f1cf2 100644 --- a/slsDetectorCalibration/dataStructures/Mythen3_01_jctbData.h +++ b/slsDetectorCalibration/dataStructures/Mythen3_01_jctbData.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef MYTHEN301JCTBDATA_H #define MYTHEN301JCTBDATA_H diff --git a/slsDetectorCalibration/dataStructures/Mythen3_02_jctbData.h b/slsDetectorCalibration/dataStructures/Mythen3_02_jctbData.h index 0719301ca..deca0d9e5 100644 --- a/slsDetectorCalibration/dataStructures/Mythen3_02_jctbData.h +++ b/slsDetectorCalibration/dataStructures/Mythen3_02_jctbData.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef MYTHEN302JCTBDATA_H #define MYTHEN302JCTBDATA_H diff --git a/slsDetectorCalibration/dataStructures/adcSar2_jctbData.h b/slsDetectorCalibration/dataStructures/adcSar2_jctbData.h index 0b0665aaf..f7dfae566 100644 --- a/slsDetectorCalibration/dataStructures/adcSar2_jctbData.h +++ b/slsDetectorCalibration/dataStructures/adcSar2_jctbData.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef ADCSAR2_JCTBDATA_H #define ADCSAR2_JCTBDATA_H diff --git a/slsDetectorCalibration/dataStructures/chiptestBoardData.h b/slsDetectorCalibration/dataStructures/chiptestBoardData.h index 0ef633c44..c6019a9eb 100644 --- a/slsDetectorCalibration/dataStructures/chiptestBoardData.h +++ b/slsDetectorCalibration/dataStructures/chiptestBoardData.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef CHIPTESTDATA_H #define CHIPTESTDATA_H diff --git a/slsDetectorCalibration/dataStructures/deserializer.h b/slsDetectorCalibration/dataStructures/deserializer.h index a14da9e15..4bdce415c 100644 --- a/slsDetectorCalibration/dataStructures/deserializer.h +++ b/slsDetectorCalibration/dataStructures/deserializer.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef DESERIALIZER_H #define DESERIALIZER_H #include diff --git a/slsDetectorCalibration/dataStructures/gotthardDoubleModuleDataNew.h b/slsDetectorCalibration/dataStructures/gotthardDoubleModuleDataNew.h index 9cf11c540..657728724 100644 --- a/slsDetectorCalibration/dataStructures/gotthardDoubleModuleDataNew.h +++ b/slsDetectorCalibration/dataStructures/gotthardDoubleModuleDataNew.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef GOTTHARD2MODULEDATANEW_H #define GOTTHARD2MODULEDATANEW_H #include "gotthardModuleDataNew.h" diff --git a/slsDetectorCalibration/dataStructures/gotthardShortModuleData.h b/slsDetectorCalibration/dataStructures/gotthardShortModuleData.h index 4d853c7b0..a546140d2 100644 --- a/slsDetectorCalibration/dataStructures/gotthardShortModuleData.h +++ b/slsDetectorCalibration/dataStructures/gotthardShortModuleData.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef GOTTHARDSHORTMODULEDATA_H #define GOTTHARDSHORTMODULEDATA_H #include "slsReceiverData.h" diff --git a/slsDetectorCalibration/dataStructures/imageZmq16bit.h b/slsDetectorCalibration/dataStructures/imageZmq16bit.h index efba95bdf..cb28f36be 100644 --- a/slsDetectorCalibration/dataStructures/imageZmq16bit.h +++ b/slsDetectorCalibration/dataStructures/imageZmq16bit.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef IMAGEZMQ16BIT_H #define IMAGEZMQ16BIT_H #include "slsDetectorData.h" diff --git a/slsDetectorCalibration/dataStructures/imageZmq32bit.h b/slsDetectorCalibration/dataStructures/imageZmq32bit.h index 7217c09d6..c5240c35c 100644 --- a/slsDetectorCalibration/dataStructures/imageZmq32bit.h +++ b/slsDetectorCalibration/dataStructures/imageZmq32bit.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef IMAGEZMQ32BIT_H #define IMAGEZMQ32BIT_H #include "slsDetectorData.h" diff --git a/slsDetectorCalibration/dataStructures/jungfrauHighZSingleChipData.h b/slsDetectorCalibration/dataStructures/jungfrauHighZSingleChipData.h index d3bc61f62..7983c34e4 100644 --- a/slsDetectorCalibration/dataStructures/jungfrauHighZSingleChipData.h +++ b/slsDetectorCalibration/dataStructures/jungfrauHighZSingleChipData.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef JUNGFRAUHIGHZSINGLECHIPDATA_H #define JUNGFRAUHIGHZSINGLECHIPDATA_H #include "slsDetectorData.h" diff --git a/slsDetectorCalibration/dataStructures/moench02CtbData.h b/slsDetectorCalibration/dataStructures/moench02CtbData.h index 937c427db..14fcaa840 100644 --- a/slsDetectorCalibration/dataStructures/moench02CtbData.h +++ b/slsDetectorCalibration/dataStructures/moench02CtbData.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef MOENCH02CTBDATA_H #define MOENCH02CTBDATA_H #include "slsDetectorData.h" diff --git a/slsDetectorCalibration/dataStructures/moench03CtbData.h b/slsDetectorCalibration/dataStructures/moench03CtbData.h index 66ae0cbda..8fee232c2 100644 --- a/slsDetectorCalibration/dataStructures/moench03CtbData.h +++ b/slsDetectorCalibration/dataStructures/moench03CtbData.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef MOENCH03CTBDATA_H #define MOENCH03CTBDATA_H #include "slsDetectorData.h" diff --git a/slsDetectorCalibration/dataStructures/moench03T1CtbData.h b/slsDetectorCalibration/dataStructures/moench03T1CtbData.h index 4a99d3746..6a4e31e0f 100644 --- a/slsDetectorCalibration/dataStructures/moench03T1CtbData.h +++ b/slsDetectorCalibration/dataStructures/moench03T1CtbData.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef MOENCH03T1CTBDATA_H #define MOENCH03T1CTBDATA_H #include "slsDetectorData.h" diff --git a/slsDetectorCalibration/dataStructures/moench03T1ReceiverDataNew.h b/slsDetectorCalibration/dataStructures/moench03T1ReceiverDataNew.h index 799fa0293..47a681156 100644 --- a/slsDetectorCalibration/dataStructures/moench03T1ReceiverDataNew.h +++ b/slsDetectorCalibration/dataStructures/moench03T1ReceiverDataNew.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef MOENCH03T1RECDATANEW_H #define MOENCH03T1RECDATANEW_H #include "slsDetectorData.h" diff --git a/slsDetectorCalibration/dataStructures/moench03T1ReceiverDataNewRect.h b/slsDetectorCalibration/dataStructures/moench03T1ReceiverDataNewRect.h index ad2e8df80..6529ec4b8 100644 --- a/slsDetectorCalibration/dataStructures/moench03T1ReceiverDataNewRect.h +++ b/slsDetectorCalibration/dataStructures/moench03T1ReceiverDataNewRect.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef MOENCH03T1RECDATANEWRECT_H #define MOENCH03T1RECDATANEWRECT_H #include "slsDetectorData.h" diff --git a/slsDetectorCalibration/dataStructures/moench03T1ReorderedData.h b/slsDetectorCalibration/dataStructures/moench03T1ReorderedData.h index d5f988922..5e710f262 100644 --- a/slsDetectorCalibration/dataStructures/moench03T1ReorderedData.h +++ b/slsDetectorCalibration/dataStructures/moench03T1ReorderedData.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef MOENCH03T1REORDERED_H #define MOENCH03T1REORDERED_H #include "slsDetectorData.h" diff --git a/slsDetectorCalibration/dataStructures/moench03T1ZmqData.h b/slsDetectorCalibration/dataStructures/moench03T1ZmqData.h index 5c01eb3bc..ad5f83086 100644 --- a/slsDetectorCalibration/dataStructures/moench03T1ZmqData.h +++ b/slsDetectorCalibration/dataStructures/moench03T1ZmqData.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef MOENCH03T1ZMQDATA_H #define MOENCH03T1ZMQDATA_H #include "slsDetectorData.h" diff --git a/slsDetectorCalibration/dataStructures/moench03T1ZmqDataNew.h b/slsDetectorCalibration/dataStructures/moench03T1ZmqDataNew.h index c04d035d2..2a5fbecba 100644 --- a/slsDetectorCalibration/dataStructures/moench03T1ZmqDataNew.h +++ b/slsDetectorCalibration/dataStructures/moench03T1ZmqDataNew.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef MOENCH03T1ZMQDATANEW_H #define MOENCH03T1ZMQDATANEW_H #include "slsDetectorData.h" diff --git a/slsDetectorCalibration/dataStructures/moench03TCtbData.h b/slsDetectorCalibration/dataStructures/moench03TCtbData.h index 5edbdd247..71caf17d3 100644 --- a/slsDetectorCalibration/dataStructures/moench03TCtbData.h +++ b/slsDetectorCalibration/dataStructures/moench03TCtbData.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef MOENCH03TCTBDATA_H #define MOENCH03TCTBDATA_H #include "slsDetectorData.h" diff --git a/slsDetectorCalibration/dataStructures/moench04CtbReceiver10GbData.h b/slsDetectorCalibration/dataStructures/moench04CtbReceiver10GbData.h index 916f95c65..556246699 100644 --- a/slsDetectorCalibration/dataStructures/moench04CtbReceiver10GbData.h +++ b/slsDetectorCalibration/dataStructures/moench04CtbReceiver10GbData.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef MOENCH04REC10GBDATA_H #define MOENCH04REC10GBDATA_H #include "slsDetectorData.h" diff --git a/slsDetectorCalibration/dataStructures/moench04CtbReceiverData.h b/slsDetectorCalibration/dataStructures/moench04CtbReceiverData.h index 0ee4c8458..e3ec74a73 100644 --- a/slsDetectorCalibration/dataStructures/moench04CtbReceiverData.h +++ b/slsDetectorCalibration/dataStructures/moench04CtbReceiverData.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef MOENCH04RECDATA_H #define MOENCH04RECDATA_H #include "slsDetectorData.h" diff --git a/slsDetectorCalibration/dataStructures/moench04CtbZmq10GbData.h b/slsDetectorCalibration/dataStructures/moench04CtbZmq10GbData.h index 53a0042ec..64b0587a8 100644 --- a/slsDetectorCalibration/dataStructures/moench04CtbZmq10GbData.h +++ b/slsDetectorCalibration/dataStructures/moench04CtbZmq10GbData.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef MOENCH04ZMQ10GBDATA_H #define MOENCH04ZMQ10GBDATA_H #include "slsDetectorData.h" diff --git a/slsDetectorCalibration/dataStructures/moench04CtbZmqData.h b/slsDetectorCalibration/dataStructures/moench04CtbZmqData.h index ba57d99f0..94c5c6a88 100644 --- a/slsDetectorCalibration/dataStructures/moench04CtbZmqData.h +++ b/slsDetectorCalibration/dataStructures/moench04CtbZmqData.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef MOENCH04ZMQDATA_H #define MOENCH04ZMQDATA_H #include "slsDetectorData.h" diff --git a/slsDetectorCalibration/dataStructures/slsDetectorData.h b/slsDetectorCalibration/dataStructures/slsDetectorData.h index 493a2d73b..d36657f62 100644 --- a/slsDetectorCalibration/dataStructures/slsDetectorData.h +++ b/slsDetectorCalibration/dataStructures/slsDetectorData.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef SLSDETECTORDATA_H #define SLSDETECTORDATA_H diff --git a/slsDetectorCalibration/dataStructures/slsReceiverData.h b/slsDetectorCalibration/dataStructures/slsReceiverData.h index da5be060e..220026e90 100644 --- a/slsDetectorCalibration/dataStructures/slsReceiverData.h +++ b/slsDetectorCalibration/dataStructures/slsReceiverData.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef SLSRECEIVERDATA_H #define SLSRECEIVERDATA_H diff --git a/slsDetectorCalibration/energyCalibration.cpp b/slsDetectorCalibration/energyCalibration.cpp index 7461eca45..a1f443fd5 100644 --- a/slsDetectorCalibration/energyCalibration.cpp +++ b/slsDetectorCalibration/energyCalibration.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "energyCalibration.h" #ifdef __CINT diff --git a/slsDetectorCalibration/energyCalibration.h b/slsDetectorCalibration/energyCalibration.h index cef73d3f0..800f838cb 100644 --- a/slsDetectorCalibration/energyCalibration.h +++ b/slsDetectorCalibration/energyCalibration.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef ENERGYCALIBRATION_H #define ENERGYCALIBRATION_H diff --git a/slsDetectorCalibration/ghostSummation.h b/slsDetectorCalibration/ghostSummation.h index 12d0806c9..82721059d 100644 --- a/slsDetectorCalibration/ghostSummation.h +++ b/slsDetectorCalibration/ghostSummation.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef GHOSTSUMMATION_H #define GHOSTSUMMATION_H diff --git a/slsDetectorCalibration/gotthardExecutables/Makefile b/slsDetectorCalibration/gotthardExecutables/Makefile index 5d11522b1..3c24a910f 100644 --- a/slsDetectorCalibration/gotthardExecutables/Makefile +++ b/slsDetectorCalibration/gotthardExecutables/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package slsReceiver --rx_tcpport 1954 & slsReceiver --rx_tcpport 1955 & diff --git a/slsDetectorCalibration/interpolatingDetector.h b/slsDetectorCalibration/interpolatingDetector.h index 973bd57ed..7053568d9 100644 --- a/slsDetectorCalibration/interpolatingDetector.h +++ b/slsDetectorCalibration/interpolatingDetector.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef INTERPOLATINGDETECTOR_H #define INTERPOLATINGDETECTOR_H diff --git a/slsDetectorCalibration/interpolations/eta2InterpolationBase.h b/slsDetectorCalibration/interpolations/eta2InterpolationBase.h index 26431ed92..bfc9685ec 100644 --- a/slsDetectorCalibration/interpolations/eta2InterpolationBase.h +++ b/slsDetectorCalibration/interpolations/eta2InterpolationBase.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef ETA2_INTERPOLATION_BASE_H #define ETA2_INTERPOLATION_BASE_H diff --git a/slsDetectorCalibration/interpolations/eta3InterpolationBase.h b/slsDetectorCalibration/interpolations/eta3InterpolationBase.h index a00969bb2..233a11358 100644 --- a/slsDetectorCalibration/interpolations/eta3InterpolationBase.h +++ b/slsDetectorCalibration/interpolations/eta3InterpolationBase.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef ETA3_INTERPOLATION_BASE_H #define ETA3_INTERPOLATION_BASE_H diff --git a/slsDetectorCalibration/interpolations/etaInterpolationAdaptiveBins.h b/slsDetectorCalibration/interpolations/etaInterpolationAdaptiveBins.h index feef0d3a9..e453d566d 100644 --- a/slsDetectorCalibration/interpolations/etaInterpolationAdaptiveBins.h +++ b/slsDetectorCalibration/interpolations/etaInterpolationAdaptiveBins.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef ETA_INTERPOLATION_ADAPTIVEBINS_H #define ETA_INTERPOLATION_ADAPTIVEBINS_H diff --git a/slsDetectorCalibration/interpolations/etaInterpolationBase.h b/slsDetectorCalibration/interpolations/etaInterpolationBase.h index 52273aab0..d04e125db 100644 --- a/slsDetectorCalibration/interpolations/etaInterpolationBase.h +++ b/slsDetectorCalibration/interpolations/etaInterpolationBase.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef ETA_INTERPOLATION_BASE_H #define ETA_INTERPOLATION_BASE_H diff --git a/slsDetectorCalibration/interpolations/etaInterpolationCleverAdaptiveBins.h b/slsDetectorCalibration/interpolations/etaInterpolationCleverAdaptiveBins.h index 624b89629..40eb9d836 100644 --- a/slsDetectorCalibration/interpolations/etaInterpolationCleverAdaptiveBins.h +++ b/slsDetectorCalibration/interpolations/etaInterpolationCleverAdaptiveBins.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef ETA_INTERPOLATION_CLEVER_ADAPTIVEBINS_H #define ETA_INTERPOLATION_CLEVER_ADAPTIVEBINS_H diff --git a/slsDetectorCalibration/interpolations/etaInterpolationGlobal.h b/slsDetectorCalibration/interpolations/etaInterpolationGlobal.h index 615b7c04b..73d7e2833 100644 --- a/slsDetectorCalibration/interpolations/etaInterpolationGlobal.h +++ b/slsDetectorCalibration/interpolations/etaInterpolationGlobal.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef ETA_INTERPOLATION_GLOBAL_H #define ETA_INTERPOLATION_GLOBAL_H diff --git a/slsDetectorCalibration/interpolations/etaInterpolationPosXY.h b/slsDetectorCalibration/interpolations/etaInterpolationPosXY.h index 0d29c1658..5d28bfffb 100644 --- a/slsDetectorCalibration/interpolations/etaInterpolationPosXY.h +++ b/slsDetectorCalibration/interpolations/etaInterpolationPosXY.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef ETA_INTERPOLATION_POSXY_H #define ETA_INTERPOLATION_POSXY_H diff --git a/slsDetectorCalibration/interpolations/etaInterpolationRandomBins.h b/slsDetectorCalibration/interpolations/etaInterpolationRandomBins.h index e3a3591a4..41939fe5c 100644 --- a/slsDetectorCalibration/interpolations/etaInterpolationRandomBins.h +++ b/slsDetectorCalibration/interpolations/etaInterpolationRandomBins.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef ETA_INTERPOLATION_RANDOMBINS_H #define ETA_INTERPOLATION_RANDOMBINS_H diff --git a/slsDetectorCalibration/interpolations/etaVEL/EtaVEL.cpp b/slsDetectorCalibration/interpolations/etaVEL/EtaVEL.cpp index 922c91d4f..42783a436 100644 --- a/slsDetectorCalibration/interpolations/etaVEL/EtaVEL.cpp +++ b/slsDetectorCalibration/interpolations/etaVEL/EtaVEL.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "EtaVEL.h" #include diff --git a/slsDetectorCalibration/interpolations/etaVEL/EtaVEL.h b/slsDetectorCalibration/interpolations/etaVEL/EtaVEL.h index 5c73d8a83..d2c31d803 100644 --- a/slsDetectorCalibration/interpolations/etaVEL/EtaVEL.h +++ b/slsDetectorCalibration/interpolations/etaVEL/EtaVEL.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include #include #include diff --git a/slsDetectorCalibration/interpolations/etaVEL/EtaVELTr.py b/slsDetectorCalibration/interpolations/etaVEL/EtaVELTr.py index ebb152737..3c7d6c080 100644 --- a/slsDetectorCalibration/interpolations/etaVEL/EtaVELTr.py +++ b/slsDetectorCalibration/interpolations/etaVEL/EtaVELTr.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package import numpy as np import math diff --git a/slsDetectorCalibration/interpolations/etaVEL/etaVELInterpolation.cpp b/slsDetectorCalibration/interpolations/etaVEL/etaVELInterpolation.cpp index 1cdd3c718..43e6ebed0 100644 --- a/slsDetectorCalibration/interpolations/etaVEL/etaVELInterpolation.cpp +++ b/slsDetectorCalibration/interpolations/etaVEL/etaVELInterpolation.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "interpolation_EtaVEL.h" #include "TH2F.h" #include "TCanvas.h" diff --git a/slsDetectorCalibration/interpolations/etaVEL/etaVELInterpolation.h b/slsDetectorCalibration/interpolations/etaVEL/etaVELInterpolation.h index 8fbacf96d..e35624da8 100644 --- a/slsDetectorCalibration/interpolations/etaVEL/etaVELInterpolation.h +++ b/slsDetectorCalibration/interpolations/etaVEL/etaVELInterpolation.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef INTERPOLATION_ETAVEL_H #define INTERPOLATION_ETAVEL_H diff --git a/slsDetectorCalibration/interpolations/linearInterpolation.h b/slsDetectorCalibration/interpolations/linearInterpolation.h index 605de4c93..9eafc2fbf 100644 --- a/slsDetectorCalibration/interpolations/linearInterpolation.h +++ b/slsDetectorCalibration/interpolations/linearInterpolation.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef LINEAR_INTERPOLATION_H #define LINEAR_INTERPOLATION_H diff --git a/slsDetectorCalibration/interpolations/noInterpolation.h b/slsDetectorCalibration/interpolations/noInterpolation.h index be072f926..3f4b52b88 100644 --- a/slsDetectorCalibration/interpolations/noInterpolation.h +++ b/slsDetectorCalibration/interpolations/noInterpolation.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef NO_INTERPOLATION_H #define NO_INTERPOLATION_H diff --git a/slsDetectorCalibration/interpolations/slsInterpolation.h b/slsDetectorCalibration/interpolations/slsInterpolation.h index ed99160c0..c061a2e36 100644 --- a/slsDetectorCalibration/interpolations/slsInterpolation.h +++ b/slsDetectorCalibration/interpolations/slsInterpolation.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef SLS_INTERPOLATION_H #define SLS_INTERPOLATION_H diff --git a/slsDetectorCalibration/jungfrauExecutables/Makefile.cluster_finder b/slsDetectorCalibration/jungfrauExecutables/Makefile.cluster_finder index 19dfe56d6..574f48e35 100644 --- a/slsDetectorCalibration/jungfrauExecutables/Makefile.cluster_finder +++ b/slsDetectorCalibration/jungfrauExecutables/Makefile.cluster_finder @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package #module add CBFlib/0.9.5 INCDIR=-I. -I../ -I../interpolations -I../interpolations/etaVEL -I../dataStructures -I../../slsSupportLib/include/ -I../../slsReceiverSoftware/include/ diff --git a/slsDetectorCalibration/jungfrauExecutables/Makefile.cluster_finder~ b/slsDetectorCalibration/jungfrauExecutables/Makefile.cluster_finder~ index c5eeca444..f452a020f 100644 --- a/slsDetectorCalibration/jungfrauExecutables/Makefile.cluster_finder~ +++ b/slsDetectorCalibration/jungfrauExecutables/Makefile.cluster_finder~ @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package #module add CBFlib/0.9.5 INCDIR=-I. -I../ -I../interpolations -I../interpolations/etaVEL -I../dataStructures -I../../slsSupportLib/include/ -I../../slsReceiverSoftware/include/ diff --git a/slsDetectorCalibration/jungfrauExecutables/Makefile.zmq b/slsDetectorCalibration/jungfrauExecutables/Makefile.zmq index fdde1b8a1..af60de798 100644 --- a/slsDetectorCalibration/jungfrauExecutables/Makefile.zmq +++ b/slsDetectorCalibration/jungfrauExecutables/Makefile.zmq @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package INCDIR= -I. -I../dataStructures ../tiffIO.cpp -I../ -I../interpolations/ -I../../slsSupportLib/include/ -I../../slsReceiverSoftware/include/ -I../../libs/rapidjson/ LDFLAG= -L/usr/lib64/ -lpthread -lm -lstdc++ -lzmq -pthread -lrt -ltiff -O3 -std=c++11 -Wall -L../../build/bin/ -lSlsSupport diff --git a/slsDetectorCalibration/jungfrauExecutables/jungfrauClusterFinder.cpp b/slsDetectorCalibration/jungfrauExecutables/jungfrauClusterFinder.cpp index f7b2f916a..edf1a83b9 100644 --- a/slsDetectorCalibration/jungfrauExecutables/jungfrauClusterFinder.cpp +++ b/slsDetectorCalibration/jungfrauExecutables/jungfrauClusterFinder.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package //#include "sls/ansi.h" #include diff --git a/slsDetectorCalibration/jungfrauExecutables/jungfrauInterpolation.cpp b/slsDetectorCalibration/jungfrauExecutables/jungfrauInterpolation.cpp index eeeed90c6..dc9953590 100644 --- a/slsDetectorCalibration/jungfrauExecutables/jungfrauInterpolation.cpp +++ b/slsDetectorCalibration/jungfrauExecutables/jungfrauInterpolation.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "sls/ansi.h" #include diff --git a/slsDetectorCalibration/jungfrauExecutables/jungfrauPhotonCounter.cpp b/slsDetectorCalibration/jungfrauExecutables/jungfrauPhotonCounter.cpp index 7b765bd5e..51b416e7a 100644 --- a/slsDetectorCalibration/jungfrauExecutables/jungfrauPhotonCounter.cpp +++ b/slsDetectorCalibration/jungfrauExecutables/jungfrauPhotonCounter.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package //#include "sls/ansi.h" #include #define CORR diff --git a/slsDetectorCalibration/jungfrauExecutables/jungfrauZmqProcess.cpp b/slsDetectorCalibration/jungfrauExecutables/jungfrauZmqProcess.cpp index 47e424306..a92561821 100644 --- a/slsDetectorCalibration/jungfrauExecutables/jungfrauZmqProcess.cpp +++ b/slsDetectorCalibration/jungfrauExecutables/jungfrauZmqProcess.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package //#define WRITE_QUAD #define DEVELOPER #undef CORR diff --git a/slsDetectorCalibration/moench03CommonMode.h b/slsDetectorCalibration/moench03CommonMode.h index 0d21c884f..876146630 100644 --- a/slsDetectorCalibration/moench03CommonMode.h +++ b/slsDetectorCalibration/moench03CommonMode.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef MOENCH03COMMONMODE_H #define MOENCH03COMMONMODE_H diff --git a/slsDetectorCalibration/moench03GhostSummation.h b/slsDetectorCalibration/moench03GhostSummation.h index 165e422d5..ce5574b8e 100644 --- a/slsDetectorCalibration/moench03GhostSummation.h +++ b/slsDetectorCalibration/moench03GhostSummation.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef MOENCH03GHOSTSUMMATION_H #define MOENCH03GHOSTSUMMATION_H diff --git a/slsDetectorCalibration/moenchCommonMode.h b/slsDetectorCalibration/moenchCommonMode.h index cddadd1bb..df5959ca2 100644 --- a/slsDetectorCalibration/moenchCommonMode.h +++ b/slsDetectorCalibration/moenchCommonMode.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef MOENCHCOMMONMODE_H #define MOENCHCOMMONMODE_H diff --git a/slsDetectorCalibration/moenchExecutables/CMakeLists.txt b/slsDetectorCalibration/moenchExecutables/CMakeLists.txt index ba06c276a..cd7cb6182 100644 --- a/slsDetectorCalibration/moenchExecutables/CMakeLists.txt +++ b/slsDetectorCalibration/moenchExecutables/CMakeLists.txt @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package find_package(TIFF REQUIRED) diff --git a/slsDetectorCalibration/moenchExecutables/Makefile.cluster_finder b/slsDetectorCalibration/moenchExecutables/Makefile.cluster_finder index c5eeca444..f452a020f 100644 --- a/slsDetectorCalibration/moenchExecutables/Makefile.cluster_finder +++ b/slsDetectorCalibration/moenchExecutables/Makefile.cluster_finder @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package #module add CBFlib/0.9.5 INCDIR=-I. -I../ -I../interpolations -I../interpolations/etaVEL -I../dataStructures -I../../slsSupportLib/include/ -I../../slsReceiverSoftware/include/ diff --git a/slsDetectorCalibration/moenchExecutables/Makefile.zmq b/slsDetectorCalibration/moenchExecutables/Makefile.zmq index fdde1b8a1..af60de798 100644 --- a/slsDetectorCalibration/moenchExecutables/Makefile.zmq +++ b/slsDetectorCalibration/moenchExecutables/Makefile.zmq @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package INCDIR= -I. -I../dataStructures ../tiffIO.cpp -I../ -I../interpolations/ -I../../slsSupportLib/include/ -I../../slsReceiverSoftware/include/ -I../../libs/rapidjson/ LDFLAG= -L/usr/lib64/ -lpthread -lm -lstdc++ -lzmq -pthread -lrt -ltiff -O3 -std=c++11 -Wall -L../../build/bin/ -lSlsSupport diff --git a/slsDetectorCalibration/moenchExecutables/moench03ClusterFinder.cpp b/slsDetectorCalibration/moenchExecutables/moench03ClusterFinder.cpp index 36a6675af..4ed5d26e4 100644 --- a/slsDetectorCalibration/moenchExecutables/moench03ClusterFinder.cpp +++ b/slsDetectorCalibration/moenchExecutables/moench03ClusterFinder.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package //#include "sls/ansi.h" #include diff --git a/slsDetectorCalibration/moenchExecutables/moench03Interpolation.cpp b/slsDetectorCalibration/moenchExecutables/moench03Interpolation.cpp index eeeed90c6..dc9953590 100644 --- a/slsDetectorCalibration/moenchExecutables/moench03Interpolation.cpp +++ b/slsDetectorCalibration/moenchExecutables/moench03Interpolation.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "sls/ansi.h" #include diff --git a/slsDetectorCalibration/moenchExecutables/moench03NoInterpolation.cpp b/slsDetectorCalibration/moenchExecutables/moench03NoInterpolation.cpp index b07985ec9..406c5ae33 100644 --- a/slsDetectorCalibration/moenchExecutables/moench03NoInterpolation.cpp +++ b/slsDetectorCalibration/moenchExecutables/moench03NoInterpolation.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "sls/ansi.h" #include diff --git a/slsDetectorCalibration/moenchExecutables/moenchPhotonCounter.cpp b/slsDetectorCalibration/moenchExecutables/moenchPhotonCounter.cpp index 7b765bd5e..51b416e7a 100644 --- a/slsDetectorCalibration/moenchExecutables/moenchPhotonCounter.cpp +++ b/slsDetectorCalibration/moenchExecutables/moenchPhotonCounter.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package //#include "sls/ansi.h" #include #define CORR diff --git a/slsDetectorCalibration/moenchExecutables/moenchZmqProcess.cpp b/slsDetectorCalibration/moenchExecutables/moenchZmqProcess.cpp index b79c28f60..70237919b 100644 --- a/slsDetectorCalibration/moenchExecutables/moenchZmqProcess.cpp +++ b/slsDetectorCalibration/moenchExecutables/moenchZmqProcess.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package //#define WRITE_QUAD #define DEVELOPER #undef CORR diff --git a/slsDetectorCalibration/multiThreadedAnalogDetector.h b/slsDetectorCalibration/multiThreadedAnalogDetector.h index 3989b9020..d5a2ebdca 100644 --- a/slsDetectorCalibration/multiThreadedAnalogDetector.h +++ b/slsDetectorCalibration/multiThreadedAnalogDetector.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef MULTITHREADED_ANALOG_DETECTOR_H #define MULTITHREADED_ANALOG_DETECTOR_H diff --git a/slsDetectorCalibration/multiThreadedCountingDetector.h b/slsDetectorCalibration/multiThreadedCountingDetector.h index a4586b343..f1a7afb9c 100644 --- a/slsDetectorCalibration/multiThreadedCountingDetector.h +++ b/slsDetectorCalibration/multiThreadedCountingDetector.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef MULTITHREADED_COUNTING_DETECTOR_H #define MULTITHREADED_COUNTING_DETECTOR_H diff --git a/slsDetectorCalibration/multiThreadedInterpolatingDetector.h b/slsDetectorCalibration/multiThreadedInterpolatingDetector.h index fd3752e5b..1362cfdf2 100644 --- a/slsDetectorCalibration/multiThreadedInterpolatingDetector.h +++ b/slsDetectorCalibration/multiThreadedInterpolatingDetector.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef MULTITHREADED_INTERPOLATING_DETECTOR_H #define MULTITHREADED_INTERPOLATING_DETECTOR_H diff --git a/slsDetectorCalibration/pedestalSubtraction.h b/slsDetectorCalibration/pedestalSubtraction.h index 35c010d60..8283d6769 100644 --- a/slsDetectorCalibration/pedestalSubtraction.h +++ b/slsDetectorCalibration/pedestalSubtraction.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef PEDESTALSUBTRACTION_H #define PEDESTALSUBTRACTION_H diff --git a/slsDetectorCalibration/singlePhotonDetector.h b/slsDetectorCalibration/singlePhotonDetector.h index 09c2333db..720f3517d 100644 --- a/slsDetectorCalibration/singlePhotonDetector.h +++ b/slsDetectorCalibration/singlePhotonDetector.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef SINGLEPHOTONDETECTOR_H #define SINGLEPHOTONDETECTOR_H diff --git a/slsDetectorCalibration/single_photon_hit.h b/slsDetectorCalibration/single_photon_hit.h index 922527320..74da45dbe 100644 --- a/slsDetectorCalibration/single_photon_hit.h +++ b/slsDetectorCalibration/single_photon_hit.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef SINGLE_PHOTON_HIT_H #define SINGLE_PHOTON_HIT_H #include diff --git a/slsDetectorCalibration/tiffIO.cpp b/slsDetectorCalibration/tiffIO.cpp index 5b3d7b737..c92ba87fc 100644 --- a/slsDetectorCalibration/tiffIO.cpp +++ b/slsDetectorCalibration/tiffIO.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef MY_TIFF_IO_H #include "tiffIO.h" #endif diff --git a/slsDetectorCalibration/tiffIO.h b/slsDetectorCalibration/tiffIO.h index a248e367f..8b11b844e 100644 --- a/slsDetectorCalibration/tiffIO.h +++ b/slsDetectorCalibration/tiffIO.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef MY_TIFF_IO_H #define MY_TIFF_IO_H diff --git a/slsDetectorGui/CMakeLists.txt b/slsDetectorGui/CMakeLists.txt index 70e8a2e9b..75f4ed2f6 100755 --- a/slsDetectorGui/CMakeLists.txt +++ b/slsDetectorGui/CMakeLists.txt @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package set(CMAKE_AUTOMOC ON) find_package(Qt4 REQUIRED) diff --git a/slsDetectorGui/include/qCloneWidget.h b/slsDetectorGui/include/qCloneWidget.h index d63d98fe5..ce4484cb6 100644 --- a/slsDetectorGui/include/qCloneWidget.h +++ b/slsDetectorGui/include/qCloneWidget.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "ui_form_cloneplot.h" #include diff --git a/slsDetectorGui/include/qDacWidget.h b/slsDetectorGui/include/qDacWidget.h index 8925e1c32..ef2b7f85d 100644 --- a/slsDetectorGui/include/qDacWidget.h +++ b/slsDetectorGui/include/qDacWidget.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/Detector.h" #include "sls/sls_detector_defs.h" diff --git a/slsDetectorGui/include/qDefs.h b/slsDetectorGui/include/qDefs.h index 4364e3b3b..8ee853bae 100644 --- a/slsDetectorGui/include/qDefs.h +++ b/slsDetectorGui/include/qDefs.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/logger.h" diff --git a/slsDetectorGui/include/qDetectorMain.h b/slsDetectorGui/include/qDetectorMain.h index 92ae9b6cc..2d4b9ac38 100644 --- a/slsDetectorGui/include/qDetectorMain.h +++ b/slsDetectorGui/include/qDetectorMain.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "qDefs.h" #include "sls/Detector.h" diff --git a/slsDetectorGui/include/qDrawPlot.h b/slsDetectorGui/include/qDrawPlot.h index 03277ff49..df96214bf 100644 --- a/slsDetectorGui/include/qDrawPlot.h +++ b/slsDetectorGui/include/qDrawPlot.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "qDefs.h" #include "sls/Detector.h" diff --git a/slsDetectorGui/include/qTabAdvanced.h b/slsDetectorGui/include/qTabAdvanced.h index 355beab05..074ab4131 100644 --- a/slsDetectorGui/include/qTabAdvanced.h +++ b/slsDetectorGui/include/qTabAdvanced.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/Detector.h" #include "ui_form_tab_advanced.h" diff --git a/slsDetectorGui/include/qTabDataOutput.h b/slsDetectorGui/include/qTabDataOutput.h index 8f753a6db..bb1fbebe8 100644 --- a/slsDetectorGui/include/qTabDataOutput.h +++ b/slsDetectorGui/include/qTabDataOutput.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/Detector.h" #include "ui_form_tab_dataoutput.h" diff --git a/slsDetectorGui/include/qTabDebugging.h b/slsDetectorGui/include/qTabDebugging.h index 412046914..48cd85aae 100644 --- a/slsDetectorGui/include/qTabDebugging.h +++ b/slsDetectorGui/include/qTabDebugging.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/Detector.h" #include "ui_form_tab_debugging.h" diff --git a/slsDetectorGui/include/qTabDeveloper.h b/slsDetectorGui/include/qTabDeveloper.h index be3d25c4c..9dacf6442 100644 --- a/slsDetectorGui/include/qTabDeveloper.h +++ b/slsDetectorGui/include/qTabDeveloper.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/Detector.h" #include "sls/sls_detector_defs.h" diff --git a/slsDetectorGui/include/qTabMeasurement.h b/slsDetectorGui/include/qTabMeasurement.h index b1b1270a5..7b1f7d1aa 100644 --- a/slsDetectorGui/include/qTabMeasurement.h +++ b/slsDetectorGui/include/qTabMeasurement.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/Detector.h" #include "ui_form_tab_measurement.h" diff --git a/slsDetectorGui/include/qTabMessages.h b/slsDetectorGui/include/qTabMessages.h index 23f692478..98676fe24 100644 --- a/slsDetectorGui/include/qTabMessages.h +++ b/slsDetectorGui/include/qTabMessages.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "ui_form_tab_messages.h" diff --git a/slsDetectorGui/include/qTabPlot.h b/slsDetectorGui/include/qTabPlot.h index c146d07d9..073e3a7b3 100644 --- a/slsDetectorGui/include/qTabPlot.h +++ b/slsDetectorGui/include/qTabPlot.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/Detector.h" #include "ui_form_tab_plot.h" diff --git a/slsDetectorGui/include/qTabSettings.h b/slsDetectorGui/include/qTabSettings.h index d4ec2f73a..2a2a2c8af 100644 --- a/slsDetectorGui/include/qTabSettings.h +++ b/slsDetectorGui/include/qTabSettings.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/Detector.h" #include "ui_form_tab_settings.h" @@ -64,14 +66,7 @@ class qTabSettings : public QWidget, private Ui::TabSettingsObject { NUMSETTINGS }; - enum { - DYNAMIC, - FORCE_SWITCH_G1, - FORCE_SWITCH_G2, - FIX_G1, - FIX_G2, - FIX_G0 - }; + enum { DYNAMIC, FORCE_SWITCH_G1, FORCE_SWITCH_G2, FIX_G1, FIX_G2, FIX_G0 }; bool isVisibleFixG0{false}; enum { DYNAMICRANGE_32, DYNAMICRANGE_16, DYNAMICRANGE_8, DYNAMICRANGE_4 }; diff --git a/slsDetectorGui/slsDetectorPlotting/include/SlsQt1DPlot.h b/slsDetectorGui/slsDetectorPlotting/include/SlsQt1DPlot.h index da0dac1d1..e3cbb4e21 100644 --- a/slsDetectorGui/slsDetectorPlotting/include/SlsQt1DPlot.h +++ b/slsDetectorGui/slsDetectorPlotting/include/SlsQt1DPlot.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef SLSQT1DPLOT_H #define SLSQT1DPLOT_H diff --git a/slsDetectorGui/slsDetectorPlotting/include/SlsQt1DZoomer.h b/slsDetectorGui/slsDetectorPlotting/include/SlsQt1DZoomer.h index 5e9b8e079..c87a37931 100644 --- a/slsDetectorGui/slsDetectorPlotting/include/SlsQt1DZoomer.h +++ b/slsDetectorGui/slsDetectorPlotting/include/SlsQt1DZoomer.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef SLSQT1DZOOMER_H #define SLSQT1DZOOMER_H diff --git a/slsDetectorGui/slsDetectorPlotting/include/SlsQt2DHist.h b/slsDetectorGui/slsDetectorPlotting/include/SlsQt2DHist.h index eafb68eba..e19c1859b 100644 --- a/slsDetectorGui/slsDetectorPlotting/include/SlsQt2DHist.h +++ b/slsDetectorGui/slsDetectorPlotting/include/SlsQt2DHist.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef SLSQT2DHIST_H #define SLSQT2DHIST_H diff --git a/slsDetectorGui/slsDetectorPlotting/include/SlsQt2DPlot.h b/slsDetectorGui/slsDetectorPlotting/include/SlsQt2DPlot.h index 25342f8a7..b0067bc98 100644 --- a/slsDetectorGui/slsDetectorPlotting/include/SlsQt2DPlot.h +++ b/slsDetectorGui/slsDetectorPlotting/include/SlsQt2DPlot.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "SlsQt2DHist.h" #include "SlsQt2DZoomer.h" diff --git a/slsDetectorGui/slsDetectorPlotting/include/SlsQt2DZoomer.h b/slsDetectorGui/slsDetectorPlotting/include/SlsQt2DZoomer.h index a9592c550..227ec0e52 100644 --- a/slsDetectorGui/slsDetectorPlotting/include/SlsQt2DZoomer.h +++ b/slsDetectorGui/slsDetectorPlotting/include/SlsQt2DZoomer.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef SLSQT2DZOOMER_H #define SLSQT2DZOOMER_H #include "SlsQt2DHist.h" diff --git a/slsDetectorGui/slsDetectorPlotting/src/SlsQt1DPlot.cpp b/slsDetectorGui/slsDetectorPlotting/src/SlsQt1DPlot.cpp index 6c04f0124..cf3450a0d 100644 --- a/slsDetectorGui/slsDetectorPlotting/src/SlsQt1DPlot.cpp +++ b/slsDetectorGui/slsDetectorPlotting/src/SlsQt1DPlot.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package /* TODO! short description */ #include "SlsQt1DPlot.h" diff --git a/slsDetectorGui/slsDetectorPlotting/src/SlsQt1DZoomer.cpp b/slsDetectorGui/slsDetectorPlotting/src/SlsQt1DZoomer.cpp index 3c0bfa09f..85813fc45 100644 --- a/slsDetectorGui/slsDetectorPlotting/src/SlsQt1DZoomer.cpp +++ b/slsDetectorGui/slsDetectorPlotting/src/SlsQt1DZoomer.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package /* TODO! short description */ #include "SlsQt1DZoomer.h" #include "SlsQt1DPlot.h" diff --git a/slsDetectorGui/slsDetectorPlotting/src/SlsQt2DHist.cpp b/slsDetectorGui/slsDetectorPlotting/src/SlsQt2DHist.cpp index ade86d47c..a6dbf0548 100644 --- a/slsDetectorGui/slsDetectorPlotting/src/SlsQt2DHist.cpp +++ b/slsDetectorGui/slsDetectorPlotting/src/SlsQt2DHist.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package /* TODO! short description */ #include "SlsQt2DHist.h" #include "sls/ansi.h" diff --git a/slsDetectorGui/slsDetectorPlotting/src/SlsQt2DPlot.cpp b/slsDetectorGui/slsDetectorPlotting/src/SlsQt2DPlot.cpp index e00c93743..4a686e617 100644 --- a/slsDetectorGui/slsDetectorPlotting/src/SlsQt2DPlot.cpp +++ b/slsDetectorGui/slsDetectorPlotting/src/SlsQt2DPlot.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "SlsQt2DPlot.h" // #include "sls/ansi.h" diff --git a/slsDetectorGui/src/qCloneWidget.cpp b/slsDetectorGui/src/qCloneWidget.cpp index 42b80439e..4d8c4210f 100644 --- a/slsDetectorGui/src/qCloneWidget.cpp +++ b/slsDetectorGui/src/qCloneWidget.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "qCloneWidget.h" #include "SlsQt1DPlot.h" #include "SlsQt2DPlot.h" diff --git a/slsDetectorGui/src/qDacWidget.cpp b/slsDetectorGui/src/qDacWidget.cpp index 5db875e4f..7fb53b46b 100644 --- a/slsDetectorGui/src/qDacWidget.cpp +++ b/slsDetectorGui/src/qDacWidget.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "qDacWidget.h" #include "qDefs.h" diff --git a/slsDetectorGui/src/qDetectorMain.cpp b/slsDetectorGui/src/qDetectorMain.cpp index 634def39e..7d136aaba 100644 --- a/slsDetectorGui/src/qDetectorMain.cpp +++ b/slsDetectorGui/src/qDetectorMain.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "qDetectorMain.h" #include "qDefs.h" #include "qDrawPlot.h" @@ -439,34 +441,43 @@ void qDetectorMain::ExecuteHelp(QAction *action) { LOG(logINFO) << "About Common GUI for Jungfrau, Eiger, Mythen3, " "Gotthard, Gotthard2 and Moench detectors"; - std::string guiVersion = std::to_string(APIGUI); + std::string guiVersion = sls::ToStringHex(APIGUI); std::string clientVersion = "unknown"; try { - clientVersion = std::to_string(det->getClientVersion()); + clientVersion = sls::ToStringHex(det->getClientVersion()); } CATCH_DISPLAY("Could not get client version.", "qDetectorMain::ExecuteHelp") - qDefs::Message(qDefs::INFORMATION, - "

" - "SLS Detector GUI version:   " + - guiVersion + - "
" - "SLS Detector Client version: " + - clientVersion + - "

" - "Common GUI to control the SLS Detectors: " - "Jungfrau, Eiger, Mythen3, Gotthard, Gotthard2 and " - "Moench.

" - "It can be operated in parallel with the command " - "line interface:
" - "sls_detector_put,
sls_detector_get,
sls_" - "detector_acquire and
sls_detector_help.

" - "Please report bugs to:
" - "Dhanya.Thattil@psi.ch,
" - "Erik.Froejdh@psi.ch or
" - "Anna.Bergamaschi@psi.ch.<\\p>", - "qDetectorMain::ExecuteHelp"); + qDefs::Message( + qDefs::INFORMATION, + "

" + + "SLS Detector GUI version:   " + + guiVersion + + "
SLS Detector Client version: " + clientVersion + + "


" + + "Common GUI to control the SLS Detectors: " + "Jungfrau, Eiger, Mythen3, Gotthard, Gotthard2 and " + "Moench.

" + + "It can be operated in parallel with the command " + "line interface: sls_detector_put, sls_detector_get, " + "sls_detector_acquire and sls_detector_help.

" + + "Support:
" + "Dhanya.Thattil@psi.ch
" + "Erik.Froejdh@psi.ch.


" + + "
slsDetectorGui Copyright (C) 2021 Contributors to SLS " + "Detector Package

" + + "See COPYING in root folder for Licensing details:
" + "LGPL-3.0-or-other" + + "<\\p>", + "qDetectorMain::ExecuteHelp"); } } diff --git a/slsDetectorGui/src/qDrawPlot.cpp b/slsDetectorGui/src/qDrawPlot.cpp index c10646a8b..40edc1538 100644 --- a/slsDetectorGui/src/qDrawPlot.cpp +++ b/slsDetectorGui/src/qDrawPlot.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "qDrawPlot.h" #include "SlsQt1DPlot.h" #include "SlsQt2DPlot.h" diff --git a/slsDetectorGui/src/qTabAdvanced.cpp b/slsDetectorGui/src/qTabAdvanced.cpp index afbe147e2..35792344b 100644 --- a/slsDetectorGui/src/qTabAdvanced.cpp +++ b/slsDetectorGui/src/qTabAdvanced.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "qTabAdvanced.h" #include "qDefs.h" #include "qDrawPlot.h" diff --git a/slsDetectorGui/src/qTabDataOutput.cpp b/slsDetectorGui/src/qTabDataOutput.cpp index f750b7cba..171ec7f3e 100644 --- a/slsDetectorGui/src/qTabDataOutput.cpp +++ b/slsDetectorGui/src/qTabDataOutput.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "qTabDataOutput.h" #include "qDefs.h" @@ -369,27 +371,27 @@ void qTabDataOutput::SetRateCorrection() { } void qTabDataOutput::GetSpeed() { - LOG(logDEBUG) << "Getting Speed"; + LOG(logDEBUG) << "Getting Readout Speed"; disconnect(comboClkDivider, SIGNAL(currentIndexChanged(int)), this, SLOT(SetSpeed(int))); try { - auto retval = - det->getSpeed().tsquash("Speed is inconsistent for all detectors."); + auto retval = det->getReadoutSpeed().tsquash( + "Readout Speed is inconsistent for all detectors."); comboClkDivider->setCurrentIndex(static_cast(retval)); } - CATCH_DISPLAY("Could not get speed.", "qTabDataOutput::GetSpeed") + CATCH_DISPLAY("Could not get readout speed.", "qTabDataOutput::GetSpeed") connect(comboClkDivider, SIGNAL(currentIndexChanged(int)), this, SLOT(SetSpeed(int))); } void qTabDataOutput::SetSpeed(int speed) { - LOG(logINFO) << "Setting Speed to " + LOG(logINFO) << "Setting Readout Speed to " << comboClkDivider->currentText().toAscii().data(); try { - det->setSpeed(static_cast(speed)); + det->setReadoutSpeed(static_cast(speed)); } - CATCH_HANDLE("Could not set speed.", "qTabDataOutput::SetSpeed", this, - &qTabDataOutput::GetSpeed) + CATCH_HANDLE("Could not set readout speed.", "qTabDataOutput::SetSpeed", + this, &qTabDataOutput::GetSpeed) } void qTabDataOutput::GetParallel() { diff --git a/slsDetectorGui/src/qTabDebugging.cpp b/slsDetectorGui/src/qTabDebugging.cpp index 3e6497710..b995ba65a 100644 --- a/slsDetectorGui/src/qTabDebugging.cpp +++ b/slsDetectorGui/src/qTabDebugging.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "qTabDebugging.h" #include "qDefs.h" #include "sls/ToString.h" diff --git a/slsDetectorGui/src/qTabDeveloper.cpp b/slsDetectorGui/src/qTabDeveloper.cpp index 8d0084719..0c4a751e3 100644 --- a/slsDetectorGui/src/qTabDeveloper.cpp +++ b/slsDetectorGui/src/qTabDeveloper.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "qTabDeveloper.h" #include "qDacWidget.h" #include "qDefs.h" diff --git a/slsDetectorGui/src/qTabMeasurement.cpp b/slsDetectorGui/src/qTabMeasurement.cpp index 19aa42bf7..93e4e4409 100644 --- a/slsDetectorGui/src/qTabMeasurement.cpp +++ b/slsDetectorGui/src/qTabMeasurement.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "qTabMeasurement.h" #include "qDefs.h" #include "qDrawPlot.h" diff --git a/slsDetectorGui/src/qTabMessages.cpp b/slsDetectorGui/src/qTabMessages.cpp index 98a195989..8f87d02d7 100644 --- a/slsDetectorGui/src/qTabMessages.cpp +++ b/slsDetectorGui/src/qTabMessages.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "qTabMessages.h" #include "qDefs.h" diff --git a/slsDetectorGui/src/qTabPlot.cpp b/slsDetectorGui/src/qTabPlot.cpp index 1f1e77a4e..c4954b234 100644 --- a/slsDetectorGui/src/qTabPlot.cpp +++ b/slsDetectorGui/src/qTabPlot.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "qTabPlot.h" #include "qDefs.h" #include "qDrawPlot.h" diff --git a/slsDetectorGui/src/qTabSettings.cpp b/slsDetectorGui/src/qTabSettings.cpp index 158cd6de1..dcee0a450 100644 --- a/slsDetectorGui/src/qTabSettings.cpp +++ b/slsDetectorGui/src/qTabSettings.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "qTabSettings.h" #include "qDefs.h" #include "sls/ToString.h" @@ -126,8 +128,8 @@ void qTabSettings::SetupDetectorSettings() { item[(int)it]->setEnabled(true); } } - CATCH_DISPLAY(std::string("Could not setup settings"), - "qTabSettings::SetupDetectorSettings") + CATCH_DISPLAY(std::string("Could not setup settings"), + "qTabSettings::SetupDetectorSettings") } } diff --git a/slsDetectorServers/CMakeLists.txt b/slsDetectorServers/CMakeLists.txt index af46daa94..2bb9386b0 100644 --- a/slsDetectorServers/CMakeLists.txt +++ b/slsDetectorServers/CMakeLists.txt @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package diff --git a/slsDetectorServers/compileAllServers.sh b/slsDetectorServers/compileAllServers.sh index b72e980bd..3158da364 100644 --- a/slsDetectorServers/compileAllServers.sh +++ b/slsDetectorServers/compileAllServers.sh @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package if [ $# -eq 0 ]; then declare -a det=("ctbDetectorServer" "gotthardDetectorServer" diff --git a/slsDetectorServers/compileEigerServer.sh b/slsDetectorServers/compileEigerServer.sh index aa3348cf5..94e3343ca 100644 --- a/slsDetectorServers/compileEigerServer.sh +++ b/slsDetectorServers/compileEigerServer.sh @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package declare -a det=("eigerDetectorServer") declare -a deterror=("OK" "OK" "OK" "OK") diff --git a/slsDetectorServers/ctbDetectorServer/CMakeLists.txt b/slsDetectorServers/ctbDetectorServer/CMakeLists.txt index fab32df54..181600f44 100644 --- a/slsDetectorServers/ctbDetectorServer/CMakeLists.txt +++ b/slsDetectorServers/ctbDetectorServer/CMakeLists.txt @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package add_executable(ctbDetectorServer_virtual slsDetectorFunctionList.c ../slsDetectorServer/src/slsDetectorServer.c diff --git a/slsDetectorServers/ctbDetectorServer/Makefile b/slsDetectorServers/ctbDetectorServer/Makefile index fea8d8db6..56b3b271b 100755 --- a/slsDetectorServers/ctbDetectorServer/Makefile +++ b/slsDetectorServers/ctbDetectorServer/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package current_dir = $(shell pwd) main_inc = ../slsDetectorServer/include/ main_src = ../slsDetectorServer/src/ diff --git a/slsDetectorServers/ctbDetectorServer/RegisterDefs.h b/slsDetectorServers/ctbDetectorServer/RegisterDefs.h index 30e9f0649..ce7fa1337 100644 --- a/slsDetectorServers/ctbDetectorServer/RegisterDefs.h +++ b/slsDetectorServers/ctbDetectorServer/RegisterDefs.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once /* Definitions for FPGA */ diff --git a/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer b/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer index f5ef865e4..bf2e9f401 100755 Binary files a/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer and b/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer differ diff --git a/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServerv6.0.0-rc1 b/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServerv6.0.0-rc1 new file mode 100755 index 000000000..ba9bc1ef8 Binary files /dev/null and b/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServerv6.0.0-rc1 differ diff --git a/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c index e7f57a896..b1f8f51bb 100644 --- a/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "slsDetectorFunctionList.h" #include "clogger.h" #include "sharedMemory.h" diff --git a/slsDetectorServers/ctbDetectorServer/slsDetectorServer_defs.h b/slsDetectorServers/ctbDetectorServer/slsDetectorServer_defs.h index a878e5d22..93d7569cb 100644 --- a/slsDetectorServers/ctbDetectorServer/slsDetectorServer_defs.h +++ b/slsDetectorServers/ctbDetectorServer/slsDetectorServer_defs.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "RegisterDefs.h" #include "sls/sls_detector_defs.h" @@ -5,6 +7,8 @@ #define MIN_REQRD_VRSN_T_RD_API 0x181130 #define REQRD_FRMWR_VRSN 0x201005 +#define LINKED_SERVER_NAME "ctbDetectorServer" + #define CTRL_SRVR_INIT_TIME_US (2 * 1000 * 1000) /* Struct Definitions */ diff --git a/slsDetectorServers/eigerDetectorServer/9mhvserial_bf.c b/slsDetectorServers/eigerDetectorServer/9mhvserial_bf.c index 4a79ae522..d5651ec7b 100644 --- a/slsDetectorServers/eigerDetectorServer/9mhvserial_bf.c +++ b/slsDetectorServers/eigerDetectorServer/9mhvserial_bf.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "sls/ansi.h" #include diff --git a/slsDetectorServers/eigerDetectorServer/Beb.c b/slsDetectorServers/eigerDetectorServer/Beb.c index 629d0ba44..57fcd5a9a 100644 --- a/slsDetectorServers/eigerDetectorServer/Beb.c +++ b/slsDetectorServers/eigerDetectorServer/Beb.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "Beb.h" #include "FebRegisterDefs.h" #include "clogger.h" @@ -8,6 +10,8 @@ #include #include +extern int isControlServer; + #define MAX(x, y) (((x) > (y)) ? (x) : (y)) struct LocalLinkInterface ll_beb_local, *ll_beb; @@ -42,7 +46,6 @@ int Beb_deactivated_left_datastream = 1; int Beb_deactivated_right_datastream = 1; int Beb_deactivated_num_destinations = 1; - void Beb_Beb() { Beb_send_ndata = 0; Beb_send_buffer_size = 1026; @@ -85,7 +88,9 @@ void Beb_Beb() { void Beb_ClearHeaderData(int ten_gig) { for (int i = 0; i < MAX_UDP_DESTINATION; ++i) { if (!Beb_SetUpUDPHeader(i, ten_gig, 0, 0, 0, 0, 0, 0)) { - LOG(logERROR, ("Could not clear header data for entry %d (tengiga:%d)\n", i, ten_gig)); + LOG(logERROR, + ("Could not clear header data for entry %d (tengiga:%d)\n", i, + ten_gig)); } } } @@ -97,6 +102,9 @@ int Beb_SetUpUDPHeader(unsigned int header_number, int ten_gig, if (!Beb_activated) return 1; + if (!isControlServer) + return 1; + u_int32_t bram_phy_addr; u_int32_t *csp0base = 0; if (ten_gig) @@ -104,7 +112,8 @@ int Beb_SetUpUDPHeader(unsigned int header_number, int ten_gig, else bram_phy_addr = 0xC6001000; - if (!Beb_SetHeaderData(src_mac, src_ip, src_port, dst_mac, dst_ip, dst_port)) + if (!Beb_SetHeaderData(src_mac, src_ip, src_port, dst_mac, dst_ip, + dst_port)) return 0; int fd = Beb_open(&csp0base, bram_phy_addr); @@ -485,7 +494,7 @@ int Beb_SetDataStream(enum portPosition port, int enable) { : XPAR_GPIO_RGHT_STRM_DSBL_MSK); u_int32_t value = Beb_Read32(csp0base, reg); - // disabling in firmware + // disabling in firmware if (!enable) value |= mask; else @@ -867,11 +876,12 @@ int Beb_StopAcquisition() { return 1; } -int Beb_RequestNImages(int ten_gig, unsigned int nimages, int test_just_send_out_packets_no_wait) { +int Beb_RequestNImages(int ten_gig, unsigned int nimages, + int test_just_send_out_packets_no_wait) { if (!Beb_activated) return 1; - unsigned int maxnl = MAX_ROWS_PER_READOUT; + unsigned int maxnl = MAX_ROWS_PER_READOUT; unsigned int maxnp = (ten_gig ? 4 : 16) * Beb_bit_mode; unsigned int nl = Beb_readNRows; unsigned int npackets = (nl * maxnp) / maxnl; @@ -891,8 +901,8 @@ int Beb_RequestNImages(int ten_gig, unsigned int nimages, int test_just_send_out LOG(logINFO, ("ten_gig:%d, npackets:%d, " "Beb_bit_mode:%d, header_size:%d, nimages:%d, " "test_just_send_out_packets_no_wait:%d\n", - ten_gig, npackets, Beb_bit_mode, - header_size, nimages, test_just_send_out_packets_no_wait)); + ten_gig, npackets, Beb_bit_mode, header_size, nimages, + test_just_send_out_packets_no_wait)); u_int32_t right_port_value = 0x2000; u_int32_t *csp0base = 0; diff --git a/slsDetectorServers/eigerDetectorServer/Beb.h b/slsDetectorServers/eigerDetectorServer/Beb.h index c4449b540..a238c1529 100644 --- a/slsDetectorServers/eigerDetectorServer/Beb.h +++ b/slsDetectorServers/eigerDetectorServer/Beb.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "LocalLinkInterface.h" diff --git a/slsDetectorServers/eigerDetectorServer/CMakeLists.txt b/slsDetectorServers/eigerDetectorServer/CMakeLists.txt index 64f1635e1..ae8b9b0ea 100644 --- a/slsDetectorServers/eigerDetectorServer/CMakeLists.txt +++ b/slsDetectorServers/eigerDetectorServer/CMakeLists.txt @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package set(src slsDetectorFunctionList.c ../slsDetectorServer/src/slsDetectorServer.c diff --git a/slsDetectorServers/eigerDetectorServer/FebControl.c b/slsDetectorServers/eigerDetectorServer/FebControl.c index 6ca0b85ae..27d98a30a 100644 --- a/slsDetectorServers/eigerDetectorServer/FebControl.c +++ b/slsDetectorServers/eigerDetectorServer/FebControl.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "FebControl.h" #include "Beb.h" #include "FebRegisterDefs.h" @@ -1141,7 +1143,8 @@ int Feb_Control_SoftwareTrigger(int block) { // end of acquisition (cannot monitor readyForTrigger) int status = Feb_Control_AcquisitionInProgress(); if (status == STATUS_ERROR) { - LOG(logERROR, ("Status: ERROR reading DAQ status register\n")); + LOG(logERROR, + ("Status: ERROR reading DAQ status register\n")); return 0; } else if (status == STATUS_IDLE) { break; @@ -1156,8 +1159,10 @@ int Feb_Control_SoftwareTrigger(int block) { } LOG(logDEBUG2, ("Done waiting (wait for trigger)!\n")); } - LOG(logINFO, ("%s Software Trigger %s\n", (block ? "Blocking" : "Non blocking"), (block ? "Acquired" : "Sent"))); - fflush(stdout); + LOG(logINFO, + ("%s Software Trigger %s\n", (block ? "Blocking" : "Non blocking"), + (block ? "Acquired" : "Sent"))); + fflush(stdout); } return 1; diff --git a/slsDetectorServers/eigerDetectorServer/FebControl.h b/slsDetectorServers/eigerDetectorServer/FebControl.h index d600a6ca8..7ede407ad 100644 --- a/slsDetectorServers/eigerDetectorServer/FebControl.h +++ b/slsDetectorServers/eigerDetectorServer/FebControl.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "FebInterface.h" #include "slsDetectorServer_defs.h" diff --git a/slsDetectorServers/eigerDetectorServer/FebInterface.c b/slsDetectorServers/eigerDetectorServer/FebInterface.c index 69042ce41..c93aa6a44 100644 --- a/slsDetectorServers/eigerDetectorServer/FebInterface.c +++ b/slsDetectorServers/eigerDetectorServer/FebInterface.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "FebInterface.h" #include "LocalLinkInterface.h" #include "clogger.h" diff --git a/slsDetectorServers/eigerDetectorServer/FebInterface.h b/slsDetectorServers/eigerDetectorServer/FebInterface.h index e89ff498d..afff53a87 100644 --- a/slsDetectorServers/eigerDetectorServer/FebInterface.h +++ b/slsDetectorServers/eigerDetectorServer/FebInterface.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once int Feb_Interface_WriteTo(unsigned int ch); diff --git a/slsDetectorServers/eigerDetectorServer/FebRegisterDefs.h b/slsDetectorServers/eigerDetectorServer/FebRegisterDefs.h index 643463858..db2627181 100644 --- a/slsDetectorServers/eigerDetectorServer/FebRegisterDefs.h +++ b/slsDetectorServers/eigerDetectorServer/FebRegisterDefs.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package // daq register definitions #define DAQ_REG_CTRL 1 @@ -13,7 +15,7 @@ #define DAQ_REG_EXPOSURE_REPEAT_TIMER 5 // == (31 downto 3) * 10^(2 downto 0) #define DAQ_REG_SUBFRAME_EXPOSURES 6 #define DAQ_REG_SUBFRAME_PERIOD 7 // also pg and fifo status register -#define DAQ_REG_READ_N_ROWS 8 +#define DAQ_REG_READ_N_ROWS 8 #define DAQ_REG_HRDWRE 12 // clang-format off diff --git a/slsDetectorServers/eigerDetectorServer/HardwareIO.c b/slsDetectorServers/eigerDetectorServer/HardwareIO.c index e6487af4a..7e783d5d2 100644 --- a/slsDetectorServers/eigerDetectorServer/HardwareIO.c +++ b/slsDetectorServers/eigerDetectorServer/HardwareIO.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "HardwareIO.h" xfs_u8 HWIO_xfs_in8(xfs_u32 InAddress) { diff --git a/slsDetectorServers/eigerDetectorServer/HardwareIO.h b/slsDetectorServers/eigerDetectorServer/HardwareIO.h index dd2d0c73d..3e21ddc8b 100644 --- a/slsDetectorServers/eigerDetectorServer/HardwareIO.h +++ b/slsDetectorServers/eigerDetectorServer/HardwareIO.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package // Class initially from Gerd and was called mmap_test.c #pragma once diff --git a/slsDetectorServers/eigerDetectorServer/HardwareMMappingDefs.h b/slsDetectorServers/eigerDetectorServer/HardwareMMappingDefs.h index f2523f9a2..e8a99aac6 100644 --- a/slsDetectorServers/eigerDetectorServer/HardwareMMappingDefs.h +++ b/slsDetectorServers/eigerDetectorServer/HardwareMMappingDefs.h @@ -1,4 +1,5 @@ - +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package // from Gerd and was called mmap_test.h diff --git a/slsDetectorServers/eigerDetectorServer/LocalLinkInterface.c b/slsDetectorServers/eigerDetectorServer/LocalLinkInterface.c index 1c7dace24..c9252cf55 100644 --- a/slsDetectorServers/eigerDetectorServer/LocalLinkInterface.c +++ b/slsDetectorServers/eigerDetectorServer/LocalLinkInterface.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "LocalLinkInterface.h" #include "HardwareMMappingDefs.h" #include "clogger.h" diff --git a/slsDetectorServers/eigerDetectorServer/LocalLinkInterface.h b/slsDetectorServers/eigerDetectorServer/LocalLinkInterface.h index 4dfcbfa6c..ec587297b 100644 --- a/slsDetectorServers/eigerDetectorServer/LocalLinkInterface.h +++ b/slsDetectorServers/eigerDetectorServer/LocalLinkInterface.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "HardwareIO.h" diff --git a/slsDetectorServers/eigerDetectorServer/Makefile b/slsDetectorServers/eigerDetectorServer/Makefile index 5f1d61d2d..c242d3bb1 100755 --- a/slsDetectorServers/eigerDetectorServer/Makefile +++ b/slsDetectorServers/eigerDetectorServer/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package current_dir = $(shell pwd) main_inc = ../slsDetectorServer/include/ main_src = ../slsDetectorServer/src/ diff --git a/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer b/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer index ed694dfd8..b76382caa 100755 Binary files a/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer and b/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer differ diff --git a/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServerv6.0.0-rc2 b/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServerv6.0.0-rc2 new file mode 100755 index 000000000..5f5d1db5e Binary files /dev/null and b/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServerv6.0.0-rc2 differ diff --git a/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c index eb44e5aaa..3e1ff4ef3 100644 --- a/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "slsDetectorFunctionList.h" #include "clogger.h" #include "common.h" @@ -690,7 +692,7 @@ void setupDetector() { eiger_photonenergy = DEFAULT_PHOTON_ENERGY; setParallelMode(DEFAULT_PARALLEL_MODE); setOverFlowMode(DEFAULT_READOUT_OVERFLOW32_MODE); - setClockDivider(RUN_CLK, DEFAULT_CLK_SPEED); // clk_devider,half speed + setReadoutSpeed(DEFAULT_CLK_SPEED); setIODelay(DEFAULT_IO_DELAY); setTiming(DEFAULT_TIMING_MODE); setNextFrameNumber(DEFAULT_STARTING_FRAME_NUMBER); @@ -1542,13 +1544,13 @@ int configureMAC() { LOG(logINFOBLUE, ("\tEntry %d\n", iRxEntry)); LOG(logINFO, ("\tSource IP : %s\n" - "\tSource MAC : %s\n" - "\tSource Port : %d\n" - "\tDest IP : %s\n" - "\tDest MAC : %s\n" - "\tDest Port : %d\n" - "\tDest Port2 : %d\n", - src_ip, src_mac, srcport, dst_ip, dst_mac, dstport, dstport2)); + "\tSource MAC : %s\n" + "\tSource Port : %d\n" + "\tDest IP : %s\n" + "\tDest MAC : %s\n" + "\tDest Port : %d\n" + "\tDest Port2 : %d\n", + src_ip, src_mac, srcport, dst_ip, dst_mac, dstport, dstport2)); } #ifdef VIRTUAL @@ -1712,11 +1714,7 @@ int enableTenGigabitEthernet(int val) { } /* eiger specific - iodelay, pulse, rate, temp, activate, delay nw parameter */ -int setClockDivider(enum CLKINDEX ind, int val) { - if (ind != RUN_CLK) { - LOG(logERROR, ("Unknown clock index: %d\n", ind)); - return FAIL; - } +int setReadoutSpeed(int val) { if (val >= 0) { LOG(logINFO, ("Setting Read out Speed: %d\n", val)); #ifndef VIRTUAL @@ -1732,12 +1730,9 @@ int setClockDivider(enum CLKINDEX ind, int val) { return OK; } -int getClockDivider(enum CLKINDEX ind) { - if (ind != RUN_CLK) { - LOG(logERROR, ("Unknown clock index: %d\n", ind)); - return FAIL; - } - return eiger_readoutspeed; +int getReadoutSpeed(int *retval) { + *retval = eiger_readoutspeed; + return OK; } int setIODelay(int val) { @@ -2047,17 +2042,17 @@ int setAllTrimbits(int val) { } int getAllTrimbits() { - int value = *((detectorModules->chanregs)); if (detectorModules) { + int value = (*((detectorModules->chanregs))); for (int ichan = 0; ichan < (detectorModules->nchan); ichan++) { if (*((detectorModules->chanregs) + ichan) != value) { - value = -1; - break; + return -1; } } + LOG(logINFO, ("Value of all Trimbits: %d\n", value)); + return value; } - LOG(logINFO, ("Value of all Trimbits: %d\n", value)); - return value; + return -1; } int getBebFPGATemp() { @@ -2316,14 +2311,11 @@ void *start_timer(void *arg) { int readNRows = getReadNRows(); if (readNRows == -1) { - LOG(logERROR, - ("readNRows is -1. Assuming no readNRows.\n")); + LOG(logERROR, ("readNRows is -1. Assuming no readNRows.\n")); readNRows = MAX_ROWS_PER_READOUT; } const int maxRows = MAX_ROWS_PER_READOUT; - const int packetsPerFrame = - (maxPacketsPerFrame * readNRows) / maxRows; - + const int packetsPerFrame = (maxPacketsPerFrame * readNRows) / maxRows; LOG(logDEBUG1, (" dr:%d\n bytesperpixel:%f\n tgenable:%d\n datasize:%d\n " @@ -2363,19 +2355,16 @@ void *start_timer(void *arg) { break; case 16: *((uint16_t *)(imageData + i * sizeof(uint16_t))) = - eiger_virtual_test_mode ? 0xFFE - : (uint16_t)pixelVal; + eiger_virtual_test_mode ? 0xFFE : (uint16_t)pixelVal; break; case 32: *((uint32_t *)(imageData + i * sizeof(uint32_t))) = - eiger_virtual_test_mode ? 0xFFFFFE - : (uint32_t)pixelVal; + eiger_virtual_test_mode ? 0xFFFFFE : (uint32_t)pixelVal; break; default: break; } } - } // Send data @@ -2409,7 +2398,6 @@ void *start_timer(void *arg) { const int startval = 0; const int endval = startval + packetsPerFrame - 1; - // set header char packetData[packetsize]; memset(packetData, 0, packetsize); @@ -2471,18 +2459,21 @@ void *start_timer(void *arg) { } } } - if (eiger_virtual_left_datastream && i >= startval && i <= endval) { + if (eiger_virtual_left_datastream && i >= startval && + i <= endval) { usleep(eiger_virtual_transmission_delay_left); sendUDPPacket(iRxEntry, 0, packetData, packetsize); LOG(logDEBUG1, ("Sent left packet: %d\n", i)); } - if (eiger_virtual_right_datastream && i >= startval && i <= endval) { + if (eiger_virtual_right_datastream && i >= startval && + i <= endval) { usleep(eiger_virtual_transmission_delay_right); sendUDPPacket(iRxEntry, 1, packetData2, packetsize); LOG(logDEBUG1, ("Sent right packet: %d\n", i)); } } - LOG(logINFO, ("Sent frame %d [#%ld] to E%d\n", iframes, frameNr + iframes, iRxEntry)); + LOG(logINFO, ("Sent frame %d [#%ld] to E%d\n", iframes, + frameNr + iframes, iRxEntry)); clock_gettime(CLOCK_REALTIME, &end); int64_t timeNs = ((end.tv_sec - begin.tv_sec) * 1E9 + (end.tv_nsec - begin.tv_nsec)); diff --git a/slsDetectorServers/eigerDetectorServer/slsDetectorServer_defs.h b/slsDetectorServers/eigerDetectorServer/slsDetectorServer_defs.h index 125891d14..3f0e5a288 100644 --- a/slsDetectorServers/eigerDetectorServer/slsDetectorServer_defs.h +++ b/slsDetectorServers/eigerDetectorServer/slsDetectorServer_defs.h @@ -1,7 +1,11 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/sls_detector_defs.h" -#define REQUIRED_FIRMWARE_VERSION (27) +#define LINKED_SERVER_NAME "eigerDetectorServer" + +#define REQUIRED_FIRMWARE_VERSION (29) // virtual ones renamed for consistency // real ones keep previous name for compatibility (already in production) #ifdef VIRTUAL @@ -9,8 +13,8 @@ #else #define ID_FILE "detid.txt" #endif -#define CONFIG_FILE ("config_eiger.txt") -#define WAIT_STOP_SERVER_START (1 * 1000 * 1000) +#define CONFIG_FILE ("config_eiger.txt") +#define WAIT_STOP_SERVER_START (1 * 1000 * 1000) #define STATUS_IDLE 0 #define STATUS_RUNNING 1 diff --git a/slsDetectorServers/eigerDetectorServer/xfs_types.h b/slsDetectorServers/eigerDetectorServer/xfs_types.h index 3c7d6216c..1c998bdc4 100644 --- a/slsDetectorServers/eigerDetectorServer/xfs_types.h +++ b/slsDetectorServers/eigerDetectorServer/xfs_types.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once //#include "types.h" diff --git a/slsDetectorServers/eigerDetectorServer/xparameters.h b/slsDetectorServers/eigerDetectorServer/xparameters.h index d293257d2..4b3bf1312 100644 --- a/slsDetectorServers/eigerDetectorServer/xparameters.h +++ b/slsDetectorServers/eigerDetectorServer/xparameters.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package /* ONLY THOSE ARE USED IN THIS SOFTWARE. If one of those is modified in xilinx compilation, this file should be replaced with updated values XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_RIGHT_BASEADDR diff --git a/slsDetectorServers/gotthard2DetectorServer/CMakeLists.txt b/slsDetectorServers/gotthard2DetectorServer/CMakeLists.txt index f1399bf9c..dbe403fd3 100644 --- a/slsDetectorServers/gotthard2DetectorServer/CMakeLists.txt +++ b/slsDetectorServers/gotthard2DetectorServer/CMakeLists.txt @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package add_executable(gotthard2DetectorServer_virtual slsDetectorFunctionList.c ../slsDetectorServer/src/slsDetectorServer.c diff --git a/slsDetectorServers/gotthard2DetectorServer/Makefile b/slsDetectorServers/gotthard2DetectorServer/Makefile index 481827eab..23ea50584 100755 --- a/slsDetectorServers/gotthard2DetectorServer/Makefile +++ b/slsDetectorServers/gotthard2DetectorServer/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package current_dir = $(shell pwd) main_inc = ../slsDetectorServer/include/ main_src = ../slsDetectorServer/src/ diff --git a/slsDetectorServers/gotthard2DetectorServer/RegisterDefs.h b/slsDetectorServers/gotthard2DetectorServer/RegisterDefs.h index cb1ac8428..a5a1fb87a 100644 --- a/slsDetectorServers/gotthard2DetectorServer/RegisterDefs.h +++ b/slsDetectorServers/gotthard2DetectorServer/RegisterDefs.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once // clang-format off #define REG_OFFSET (4) diff --git a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer index 44269428c..a010150dc 100755 Binary files a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer and b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer differ diff --git a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServerv6.0.0-rc1 b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServerv6.0.0-rc1 new file mode 100755 index 000000000..9511bbb65 Binary files /dev/null and b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServerv6.0.0-rc1 differ diff --git a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c index 9d7fd73bb..a9ae54ae6 100644 --- a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "slsDetectorFunctionList.h" #include "ALTERA_PLL_CYCLONE10.h" #include "ASIC_Driver.h" @@ -294,7 +296,8 @@ int getModuleId(int *ret, char *mess) { void setModuleId(int modid) { LOG(logINFOBLUE, ("Setting module id in fpga: %d\n", modid)) bus_w(MOD_ID_REG, bus_r(MOD_ID_REG) & ~MOD_ID_MSK); - bus_w(MOD_ID_REG, bus_r(MOD_ID_REG) | ((modid << MOD_ID_OFST) & MOD_ID_MSK)); + bus_w(MOD_ID_REG, + bus_r(MOD_ID_REG) | ((modid << MOD_ID_OFST) & MOD_ID_MSK)); } u_int64_t getDetectorMAC() { @@ -506,6 +509,7 @@ void setupDetector() { setCurrentSource(DEFAULT_CURRENT_SOURCE); setVetoAlgorithm(DEFAULT_ALGORITHM, LOW_LATENCY_LINK); setVetoAlgorithm(DEFAULT_ALGORITHM, ETHERNET_10GB); + setReadoutSpeed(DEFAULT_READOUT_SPEED); } void setASICDefaults() { @@ -1912,23 +1916,21 @@ int checkDetectorType() { int type = atoi(buffer); if (type > TYPE_NO_MODULE_STARTING_VAL) { LOG(logERROR, - ("No Module attached! Expected %d, %d or %d for Gotthard2, got %d\n", - TYPE_GOTTHARD2_MODULE_VAL, - TYPE_GOTTHARD2_25UM_MASTER_MODULE_VAL, - TYPE_GOTTHARD2_25UM_SLAVE_MODULE_VAL, - type)); + ("No Module attached! Expected %d, %d or %d for Gotthard2, got " + "%d\n", + TYPE_GOTTHARD2_MODULE_VAL, TYPE_GOTTHARD2_25UM_MASTER_MODULE_VAL, + TYPE_GOTTHARD2_25UM_SLAVE_MODULE_VAL, type)); return -2; } if ((abs(type - TYPE_GOTTHARD2_MODULE_VAL) > TYPE_TOLERANCE) && - (abs(type - TYPE_GOTTHARD2_25UM_MASTER_MODULE_VAL) > TYPE_TOLERANCE) && - (abs(type - TYPE_GOTTHARD2_25UM_SLAVE_MODULE_VAL) > TYPE_TOLERANCE)) { + (abs(type - TYPE_GOTTHARD2_25UM_MASTER_MODULE_VAL) > TYPE_TOLERANCE) && + (abs(type - TYPE_GOTTHARD2_25UM_SLAVE_MODULE_VAL) > TYPE_TOLERANCE)) { LOG(logERROR, - ("Wrong Module attached! Expected %d, %d or %d for Gotthard2, got %d\n", - TYPE_GOTTHARD2_MODULE_VAL, - TYPE_GOTTHARD2_25UM_MASTER_MODULE_VAL, - TYPE_GOTTHARD2_25UM_SLAVE_MODULE_VAL, - type)); + ("Wrong Module attached! Expected %d, %d or %d for Gotthard2, got " + "%d\n", + TYPE_GOTTHARD2_MODULE_VAL, TYPE_GOTTHARD2_25UM_MASTER_MODULE_VAL, + TYPE_GOTTHARD2_25UM_SLAVE_MODULE_VAL, type)); return FAIL; } return OK; @@ -2083,6 +2085,61 @@ int getVCOFrequency(enum CLKINDEX ind) { return ALTERA_PLL_C10_GetVCOFrequency(pllIndex); } +int setReadoutSpeed(int val) { + switch (val) { + case G2_108MHZ: + LOG(logINFOBLUE, ("Setting readout speed to 108 MHz\n")); + if (setClockDivider(READOUT_C0, SPEED_108_CLKDIV_0) == FAIL) { + return FAIL; + } + if (setClockDivider(READOUT_C1, SPEED_108_CLKDIV_1) == FAIL) { + return FAIL; + } + if (setPhase(READOUT_C1, SPEED_108_CLKPHASE_DEG_1, 1) == FAIL) { + return FAIL; + } + break; + case G2_144MHZ: + LOG(logINFOBLUE, ("Setting readout speed to 144 MHz\n")); + if (setClockDivider(READOUT_C0, SPEED_144_CLKDIV_0) == FAIL) { + return FAIL; + } + if (setClockDivider(READOUT_C1, SPEED_144_CLKDIV_1) == FAIL) { + return FAIL; + } + if (setPhase(READOUT_C1, SPEED_144_CLKPHASE_DEG_1, 1) == FAIL) { + return FAIL; + } + break; + default: + LOG(logERROR, ("Unknown readout speed %d\n", val)); + return FAIL; + } + return OK; +} + +int getReadoutSpeed(int *retval) { + // TODO ASIC and ADIFreg need to check???? + // clkdiv 2, 3, 4, 5? + if (clkDivider[READOUT_C0] == SPEED_108_CLKDIV_0 && + clkDivider[READOUT_C1] == SPEED_108_CLKDIV_1 && + getPhase(READOUT_C1, 1) == SPEED_108_CLKPHASE_DEG_1) { + *retval = G2_108MHZ; + } + + else if (clkDivider[READOUT_C0] == SPEED_144_CLKDIV_0 && + clkDivider[READOUT_C1] == SPEED_144_CLKDIV_1 && + getPhase(READOUT_C1, 1) == SPEED_144_CLKPHASE_DEG_1) { + *retval = G2_144MHZ; + } + + else { + *retval = -1; + return FAIL; + } + return OK; +} + int getMaxClockDivider() { return ALTERA_PLL_C10_GetMaxClockDivider(); } int setClockDivider(enum CLKINDEX ind, int val) { @@ -2095,8 +2152,8 @@ int setClockDivider(enum CLKINDEX ind, int val) { } char *clock_names[] = {CLK_NAMES}; - LOG(logINFO, ("\tSetting %s clock (%d) divider from %d to %d\n", - clock_names[ind], ind, clkDivider[ind], val)); + LOG(logINFOBLUE, ("Setting %s clock (%d) divider from %d to %d\n", + clock_names[ind], ind, clkDivider[ind], val)); // Remembering old phases in degrees int oldPhases[NUM_CLOCKS]; diff --git a/slsDetectorServers/gotthard2DetectorServer/slsDetectorServer_defs.h b/slsDetectorServers/gotthard2DetectorServer/slsDetectorServer_defs.h index 6046fba9e..44fa5f4e6 100644 --- a/slsDetectorServers/gotthard2DetectorServer/slsDetectorServer_defs.h +++ b/slsDetectorServers/gotthard2DetectorServer/slsDetectorServer_defs.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/sls_detector_defs.h" @@ -5,34 +7,36 @@ #define KERNEL_DATE_VRSN "Wed May 20 13:58:38 CEST 2020" #define ID_FILE "detid_gotthard2.txt" +#define LINKED_SERVER_NAME "gotthard2DetectorServer" + #define CTRL_SRVR_INIT_TIME_US (300 * 1000) /* Hardware Definitions */ -#define NCHAN (128) -#define NCHIP (10) -#define NDAC (16) -#define NADC (32) -#define ONCHIP_NDAC (7) -#define DYNAMIC_RANGE (16) -#define HV_SOFT_MAX_VOLTAGE (500) -#define HV_HARD_MAX_VOLTAGE (530) -#define HV_DRIVER_FILE_NAME ("/etc/devlinks/hvdac") -#define DAC_DRIVER_FILE_NAME ("/etc/devlinks/dac") -#define ONCHIP_DAC_DRIVER_FILE_NAME ("/etc/devlinks/chipdac") -#define TYPE_FILE_NAME ("/etc/devlinks/type") -#define CONFIG_FILE ("config_gotthard2.txt") -#define DAC_MAX_MV (2048) -#define ONCHIP_DAC_MAX_VAL (0x3FF) -#define ADU_MAX_VAL (0xFFF) -#define ADU_MAX_BITS (12) -#define MAX_FRAMES_IN_BURST_MODE (2720) -#define TYPE_GOTTHARD2_MODULE_VAL (536) -#define TYPE_GOTTHARD2_25UM_MASTER_MODULE_VAL (683) -#define TYPE_GOTTHARD2_25UM_SLAVE_MODULE_VAL (704) -#define TYPE_GOTTHARD2_MODULE_VAL (536) -#define TYPE_TOLERANCE (5) -#define TYPE_NO_MODULE_STARTING_VAL (800) -#define INITIAL_STARTUP_WAIT (1 * 1000 * 1000) +#define NCHAN (128) +#define NCHIP (10) +#define NDAC (16) +#define NADC (32) +#define ONCHIP_NDAC (7) +#define DYNAMIC_RANGE (16) +#define HV_SOFT_MAX_VOLTAGE (500) +#define HV_HARD_MAX_VOLTAGE (530) +#define HV_DRIVER_FILE_NAME ("/etc/devlinks/hvdac") +#define DAC_DRIVER_FILE_NAME ("/etc/devlinks/dac") +#define ONCHIP_DAC_DRIVER_FILE_NAME ("/etc/devlinks/chipdac") +#define TYPE_FILE_NAME ("/etc/devlinks/type") +#define CONFIG_FILE ("config_gotthard2.txt") +#define DAC_MAX_MV (2048) +#define ONCHIP_DAC_MAX_VAL (0x3FF) +#define ADU_MAX_VAL (0xFFF) +#define ADU_MAX_BITS (12) +#define MAX_FRAMES_IN_BURST_MODE (2720) +#define TYPE_GOTTHARD2_MODULE_VAL (536) +#define TYPE_GOTTHARD2_25UM_MASTER_MODULE_VAL (683) +#define TYPE_GOTTHARD2_25UM_SLAVE_MODULE_VAL (704) +#define TYPE_GOTTHARD2_MODULE_VAL (536) +#define TYPE_TOLERANCE (5) +#define TYPE_NO_MODULE_STARTING_VAL (800) +#define INITIAL_STARTUP_WAIT (1 * 1000 * 1000) /** Default Parameters */ #define DEFAULT_BURST_MODE (BURST_INTERNAL) @@ -52,13 +56,21 @@ #define DEFAULT_TIMING_SOURCE (TIMING_INTERNAL) #define DEFAULT_ALGORITHM (ALG_HITS) -#define DEFAULT_READOUT_C0 (8) //(108333336) // rdo_clk, 144 MHz -#define DEFAULT_READOUT_C1 (8) //(108333336) // rdo_x2_clk, 144 MHz +#define DEFAULT_READOUT_C0 (8) //(108333336) // rdo_clk, 144 MHz +#define DEFAULT_READOUT_C1 (8) //(108333336) // rdo_x2_clk, 144 MHz #define DEFAULT_SYSTEM_C0 (5) //(144444448) // run_clk, 144 MHz #define DEFAULT_SYSTEM_C1 (10) //(72222224) // chip_clk, 72 MHz #define DEFAULT_SYSTEM_C2 (5) //(144444448) // sync_clk, 144 MHz #define DEFAULT_SYSTEM_C3 (5) //(144444448) // str_clk, 144 MHz +#define DEFAULT_READOUT_SPEED (G2_108MHZ) +#define SPEED_144_CLKDIV_0 (6) +#define SPEED_144_CLKDIV_1 (6) +#define SPEED_144_CLKPHASE_DEG_1 (122) // 125 not possible +#define SPEED_108_CLKDIV_0 (8) +#define SPEED_108_CLKDIV_1 (8) +#define SPEED_108_CLKPHASE_DEG_1 (268) // 270 not possible + /* Firmware Definitions */ #define FIXED_PLL_FREQUENCY (20000000) // 20MHz #define INT_SYSTEM_C0_FREQUENCY (144000000) // 144 MHz @@ -70,7 +82,7 @@ #define DEFAULT_ASIC_DOUT_RDY_SRC (0x5) #define DEFAULT_ASIC_DOUT_RDY_DLY (0x3) -#define VETO_DATA_SIZE (160) +#define VETO_DATA_SIZE (160) typedef struct { uint64_t frameNumber; uint64_t bunchId; @@ -149,17 +161,17 @@ enum PLLINDEX { READOUT_PLL, SYSTEM_PLL }; #define ASIC_ADC_MAX_VAL (0x7F) #define ASIC_GLOBAL_SETT_MAX_BITS (6) -#define ASIC_EXT_MEMCTRL_OFST (0) -#define ASIC_EXT_MEMCTRL_MSK (0x1 << ASIC_EXT_MEMCTRL_OFST) -#define ASIC_EXT_TIMING_OFST (1) -#define ASIC_EXT_TIMING_MSK (0x1 << ASIC_EXT_TIMING_OFST) -#define ASIC_CONT_MODE_OFST (2) -#define ASIC_CONT_MODE_MSK (0x1 << ASIC_CONT_MODE_OFST) -#define ASIC_FILTER_OFST (3) -#define ASIC_FILTER_MSK (0x3 << ASIC_FILTER_OFST) +#define ASIC_EXT_MEMCTRL_OFST (0) +#define ASIC_EXT_MEMCTRL_MSK (0x1 << ASIC_EXT_MEMCTRL_OFST) +#define ASIC_EXT_TIMING_OFST (1) +#define ASIC_EXT_TIMING_MSK (0x1 << ASIC_EXT_TIMING_OFST) +#define ASIC_CONT_MODE_OFST (2) +#define ASIC_CONT_MODE_MSK (0x1 << ASIC_CONT_MODE_OFST) +#define ASIC_FILTER_OFST (3) +#define ASIC_FILTER_MSK (0x3 << ASIC_FILTER_OFST) #define ASIC_FILTER_MAX_RES_VALUE (3) -#define ASIC_CDS_GAIN_OFST (5) -#define ASIC_CDS_GAIN_MSK (0x1 << ASIC_CDS_GAIN_OFST) +#define ASIC_CDS_GAIN_OFST (5) +#define ASIC_CDS_GAIN_MSK (0x1 << ASIC_CDS_GAIN_OFST) /* Struct Definitions */ typedef struct udp_header_struct { diff --git a/slsDetectorServers/gotthardDetectorServer/CMakeLists.txt b/slsDetectorServers/gotthardDetectorServer/CMakeLists.txt index 8dc6bf58a..e2f7eac57 100644 --- a/slsDetectorServers/gotthardDetectorServer/CMakeLists.txt +++ b/slsDetectorServers/gotthardDetectorServer/CMakeLists.txt @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package add_executable(gotthardDetectorServer_virtual slsDetectorFunctionList.c ../slsDetectorServer/src/slsDetectorServer.c diff --git a/slsDetectorServers/gotthardDetectorServer/Makefile b/slsDetectorServers/gotthardDetectorServer/Makefile index 9544d991c..75bed6bb9 100755 --- a/slsDetectorServers/gotthardDetectorServer/Makefile +++ b/slsDetectorServers/gotthardDetectorServer/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package current_dir = $(shell pwd) main_inc = ../slsDetectorServer/include/ main_src = ../slsDetectorServer/src/ diff --git a/slsDetectorServers/gotthardDetectorServer/RegisterDefs.h b/slsDetectorServers/gotthardDetectorServer/RegisterDefs.h index c8ba9c463..d04e80346 100644 --- a/slsDetectorServers/gotthardDetectorServer/RegisterDefs.h +++ b/slsDetectorServers/gotthardDetectorServer/RegisterDefs.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once /* Definitions for FPGA*/ diff --git a/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer b/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer index 4fad0385a..420700477 100755 Binary files a/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer and b/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer differ diff --git a/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServerv6.0.0-rc1 b/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServerv6.0.0-rc1 new file mode 100755 index 000000000..c281e81ff Binary files /dev/null and b/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServerv6.0.0-rc1 differ diff --git a/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c index 895042dd6..1fd57beb4 100644 --- a/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "slsDetectorFunctionList.h" #include "RegisterDefs.h" #include "clogger.h" diff --git a/slsDetectorServers/gotthardDetectorServer/slsDetectorServer_defs.h b/slsDetectorServers/gotthardDetectorServer/slsDetectorServer_defs.h index f88039230..b91bb9ab2 100644 --- a/slsDetectorServers/gotthardDetectorServer/slsDetectorServer_defs.h +++ b/slsDetectorServers/gotthardDetectorServer/slsDetectorServer_defs.h @@ -1,7 +1,11 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/sls_detector_defs.h" #include +#define LINKED_SERVER_NAME "gotthardDetectorServer" + /* Enums */ enum ADCINDEX { TEMP_FPGA, TEMP_ADC }; enum DACINDEX { diff --git a/slsDetectorServers/jungfrauDetectorServer/CMakeLists.txt b/slsDetectorServers/jungfrauDetectorServer/CMakeLists.txt index d5d251e81..b1cd36a13 100644 --- a/slsDetectorServers/jungfrauDetectorServer/CMakeLists.txt +++ b/slsDetectorServers/jungfrauDetectorServer/CMakeLists.txt @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package add_executable(jungfrauDetectorServer_virtual slsDetectorFunctionList.c ../slsDetectorServer/src/slsDetectorServer.c diff --git a/slsDetectorServers/jungfrauDetectorServer/Makefile b/slsDetectorServers/jungfrauDetectorServer/Makefile index 054f2c62a..0468da861 100755 --- a/slsDetectorServers/jungfrauDetectorServer/Makefile +++ b/slsDetectorServers/jungfrauDetectorServer/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package current_dir = $(shell pwd) main_inc = ../slsDetectorServer/include/ main_src = ../slsDetectorServer/src/ diff --git a/slsDetectorServers/jungfrauDetectorServer/RegisterDefs.h b/slsDetectorServers/jungfrauDetectorServer/RegisterDefs.h index 90db574f5..c632c3190 100644 --- a/slsDetectorServers/jungfrauDetectorServer/RegisterDefs.h +++ b/slsDetectorServers/jungfrauDetectorServer/RegisterDefs.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once // clang-format off diff --git a/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer b/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer index 89b848b5b..a4707a077 100755 Binary files a/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer and b/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer differ diff --git a/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c index 5ffd80ed3..8c54ca640 100644 --- a/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "slsDetectorFunctionList.h" #include "clogger.h" #include "sharedMemory.h" @@ -457,7 +459,7 @@ void setupDetector() { return; } - setClockDivider(RUN_CLK, HALF_SPEED); + setReadoutSpeed(HALF_SPEED); cleanFifos(); resetCore(); @@ -487,8 +489,6 @@ void setupDetector() { // not applicable for chipv1.1 setStorageCellDelay(DEFAULT_STRG_CLL_DLY); } - /*setClockDivider(RUN_CLK, HALF_SPEED); depends if all the previous stuff - * works*/ setTiming(DEFAULT_TIMING_MODE); setNextFrameNumber(DEFAULT_STARTING_FRAME_NUMBER); @@ -516,11 +516,11 @@ int resetToDefaultDacs(int hardReset) { const int vals_G0[] = SPECIAL_DEFAULT_DYNAMIC_GAIN_VALS; for (int i = 0; i < NSPECIALDACS; ++i) { defaultDacValue_G0[i] = vals_G0[i]; - } + } const int vals_HG0[] = SPECIAL_DEFAULT_DYNAMICHG0_GAIN_VALS; for (int i = 0; i < NSPECIALDACS; ++i) { defaultDacValue_HG0[i] = vals_HG0[i]; - } + } } // remember settings @@ -734,7 +734,9 @@ int readConfigFile() { // version 1.1 and HW 1.0 (version reg value = 2) is incompatible if (version == 11 && isHardwareVersion2()) { strcpy(initErrorMessage, - "Chip version 1.1 (from on-board config file) is incompatible with old board (v1.0). Please update board or correct on-board config file.\n"); + "Chip version 1.1 (from on-board config file) is " + "incompatible with old board (v1.0). Please update " + "board or correct on-board config file.\n"); break; } @@ -1352,7 +1354,9 @@ int setNumberofDestinations(int value) { LOG(logINFO, ("Setting number of entries to %d\n", value)); --value; bus_w(CONTROL_REG, bus_r(CONTROL_REG) & ~CONTROL_RX_ADDTNL_ENDPTS_NUM_MSK); - bus_w(CONTROL_REG, bus_r(CONTROL_REG) | ((value << CONTROL_RX_ADDTNL_ENDPTS_NUM_OFST) & CONTROL_RX_ADDTNL_ENDPTS_NUM_MSK)); + bus_w(CONTROL_REG, + bus_r(CONTROL_REG) | ((value << CONTROL_RX_ADDTNL_ENDPTS_NUM_OFST) & + CONTROL_RX_ADDTNL_ENDPTS_NUM_MSK)); return OK; } @@ -1391,7 +1395,7 @@ int getPrimaryInterface() { void setupHeader(int iRxEntry, enum interfaceType type, uint32_t destip, uint64_t destmac, uint32_t destport, uint64_t sourcemac, uint32_t sourceip, uint32_t sourceport) { - + // start addr uint32_t addr = (type == INNER ? RXR_ENDPOINT_INNER_START_REG : RXR_ENDPOINT_OUTER_START_REG); @@ -1506,27 +1510,30 @@ int configureMAC() { if (iRxEntry < numUdpDestinations) { LOG(logINFOBLUE, ("\tEntry %d\n", iRxEntry)); - LOG(logINFO, ("\tOuter %s\n", (numInterfaces == 2) - ? "(Bottom)" - : (selInterface ? "Not Used" : "Used"))); + LOG(logINFO, + ("\tOuter %s\n", (numInterfaces == 2) + ? "(Bottom)" + : (selInterface ? "Not Used" : "Used"))); LOG(logINFO, ("\tSource IP : %s\n" - "\tSource MAC : %s\n" - "\tSource Port : %d\n" - "\tDest IP : %s\n" - "\tDest MAC : %s\n" - "\tDest Port : %d\n\n", - src_ip, src_mac, srcport, dst_ip, dst_mac, dstport)); + "\tSource MAC : %s\n" + "\tSource Port : %d\n" + "\tDest IP : %s\n" + "\tDest MAC : %s\n" + "\tDest Port : %d\n\n", + src_ip, src_mac, srcport, dst_ip, dst_mac, dstport)); - LOG(logINFO, ("\tInner %s\n", (numInterfaces == 2) - ? "(Top)" - : (selInterface ? "Used" : "Not Used"))); - LOG(logINFO, ("\tSource IP2 : %s\n" - "\tSource MAC2 : %s\n" - "\tSource Port2: %d\n" - "\tDest IP2 : %s\n" - "\tDest MAC2 : %s\n" - "\tDest Port2 : %d\n\n", - src_ip2, src_mac2, srcport2, dst_ip2, dst_mac2, dstport2)); + LOG(logINFO, + ("\tInner %s\n", (numInterfaces == 2) + ? "(Top)" + : (selInterface ? "Used" : "Not Used"))); + LOG(logINFO, + ("\tSource IP2 : %s\n" + "\tSource MAC2 : %s\n" + "\tSource Port2: %d\n" + "\tDest IP2 : %s\n" + "\tDest MAC2 : %s\n" + "\tDest Port2 : %d\n\n", + src_ip2, src_mac2, srcport2, dst_ip2, dst_mac2, dstport2)); } #ifdef VIRTUAL if (setUDPDestinationDetails(iRxEntry, 0, dst_ip, dstport) == FAIL) { @@ -1548,18 +1555,18 @@ int configureMAC() { setupHeader(iRxEntry, OUTER, dstip, dstmac, dstport, srcmac, srcip, srcport); // top - setupHeader(iRxEntry, INNER, dstip2, dstmac2, dstport2, srcmac2, srcip2, - srcport2); + setupHeader(iRxEntry, INNER, dstip2, dstmac2, dstport2, srcmac2, + srcip2, srcport2); } // single interface else { // default if (selInterface == 0) { - setupHeader(iRxEntry, OUTER, dstip, dstmac, dstport, srcmac, srcip, - srcport); + setupHeader(iRxEntry, OUTER, dstip, dstmac, dstport, srcmac, + srcip, srcport); } else { - setupHeader(iRxEntry, INNER, dstip, dstmac, dstport, srcmac, srcip, - srcport2); + setupHeader(iRxEntry, INNER, dstip, dstmac, dstport, srcmac, + srcip, srcport2); } } } @@ -1652,16 +1659,17 @@ int setReadNRows(int value) { return FAIL; } - // regval is numpackets - 1 + // regval is numpackets - 1 int regval = (value / READ_N_ROWS_MULTIPLE) - 1; uint32_t addr = READ_N_ROWS_REG; LOG(logINFO, ("Setting number of rows: %d (regval:%d)\n", value, regval)); - bus_w(addr, bus_r(addr) &~READ_N_ROWS_NUM_ROWS_MSK); - bus_w(addr, bus_r(addr) | ((regval << READ_N_ROWS_NUM_ROWS_OFST) & READ_N_ROWS_NUM_ROWS_MSK)); + bus_w(addr, bus_r(addr) & ~READ_N_ROWS_NUM_ROWS_MSK); + bus_w(addr, bus_r(addr) | ((regval << READ_N_ROWS_NUM_ROWS_OFST) & + READ_N_ROWS_NUM_ROWS_MSK)); if (value == MAX_ROWS_PER_READOUT) { LOG(logINFO, ("Disabling Partial Readout (#rows)\n")); - bus_w(addr, bus_r(addr) &~READ_N_ROWS_ENBL_MSK); + bus_w(addr, bus_r(addr) & ~READ_N_ROWS_ENBL_MSK); } else { LOG(logINFO, ("Enabling Partial Readout (#rows)\n")); bus_w(addr, bus_r(addr) | READ_N_ROWS_ENBL_MSK); @@ -1671,14 +1679,15 @@ int setReadNRows(int value) { int getReadNRows() { int enable = (bus_r(READ_N_ROWS_REG) & READ_N_ROWS_ENBL_MSK); - int regval = ((bus_r(READ_N_ROWS_REG) & READ_N_ROWS_NUM_ROWS_MSK) >> READ_N_ROWS_NUM_ROWS_OFST); - - int maxRegval = (MAX_ROWS_PER_READOUT/ READ_N_ROWS_MULTIPLE) - 1; + int regval = ((bus_r(READ_N_ROWS_REG) & READ_N_ROWS_NUM_ROWS_MSK) >> + READ_N_ROWS_NUM_ROWS_OFST); + + int maxRegval = (MAX_ROWS_PER_READOUT / READ_N_ROWS_MULTIPLE) - 1; if ((regval == maxRegval && enable) || (regval != maxRegval && !enable)) { return -1; } - return (regval + 1) * READ_N_ROWS_MULTIPLE; + return (regval + 1) * READ_N_ROWS_MULTIPLE; } void initReadoutConfiguration() { @@ -1724,13 +1733,13 @@ int powerChip(int on) { LOG(logINFOBLUE, ("Powering chip: on\n")); bus_w(CHIP_POWER_REG, bus_r(CHIP_POWER_REG) | CHIP_POWER_ENABLE_MSK); - - configureChip(); + + configureChip(); } else { LOG(logINFOBLUE, ("Powering chip: off\n")); bus_w(CHIP_POWER_REG, bus_r(CHIP_POWER_REG) & ~CHIP_POWER_ENABLE_MSK); - + chipConfigured = 0; } } @@ -1742,21 +1751,19 @@ int powerChip(int on) { CHIP_POWER_STATUS_OFST); } -int isChipConfigured() { - return chipConfigured; -} +int isChipConfigured() { return chipConfigured; } void configureChip() { // only for chipv1.1 and chip is powered on if (getChipVersion() == 11 && powerChip(-1)) { LOG(logINFOBLUE, ("\tConfiguring chip\n")); - + // waiting 500 ms before configuring selection usleep(500 * 1000); // write same values to configure selection // if (chip was powered off earlier) - LOG(logINFO, ("\tSetting default values for selection\n")) + LOG(logINFO, ("\tRewriting values for selection\n")) bus_w(CRRNT_SRC_COL_LSB_REG, bus_r(CRRNT_SRC_COL_LSB_REG)); bus_w(CRRNT_SRC_COL_MSB_REG, bus_r(CRRNT_SRC_COL_MSB_REG)); @@ -1766,12 +1773,11 @@ void configureChip() { // write same register values back to configure chip bus_w(CONFIG_V11_REG, bus_r(CONFIG_V11_REG)); - LOG(logINFOBLUE, ("\tChip configured\n")); + LOG(logINFOBLUE, ("\tChip configured\n")); chipConfigured = 1; } } - int autoCompDisable(int on) { if (on != -1) { if (on) { @@ -1823,11 +1829,7 @@ void configureASICTimer() { ASIC_CTRL_DS_TMR_VAL); } -int setClockDivider(enum CLKINDEX ind, int val) { - if (ind != RUN_CLK) { - LOG(logERROR, ("Unknown clock index %d to set speed\n", ind)); - return FAIL; - } +int setReadoutSpeed(int val) { // stop state machine if running if (runBusy()) { stopStateMachine(); @@ -1847,14 +1849,17 @@ int setClockDivider(enum CLKINDEX ind, int val) { return FAIL; } LOG(logINFO, ("Setting Full Speed (40 MHz):\n")); - adcOfst = ADC_OFST_FULL_SPEED_VAL; if (getChipVersion() == 10) { sampleAdcSpeed = SAMPLE_ADC_FULL_SPEED_CHIP10; + adcPhase = ADC_PHASE_FULL_SPEED_CHIP10; + dbitPhase = DBIT_PHASE_FULL_SPEED_CHIP10; + adcOfst = ADC_OFST_FULL_SPEED_VAL_CHIP10; } else { - sampleAdcSpeed = SAMPLE_ADC_FULL_SPEED; + sampleAdcSpeed = SAMPLE_ADC_FULL_SPEED_CHIP11; + adcPhase = ADC_PHASE_FULL_SPEED_CHIP11; + dbitPhase = DBIT_PHASE_FULL_SPEED_CHIP11; + adcOfst = ADC_OFST_FULL_SPEED_VAL_CHIP11; } - adcPhase = ADC_PHASE_FULL_SPEED; - dbitPhase = DBIT_PHASE_FULL_SPEED; config = CONFIG_FULL_SPEED_40MHZ_VAL; break; @@ -1866,15 +1871,15 @@ int setClockDivider(enum CLKINDEX ind, int val) { adcPhase = ADC_PHASE_HALF_SPEED_BOARD2; dbitPhase = DBIT_PHASE_HALF_SPEED_BOARD2; } else if (getChipVersion() == 10) { - adcOfst = ADC_OFST_HALF_SPEED_VAL; + adcOfst = ADC_OFST_HALF_SPEED_VAL_CHIP10; sampleAdcSpeed = SAMPLE_ADC_HALF_SPEED_CHIP10; - adcPhase = ADC_PHASE_HALF_SPEED; - dbitPhase = DBIT_PHASE_HALF_SPEED; + adcPhase = ADC_PHASE_HALF_SPEED_CHIP10; + dbitPhase = DBIT_PHASE_HALF_SPEED_CHIP10; } else { - adcOfst = ADC_OFST_HALF_SPEED_VAL; - sampleAdcSpeed = SAMPLE_ADC_HALF_SPEED; - adcPhase = ADC_PHASE_HALF_SPEED; - dbitPhase = DBIT_PHASE_HALF_SPEED; + adcOfst = ADC_OFST_HALF_SPEED_VAL_CHIP11; + sampleAdcSpeed = SAMPLE_ADC_HALF_SPEED_CHIP11; + adcPhase = ADC_PHASE_HALF_SPEED_CHIP11; + dbitPhase = DBIT_PHASE_HALF_SPEED_CHIP11; } config = CONFIG_HALF_SPEED_20MHZ_VAL; break; @@ -1887,15 +1892,15 @@ int setClockDivider(enum CLKINDEX ind, int val) { adcPhase = ADC_PHASE_QUARTER_SPEED_BOARD2; dbitPhase = DBIT_PHASE_QUARTER_SPEED_BOARD2; } else if (getChipVersion() == 10) { - adcOfst = ADC_OFST_QUARTER_SPEED_VAL; + adcOfst = ADC_OFST_QUARTER_SPEED_VAL_CHIP10; sampleAdcSpeed = SAMPLE_ADC_QUARTER_SPEED_CHIP10; - adcPhase = ADC_PHASE_QUARTER_SPEED; - dbitPhase = DBIT_PHASE_QUARTER_SPEED; + adcPhase = ADC_PHASE_QUARTER_SPEED_CHIP10; + dbitPhase = DBIT_PHASE_QUARTER_SPEED_CHIP10; } else { - adcOfst = ADC_OFST_QUARTER_SPEED_VAL; - sampleAdcSpeed = SAMPLE_ADC_QUARTER_SPEED; - adcPhase = ADC_PHASE_QUARTER_SPEED; - dbitPhase = DBIT_PHASE_QUARTER_SPEED; + adcOfst = ADC_OFST_QUARTER_SPEED_VAL_CHIP11; + sampleAdcSpeed = SAMPLE_ADC_QUARTER_SPEED_CHIP11; + adcPhase = ADC_PHASE_QUARTER_SPEED_CHIP11; + dbitPhase = DBIT_PHASE_QUARTER_SPEED_CHIP11; } config = CONFIG_QUARTER_SPEED_10MHZ_VAL; break; @@ -1923,23 +1928,24 @@ int setClockDivider(enum CLKINDEX ind, int val) { return OK; } -int getClockDivider(enum CLKINDEX ind) { - if (ind != RUN_CLK) { - LOG(logERROR, ("Unknown clock index %d to get speed\n", ind)); - return -1; - } +int getReadoutSpeed(int *retval) { u_int32_t speed = bus_r(CONFIG_REG) & CONFIG_READOUT_SPEED_MSK; switch (speed) { case CONFIG_FULL_SPEED_40MHZ_VAL: - return FULL_SPEED; + *retval = FULL_SPEED; + break; case CONFIG_HALF_SPEED_20MHZ_VAL: - return HALF_SPEED; + *retval = HALF_SPEED; + break; case CONFIG_QUARTER_SPEED_10MHZ_VAL: - return QUARTER_SPEED; + *retval = QUARTER_SPEED; + break; default: LOG(logERROR, ("Unknown speed val: %d\n", speed)); - return -1; + *retval = -1; + return FAIL; } + return OK; } int setPhase(enum CLKINDEX ind, int val, int degrees) { @@ -2191,24 +2197,31 @@ int getFilterCell() { #else uint32_t addr = CONFIG_V11_STATUS_REG; #endif - uint32_t value = (bus_r(addr) & CONFIG_V11_FLTR_CLL_MSK) >> CONFIG_V11_FLTR_CLL_OFST; + uint32_t value = + (bus_r(addr) & CONFIG_V11_FLTR_CLL_MSK) >> CONFIG_V11_FLTR_CLL_OFST; // count number of bits = which icell return (__builtin_popcount(value)); } void setFilterCell(int iCell) { - uint32_t value = 0; - // sets the corresponding cell and the cells before it - if (iCell != 0) { - value = iCell; - if (value > 1) { - value += (value - 1); - } + if (iCell > MAX_FILTER_CELL_VAL) { + return; } + uint32_t addr = CONFIG_V11_REG; - bus_w(addr, bus_r(addr) &~ CONFIG_V11_FLTR_CLL_MSK); - bus_w(addr, bus_r(addr) | ((value << CONFIG_V11_FLTR_CLL_OFST) & CONFIG_V11_FLTR_CLL_MSK)); - LOG(logINFO, ("Setting Filter Cell to %d [Reg:0x%x]\n", iCell, bus_r(addr))); + bus_w(addr, bus_r(addr) & ~CONFIG_V11_FLTR_CLL_MSK); + + if (iCell > 0) { + // enables as many cells + uint32_t value = 0; + for (int i = 0; i != iCell; ++i) { + value |= (1 << i); + } + bus_w(addr, bus_r(addr) | ((value << CONFIG_V11_FLTR_CLL_OFST) & + CONFIG_V11_FLTR_CLL_MSK)); + } + LOG(logINFO, + ("Setting Filter Cell to %d [Reg:0x%x]\n", iCell, bus_r(addr))); } void disableCurrentSource() { @@ -2228,15 +2241,16 @@ void disableCurrentSource() { } void enableCurrentSource(int fix, uint64_t select, int normal) { + disableCurrentSource(); + if (getChipVersion() == 11) { - LOG(logINFO, ("Enabling current source [fix:%d, select:%lld]\n", fix, - (long long int)select)); + LOG(logINFO, ("Enabling current source [fix:%d, select:0x%lx]\n", fix, + (long unsigned int)select)); } else { LOG(logINFO, - ("Enabling current source [fix:%d, select:0x%llx, normal:%d]\n", - fix, (long long int)select, normal)); + ("Enabling current source [fix:%d, select:%ld, normal:%d]\n", fix, + (long int)select, normal)); } - disableCurrentSource(); // fix if (fix) { LOG(logINFO, ("\tEnabling fix\n")); @@ -2247,7 +2261,7 @@ void enableCurrentSource(int fix, uint64_t select, int normal) { } if (getChipVersion() == 10) { // select - LOG(logINFO, ("\tSetting selection\n")) + LOG(logINFO, ("\tSetting selection to %ld\n", (long int)select)); bus_w(DAQ_REG, bus_r(DAQ_REG) & ~DAQ_CRRNT_SRC_CLMN_SLCT_MSK); bus_w(DAQ_REG, bus_r(DAQ_REG) | ((select << DAQ_CRRNT_SRC_CLMN_SLCT_OFST) & @@ -2255,8 +2269,19 @@ void enableCurrentSource(int fix, uint64_t select, int normal) { } else { // select - LOG(logINFO, ("\tSetting selection\n")) - set64BitReg(select, CRRNT_SRC_COL_LSB_REG, CRRNT_SRC_COL_MSB_REG); + // invert select first + uint64_t tmp = select; + uint64_t inverted = 0; + for (int i = 0; i != 64; ++i) { + // get each bit from LSB side + uint64_t bit = (tmp >> i) & 0x1; + // push the bit into MSB side + inverted |= (bit << (63 - i)); + } + LOG(logINFO, ("\tSetting selection to 0x%lx (inverted from 0x%lx)\n", + (long unsigned int)inverted, (long unsigned int)select)); + set64BitReg(inverted, CRRNT_SRC_COL_LSB_REG, CRRNT_SRC_COL_MSB_REG); + // normal if (normal) { LOG(logINFO, ("\tEnabling normal\n")) @@ -2309,7 +2334,19 @@ uint64_t getSelectCurrentSource() { return ((bus_r(DAQ_REG) & DAQ_CRRNT_SRC_CLMN_SLCT_MSK) >> DAQ_CRRNT_SRC_CLMN_SLCT_OFST); } else { - return get64BitReg(CRRNT_SRC_COL_LSB_REG, CRRNT_SRC_COL_MSB_REG); + // invert the select + uint64_t retval = + get64BitReg(CRRNT_SRC_COL_LSB_REG, CRRNT_SRC_COL_MSB_REG); + + uint64_t tmp = retval; + uint64_t inverted = 0; + for (int i = 0; i != 64; ++i) { + // get each bit from LSB side + uint64_t bit = (tmp >> i) & 0x1; + // push the bit into MSB side + inverted |= (bit << (63 - i)); + } + return inverted; } } @@ -2462,7 +2499,7 @@ void *start_timer(void *arg) { for (int i = 0; i != maxPacketsPerFrame; ++i) { const int startval = - (maxPacketsPerFrame / 2) - (packetsPerFrame / 2); + (maxPacketsPerFrame / 2) - (packetsPerFrame / 2); const int endval = startval + packetsPerFrame - 1; int pnum = i; @@ -2511,14 +2548,16 @@ void *start_timer(void *arg) { memcpy(packetData2 + sizeof(sls_detector_header), imageData + srcOffset2, dataSize); srcOffset2 += dataSize; - + if (i >= startval && i <= endval) { sendUDPPacket(iRxEntry, 1, packetData2, packetsize); - LOG(logDEBUG1, ("Sent packet: %d [interface 1]\n", pnum)); + LOG(logDEBUG1, + ("Sent packet: %d [interface 1]\n", pnum)); } } } - LOG(logINFO, ("Sent frame %d [#%ld] to E%d\n", iframes, frameNr + iframes, iRxEntry)); + LOG(logINFO, ("Sent frame %d [#%ld] to E%d\n", iframes, + frameNr + iframes, iRxEntry)); clock_gettime(CLOCK_REALTIME, &end); int64_t timeNs = ((end.tv_sec - begin.tv_sec) * 1E9 + (end.tv_nsec - begin.tv_nsec)); diff --git a/slsDetectorServers/jungfrauDetectorServer/slsDetectorServer_defs.h b/slsDetectorServers/jungfrauDetectorServer/slsDetectorServer_defs.h index b7a98d9b0..67e899c24 100644 --- a/slsDetectorServers/jungfrauDetectorServer/slsDetectorServer_defs.h +++ b/slsDetectorServers/jungfrauDetectorServer/slsDetectorServer_defs.h @@ -1,10 +1,14 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "RegisterDefs.h" #include "sls/sls_detector_defs.h" #define MIN_REQRD_VRSN_T_RD_API 0x171220 #define REQRD_FRMWRE_VRSN_BOARD2 0x210831 // 1.0 pcb (version = 010) -#define REQRD_FRMWRE_VRSN 0x210910 // 2.0 pcb (version = 011) +#define REQRD_FRMWRE_VRSN 0x211008 // 2.0 pcb (version = 011) + +#define LINKED_SERVER_NAME "jungfrauDetectorServer" #define CTRL_SRVR_INIT_TIME_US (300 * 1000) @@ -63,9 +67,9 @@ enum DACINDEX { 420 /* J_VREF_COMP */ \ }; -#define NUMSETTINGS (2) -#define NSPECIALDACS (3) -#define SPECIALDACINDEX {J_VREF_PRECH, J_VREF_DS, J_VREF_COMP}; +#define NUMSETTINGS (2) +#define NSPECIALDACS (3) +#define SPECIALDACINDEX {J_VREF_PRECH, J_VREF_DS, J_VREF_COMP}; #define SPECIAL_DEFAULT_DYNAMIC_GAIN_VALS \ { 1450, 480, 420 } #define SPECIAL_DEFAULT_DYNAMICHG0_GAIN_VALS \ @@ -109,20 +113,20 @@ enum CLKINDEX { RUN_CLK, ADC_CLK, DBIT_CLK, NUM_CLOCKS }; #define DEFAULT_FILTER_RESISTOR (1) // higher resistor #define DEFAULT_FILTER_CELL (0) -#define HIGHVOLTAGE_MIN (60) -#define HIGHVOLTAGE_MAX (200) -#define DAC_MIN_MV (0) -#define DAC_MAX_MV (2500) -#define MAX_FILTER_CELL_VAL (12) +#define HIGHVOLTAGE_MIN (60) +#define HIGHVOLTAGE_MAX (200) +#define DAC_MIN_MV (0) +#define DAC_MAX_MV (2500) +#define MAX_FILTER_CELL_VAL (12) #define MIN_ROWS_PER_READOUT (8) #define MAX_ROWS_PER_READOUT (512) -#define READ_N_ROWS_MULTIPLE (8) //512 rows/128packets * 2 interfaces - +#define READ_N_ROWS_MULTIPLE (8) // 512 rows/128packets * 2 interfaces + /* Defines in the Firmware */ #define MAX_TIMESLOT_VAL (0x1F) #define MAX_THRESHOLD_TEMP_VAL (127999) // millidegrees #define MAX_STORAGE_CELL_VAL (15) // 0xF -#define MAX_STORAGE_CELL_CHIP11_VAL (3) +#define MAX_STORAGE_CELL_CHIP11_VAL (3) #define MAX_STORAGE_CELL_DLY_NS_VAL (ASIC_CTRL_EXPSRE_TMR_MAX_VAL) #define ACQ_TIME_MIN_CLOCK (2) #define ASIC_FILTER_MAX_RES_VALUE (1) @@ -132,26 +136,32 @@ enum CLKINDEX { RUN_CLK, ADC_CLK, DBIT_CLK, NUM_CLOCKS }; #define BIT16_MASK (0xFFFF) // pipeline -#define ADC_OFST_FULL_SPEED_VAL (0x10) // 2.0 pcb -#define ADC_OFST_HALF_SPEED_VAL (0x08) // 2.0 pcb -#define ADC_OFST_QUARTER_SPEED_VAL (0x04) // 2.0 pcb -#define ADC_OFST_HALF_SPEED_BOARD2_VAL (0x10) // 1.0 pcb (2 resistor network) -#define ADC_OFST_QUARTER_SPEED_BOARD2_VAL (0x08) // 1.0 pcb (2 resistor network) - #define ADC_PORT_INVERT_VAL (0x5A5A5A5A) #define ADC_PORT_INVERT_BOARD2_VAL (0x453b2a9c) // 2.0 pcb (chipv1.1) -#define SAMPLE_ADC_FULL_SPEED \ +#define SAMPLE_ADC_FULL_SPEED_CHIP11 \ (SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_0_VAL + \ SAMPLE_DGTL_SAMPLE_0_VAL + SAMPLE_DECMT_FACTOR_FULL_VAL) // 0x0000 -#define SAMPLE_ADC_HALF_SPEED \ +#define SAMPLE_ADC_HALF_SPEED_CHIP11 \ (SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_1_VAL + \ SAMPLE_DGTL_SAMPLE_1_VAL + SAMPLE_DECMT_FACTOR_HALF_VAL) // 0x1110 -#define SAMPLE_ADC_QUARTER_SPEED \ +#define SAMPLE_ADC_QUARTER_SPEED_CHIP11 \ (SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_3_VAL + \ SAMPLE_DGTL_SAMPLE_2_VAL + SAMPLE_DECMT_FACTOR_QUARTER_VAL) // 0x2230 +#define ADC_PHASE_FULL_SPEED_CHIP11 (160) +#define ADC_PHASE_HALF_SPEED_CHIP11 (160) +#define ADC_PHASE_QUARTER_SPEED_CHIP11 (160) + +#define DBIT_PHASE_FULL_SPEED_CHIP11 (75) +#define DBIT_PHASE_HALF_SPEED_CHIP11 (135) +#define DBIT_PHASE_QUARTER_SPEED_CHIP11 (135) + +#define ADC_OFST_FULL_SPEED_VAL_CHIP11 (0x10) +#define ADC_OFST_HALF_SPEED_VAL_CHIP11 (0x08) +#define ADC_OFST_QUARTER_SPEED_VAL_CHIP11 (0x04) + // 2.0 pcb (chipv1.0) #define SAMPLE_ADC_FULL_SPEED_CHIP10 \ (SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_0_VAL + \ @@ -163,6 +173,18 @@ enum CLKINDEX { RUN_CLK, ADC_CLK, DBIT_CLK, NUM_CLOCKS }; (SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_3_VAL + \ SAMPLE_DGTL_SAMPLE_6_VAL + SAMPLE_DECMT_FACTOR_QUARTER_VAL) // 0x2630 +#define ADC_PHASE_FULL_SPEED_CHIP10 (160) +#define ADC_PHASE_HALF_SPEED_CHIP10 (160) +#define ADC_PHASE_QUARTER_SPEED_CHIP10 (160) + +#define DBIT_PHASE_FULL_SPEED_CHIP10 (100) +#define DBIT_PHASE_HALF_SPEED_CHIP10 (150) +#define DBIT_PHASE_QUARTER_SPEED_CHIP10 (150) + +#define ADC_OFST_FULL_SPEED_VAL_CHIP10 (0x10) +#define ADC_OFST_HALF_SPEED_VAL_CHIP10 (0x08) +#define ADC_OFST_QUARTER_SPEED_VAL_CHIP10 (0x04) + // 1.0 pcb (2 resistor network) #define SAMPLE_ADC_HALF_SPEED_BOARD2 \ (SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_0_VAL + \ @@ -171,14 +193,11 @@ enum CLKINDEX { RUN_CLK, ADC_CLK, DBIT_CLK, NUM_CLOCKS }; (SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_1_VAL + \ SAMPLE_DGTL_SAMPLE_6_VAL + SAMPLE_DECMT_FACTOR_QUARTER_VAL) // 0x2610 -#define ADC_PHASE_FULL_SPEED (175) // 2.0 pcb -#define ADC_PHASE_HALF_SPEED (175) // 2.0 pcb -#define ADC_PHASE_QUARTER_SPEED (175) // 2.0 pcb -#define ADC_PHASE_HALF_SPEED_BOARD2 (110) // 1.0 pcb (2 resistor network) -#define ADC_PHASE_QUARTER_SPEED_BOARD2 (220) // 1.0 pcb (2 resistor network) +#define ADC_PHASE_HALF_SPEED_BOARD2 (110) +#define ADC_PHASE_QUARTER_SPEED_BOARD2 (220) -#define DBIT_PHASE_FULL_SPEED (100) // 2.0 pcb -#define DBIT_PHASE_HALF_SPEED (150) // 2.0 pcb -#define DBIT_PHASE_QUARTER_SPEED (150) // 2.0 pcb -#define DBIT_PHASE_HALF_SPEED_BOARD2 (150) // 1.0 pcb (2 resistor network) -#define DBIT_PHASE_QUARTER_SPEED_BOARD2 (150) // 1.0 pcb (2 resistor network) +#define DBIT_PHASE_HALF_SPEED_BOARD2 (150) +#define DBIT_PHASE_QUARTER_SPEED_BOARD2 (150) + +#define ADC_OFST_HALF_SPEED_BOARD2_VAL (0x10) +#define ADC_OFST_QUARTER_SPEED_BOARD2_VAL (0x08) diff --git a/slsDetectorServers/moenchDetectorServer/CMakeLists.txt b/slsDetectorServers/moenchDetectorServer/CMakeLists.txt index 8a2a02ed6..de0923b87 100644 --- a/slsDetectorServers/moenchDetectorServer/CMakeLists.txt +++ b/slsDetectorServers/moenchDetectorServer/CMakeLists.txt @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package add_executable(moenchDetectorServer_virtual slsDetectorFunctionList.c ../slsDetectorServer/src/slsDetectorServer.c diff --git a/slsDetectorServers/moenchDetectorServer/Makefile b/slsDetectorServers/moenchDetectorServer/Makefile index 3091c6564..f08d178e1 100755 --- a/slsDetectorServers/moenchDetectorServer/Makefile +++ b/slsDetectorServers/moenchDetectorServer/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package current_dir = $(shell pwd) main_inc = ../slsDetectorServer/include/ main_src = ../slsDetectorServer/src/ diff --git a/slsDetectorServers/moenchDetectorServer/RegisterDefs.h b/slsDetectorServers/moenchDetectorServer/RegisterDefs.h index faf82eb9e..26718e885 100644 --- a/slsDetectorServers/moenchDetectorServer/RegisterDefs.h +++ b/slsDetectorServers/moenchDetectorServer/RegisterDefs.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once /* Definitions for FPGA */ diff --git a/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer b/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer index 76bd9cefb..3b9443386 100755 Binary files a/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer and b/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer differ diff --git a/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServerv6.0.0-rc1 b/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServerv6.0.0-rc1 new file mode 100755 index 000000000..e8095c31a Binary files /dev/null and b/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServerv6.0.0-rc1 differ diff --git a/slsDetectorServers/moenchDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/moenchDetectorServer/slsDetectorFunctionList.c index bdda08571..1c0c703fd 100644 --- a/slsDetectorServers/moenchDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/moenchDetectorServer/slsDetectorFunctionList.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "slsDetectorFunctionList.h" #include "clogger.h" #include "sharedMemory.h" @@ -1579,7 +1581,6 @@ int getADCPipeline() { ADC_OFFSET_ADC_PPLN_OFST); } - /* aquisition */ int startStateMachine() { diff --git a/slsDetectorServers/moenchDetectorServer/slsDetectorServer_defs.h b/slsDetectorServers/moenchDetectorServer/slsDetectorServer_defs.h index aa17e8047..a86f350d2 100644 --- a/slsDetectorServers/moenchDetectorServer/slsDetectorServer_defs.h +++ b/slsDetectorServers/moenchDetectorServer/slsDetectorServer_defs.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "RegisterDefs.h" #include "sls/sls_detector_defs.h" @@ -5,6 +7,8 @@ #define MIN_REQRD_VRSN_T_RD_API 0x180314 #define REQRD_FRMWR_VRSN 0x201005 +#define LINKED_SERVER_NAME "moenchDetectorServer" + #define CTRL_SRVR_INIT_TIME_US (2 * 1000 * 1000) /* Struct Definitions */ diff --git a/slsDetectorServers/mythen3DetectorServer/CMakeLists.txt b/slsDetectorServers/mythen3DetectorServer/CMakeLists.txt index aee0a6b57..9033f5200 100644 --- a/slsDetectorServers/mythen3DetectorServer/CMakeLists.txt +++ b/slsDetectorServers/mythen3DetectorServer/CMakeLists.txt @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package add_executable(mythen3DetectorServer_virtual slsDetectorFunctionList.c mythen3.c diff --git a/slsDetectorServers/mythen3DetectorServer/Makefile b/slsDetectorServers/mythen3DetectorServer/Makefile index f8fb7e3c4..29e39f6b2 100755 --- a/slsDetectorServers/mythen3DetectorServer/Makefile +++ b/slsDetectorServers/mythen3DetectorServer/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package current_dir = $(shell pwd) main_inc = ../slsDetectorServer/include/ main_src = ../slsDetectorServer/src/ diff --git a/slsDetectorServers/mythen3DetectorServer/RegisterDefs.h b/slsDetectorServers/mythen3DetectorServer/RegisterDefs.h index ffa134e38..a68efb19b 100644 --- a/slsDetectorServers/mythen3DetectorServer/RegisterDefs.h +++ b/slsDetectorServers/mythen3DetectorServer/RegisterDefs.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once // clang-format off diff --git a/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer b/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer index 3d102c2df..0a6059037 100755 Binary files a/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer and b/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer differ diff --git a/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServerv6.0.0-rc1 b/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServerv6.0.0-rc1 new file mode 100755 index 000000000..60f3c2e14 Binary files /dev/null and b/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServerv6.0.0-rc1 differ diff --git a/slsDetectorServers/mythen3DetectorServer/mythen3.c b/slsDetectorServers/mythen3DetectorServer/mythen3.c index 64f4bdb11..88d13b4ea 100644 --- a/slsDetectorServers/mythen3DetectorServer/mythen3.c +++ b/slsDetectorServers/mythen3DetectorServer/mythen3.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "mythen3.h" #include "clogger.h" @@ -90,7 +92,7 @@ patternParameters *setChipStatusRegisterPattern(int csr) { for (int i = 0; i < 8; i++) pat->word[iaddr++] = patword; //#This version of the serializer pushes in the MSB first (compatible with - //the CSR bit numbering) + // the CSR bit numbering) for (int ib = nbits - 1; ib >= 0; ib--) { if (csr & (1 << ib)) patword = setBit(SIGNAL_serialIN, patword); diff --git a/slsDetectorServers/mythen3DetectorServer/mythen3.h b/slsDetectorServers/mythen3DetectorServer/mythen3.h index c27e7189e..16b691250 100644 --- a/slsDetectorServers/mythen3DetectorServer/mythen3.h +++ b/slsDetectorServers/mythen3DetectorServer/mythen3.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef MYTHEN3_H #define MYTHEN3_H @@ -31,25 +33,27 @@ #define SIGNAL_CHSclk (24) #define SIGNAL_exposing (25) - -//CHIP STARTUS REGISTER BITS +// CHIP STARTUS REGISTER BITS #define CSR_spypads 0 -#define CSR_invpol 4 -#define CSR_dpulse 5 -#define CSR_interp 6 +#define CSR_invpol 4 +#define CSR_dpulse 5 +#define CSR_interp 6 #define _CSR_C10pre 7 //#default, negative polarity -#define CSR_pumprobe 8 -#define CSR_apulse 9 -#define CSR_C15sh 10 -#define CSR_C30sh 11 //#default -#define CSR_C50sh 12 -#define CSR_C225ACsh 13 // Connects 225fF SHAPER AC cap (1: 225 to shaper, 225 to GND. 0: 450 to shaper) -#define _CSR_C15pre 14 // negative polarity +#define CSR_pumprobe 8 +#define CSR_apulse 9 +#define CSR_C15sh 10 +#define CSR_C30sh 11 //#default +#define CSR_C50sh 12 +#define CSR_C225ACsh \ + 13 // Connects 225fF SHAPER AC cap (1: 225 to shaper, 225 to GND. 0: 450 to + // shaper) +#define _CSR_C15pre 14 // negative polarity -#define CSR_default (1<<_CSR_C10pre )|(1<< CSR_C30sh) - -#define GAIN_MASK ((1 << _CSR_C10pre) | ( 1 << CSR_C15sh) | (1 << CSR_C30sh) | (1 << CSR_C50sh) | (1 << CSR_C225ACsh) | ( 1 << _CSR_C15pre)) +#define CSR_default (1 << _CSR_C10pre) | (1 << CSR_C30sh) +#define GAIN_MASK \ + ((1 << _CSR_C10pre) | (1 << CSR_C15sh) | (1 << CSR_C30sh) | \ + (1 << CSR_C50sh) | (1 << CSR_C225ACsh) | (1 << _CSR_C15pre)) int setBit(int ibit, int patword); int clearBit(int ibit, int patword); diff --git a/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c index b70da61c7..51a0c0895 100644 --- a/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "slsDetectorFunctionList.h" #include "ALTERA_PLL_CYCLONE10.h" #include "DAC6571.h" @@ -281,7 +283,6 @@ u_int32_t getDetectorNumber() { return bus_r(MCB_SERIAL_NO_REG); } - int getModuleId(int *ret, char *mess) { return ((bus_r(MOD_ID_REG) & MOD_ID_MSK) >> MOD_ID_OFST); } @@ -541,18 +542,18 @@ int resetToDefaultDacs(int hardReset) { for (int i = 0; i < NDAC; ++i) { defaultDacValues[i] = vals[i]; } - const int vals_standard[] = SPECIAL_DEFAULT_STANDARD_DAC_VALS; + const int vals_standard[] = SPECIAL_DEFAULT_STANDARD_DAC_VALS; for (int i = 0; i < NSPECIALDACS; ++i) { defaultDacValue_standard[i] = vals_standard[i]; - } + } const int vals_fast[] = SPECIAL_DEFAULT_FAST_DAC_VALS; for (int i = 0; i < NSPECIALDACS; ++i) { defaultDacValue_fast[i] = vals_fast[i]; - } - const int vals_highgain[] = SPECIAL_DEFAULT_HIGHGAIN_DAC_VALS; + } + const int vals_highgain[] = SPECIAL_DEFAULT_HIGHGAIN_DAC_VALS; for (int i = 0; i < NSPECIALDACS; ++i) { defaultDacValue_highgain[i] = vals_highgain[i]; - } + } } // remember settings diff --git a/slsDetectorServers/mythen3DetectorServer/slsDetectorServer_defs.h b/slsDetectorServers/mythen3DetectorServer/slsDetectorServer_defs.h index f39da11b8..06ee3b36b 100644 --- a/slsDetectorServers/mythen3DetectorServer/slsDetectorServer_defs.h +++ b/slsDetectorServers/mythen3DetectorServer/slsDetectorServer_defs.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/sls_detector_defs.h" @@ -5,6 +7,8 @@ #define KERNEL_DATE_VRSN "Wed May 20 13:58:38 CEST 2020" #define ID_FILE "detid_mythen3.txt" +#define LINKED_SERVER_NAME "mythen3DetectorServer" + #define CTRL_SRVR_INIT_TIME_US (300 * 1000) /* Hardware Definitions */ diff --git a/slsDetectorServers/slsDetectorServer/include/AD7689.h b/slsDetectorServers/slsDetectorServer/include/AD7689.h index e30a0e8ed..020f64a03 100644 --- a/slsDetectorServers/slsDetectorServer/include/AD7689.h +++ b/slsDetectorServers/slsDetectorServer/include/AD7689.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include diff --git a/slsDetectorServers/slsDetectorServer/include/AD9252.h b/slsDetectorServers/slsDetectorServer/include/AD9252.h index 2982a1962..b2787ef99 100644 --- a/slsDetectorServers/slsDetectorServer/include/AD9252.h +++ b/slsDetectorServers/slsDetectorServer/include/AD9252.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include diff --git a/slsDetectorServers/slsDetectorServer/include/AD9257.h b/slsDetectorServers/slsDetectorServer/include/AD9257.h index 333050106..2989e7010 100644 --- a/slsDetectorServers/slsDetectorServer/include/AD9257.h +++ b/slsDetectorServers/slsDetectorServer/include/AD9257.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include diff --git a/slsDetectorServers/slsDetectorServer/include/ALTERA_PLL.h b/slsDetectorServers/slsDetectorServer/include/ALTERA_PLL.h index b3187260b..57e6fac7d 100644 --- a/slsDetectorServers/slsDetectorServer/include/ALTERA_PLL.h +++ b/slsDetectorServers/slsDetectorServer/include/ALTERA_PLL.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include diff --git a/slsDetectorServers/slsDetectorServer/include/ALTERA_PLL_CYCLONE10.h b/slsDetectorServers/slsDetectorServer/include/ALTERA_PLL_CYCLONE10.h index 8044323ee..67d2de757 100644 --- a/slsDetectorServers/slsDetectorServer/include/ALTERA_PLL_CYCLONE10.h +++ b/slsDetectorServers/slsDetectorServer/include/ALTERA_PLL_CYCLONE10.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include diff --git a/slsDetectorServers/slsDetectorServer/include/ASIC_Driver.h b/slsDetectorServers/slsDetectorServer/include/ASIC_Driver.h index 597022a12..b6ba53632 100644 --- a/slsDetectorServers/slsDetectorServer/include/ASIC_Driver.h +++ b/slsDetectorServers/slsDetectorServer/include/ASIC_Driver.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include diff --git a/slsDetectorServers/slsDetectorServer/include/DAC6571.h b/slsDetectorServers/slsDetectorServer/include/DAC6571.h index 41bac9486..1a13d3c14 100644 --- a/slsDetectorServers/slsDetectorServer/include/DAC6571.h +++ b/slsDetectorServers/slsDetectorServer/include/DAC6571.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include diff --git a/slsDetectorServers/slsDetectorServer/include/I2C.h b/slsDetectorServers/slsDetectorServer/include/I2C.h index e8fd1a332..19d6debe1 100644 --- a/slsDetectorServers/slsDetectorServer/include/I2C.h +++ b/slsDetectorServers/slsDetectorServer/include/I2C.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include diff --git a/slsDetectorServers/slsDetectorServer/include/INA226.h b/slsDetectorServers/slsDetectorServer/include/INA226.h index 20ed47b4b..b7e39c2a8 100644 --- a/slsDetectorServers/slsDetectorServer/include/INA226.h +++ b/slsDetectorServers/slsDetectorServer/include/INA226.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include diff --git a/slsDetectorServers/slsDetectorServer/include/LTC2620.h b/slsDetectorServers/slsDetectorServer/include/LTC2620.h index 5d053af44..b9841f615 100644 --- a/slsDetectorServers/slsDetectorServer/include/LTC2620.h +++ b/slsDetectorServers/slsDetectorServer/include/LTC2620.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include diff --git a/slsDetectorServers/slsDetectorServer/include/LTC2620_Driver.h b/slsDetectorServers/slsDetectorServer/include/LTC2620_Driver.h index 78c05a199..6a05cde62 100644 --- a/slsDetectorServers/slsDetectorServer/include/LTC2620_Driver.h +++ b/slsDetectorServers/slsDetectorServer/include/LTC2620_Driver.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include diff --git a/slsDetectorServers/slsDetectorServer/include/MAX1932.h b/slsDetectorServers/slsDetectorServer/include/MAX1932.h index 4eccf05f4..e19e0c8da 100644 --- a/slsDetectorServers/slsDetectorServer/include/MAX1932.h +++ b/slsDetectorServers/slsDetectorServer/include/MAX1932.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include diff --git a/slsDetectorServers/slsDetectorServer/include/UDPPacketHeaderGenerator.h b/slsDetectorServers/slsDetectorServer/include/UDPPacketHeaderGenerator.h index 51c8ff246..2b401439d 100644 --- a/slsDetectorServers/slsDetectorServer/include/UDPPacketHeaderGenerator.h +++ b/slsDetectorServers/slsDetectorServer/include/UDPPacketHeaderGenerator.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include diff --git a/slsDetectorServers/slsDetectorServer/include/blackfin.h b/slsDetectorServers/slsDetectorServer/include/blackfin.h index a1995cfa9..e3a2d50f7 100644 --- a/slsDetectorServers/slsDetectorServer/include/blackfin.h +++ b/slsDetectorServers/slsDetectorServer/include/blackfin.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include diff --git a/slsDetectorServers/slsDetectorServer/include/clogger.h b/slsDetectorServers/slsDetectorServer/include/clogger.h index cfcb63f07..9f392535c 100644 --- a/slsDetectorServers/slsDetectorServer/include/clogger.h +++ b/slsDetectorServers/slsDetectorServer/include/clogger.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/ansi.h" diff --git a/slsDetectorServers/slsDetectorServer/include/common.h b/slsDetectorServers/slsDetectorServer/include/common.h index 5b6c98a41..6a0ab83c2 100644 --- a/slsDetectorServers/slsDetectorServer/include/common.h +++ b/slsDetectorServers/slsDetectorServer/include/common.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/md5.h" diff --git a/slsDetectorServers/slsDetectorServer/include/commonServerFunctions.h b/slsDetectorServers/slsDetectorServer/include/commonServerFunctions.h index 3f5cb9e7e..e93b485b9 100644 --- a/slsDetectorServers/slsDetectorServer/include/commonServerFunctions.h +++ b/slsDetectorServers/slsDetectorServer/include/commonServerFunctions.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include diff --git a/slsDetectorServers/slsDetectorServer/include/communication_funcs.h b/slsDetectorServers/slsDetectorServer/include/communication_funcs.h index 21e59476a..1618e857d 100644 --- a/slsDetectorServers/slsDetectorServer/include/communication_funcs.h +++ b/slsDetectorServers/slsDetectorServer/include/communication_funcs.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef COMMUNICATION_FUNCS_H #define COMMUNICATION_FUNCS_H diff --git a/slsDetectorServers/slsDetectorServer/include/communication_funcs_UDP.h b/slsDetectorServers/slsDetectorServer/include/communication_funcs_UDP.h index 3ba9f251d..ecd9d5deb 100644 --- a/slsDetectorServers/slsDetectorServer/include/communication_funcs_UDP.h +++ b/slsDetectorServers/slsDetectorServer/include/communication_funcs_UDP.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once void setupUDPCommParameters(); diff --git a/slsDetectorServers/slsDetectorServer/include/loadPattern.h b/slsDetectorServers/slsDetectorServer/include/loadPattern.h index d2e2e43ff..84f73b8b4 100644 --- a/slsDetectorServers/slsDetectorServer/include/loadPattern.h +++ b/slsDetectorServers/slsDetectorServer/include/loadPattern.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef LOADPATTERN_H #define LOADPATTERN_H #include "Pattern.h" diff --git a/slsDetectorServers/slsDetectorServer/include/nios.h b/slsDetectorServers/slsDetectorServer/include/nios.h index 128f556cf..33b0d4252 100644 --- a/slsDetectorServers/slsDetectorServer/include/nios.h +++ b/slsDetectorServers/slsDetectorServer/include/nios.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include diff --git a/slsDetectorServers/slsDetectorServer/include/programFpgaBlackfin.h b/slsDetectorServers/slsDetectorServer/include/programFpgaBlackfin.h index 0fff822d2..23ce5e252 100644 --- a/slsDetectorServers/slsDetectorServer/include/programFpgaBlackfin.h +++ b/slsDetectorServers/slsDetectorServer/include/programFpgaBlackfin.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include diff --git a/slsDetectorServers/slsDetectorServer/include/programFpgaNios.h b/slsDetectorServers/slsDetectorServer/include/programFpgaNios.h index c999a8da1..7e9d0be7c 100644 --- a/slsDetectorServers/slsDetectorServer/include/programFpgaNios.h +++ b/slsDetectorServers/slsDetectorServer/include/programFpgaNios.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include @@ -11,7 +13,8 @@ void NotifyServerStartSuccess(); /** reset fpga and controller(only implemented for >= v1.1 boards) */ void rebootControllerAndFPGA(); -int eraseAndWriteToFlash(char *mess, char *checksum, char *fpgasrc, uint64_t fsize); +int eraseAndWriteToFlash(char *mess, char *checksum, char *fpgasrc, + uint64_t fsize); int getDrive(char *mess); int openFileForFlash(FILE **flashfd, char *mess); int eraseFlash(char *mess); diff --git a/slsDetectorServers/slsDetectorServer/include/sharedMemory.h b/slsDetectorServers/slsDetectorServer/include/sharedMemory.h index 8146dfbc1..297312df0 100644 --- a/slsDetectorServers/slsDetectorServer/include/sharedMemory.h +++ b/slsDetectorServers/slsDetectorServer/include/sharedMemory.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/sls_detector_defs.h" diff --git a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h index cc0a97938..0f8f4a638 100644 --- a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h +++ b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "sls/sls_detector_defs.h" #include "slsDetectorServer_defs.h" // DAC_INDEX, ADC_INDEX, also include RegisterDefs.h #ifdef GOTTHARDD @@ -470,8 +472,8 @@ int autoCompDisable(int on); int setComparatorDisableTime(int64_t val); int64_t getComparatorDisableTime(); void configureASICTimer(); -int setClockDivider(enum CLKINDEX ind, int val); -int getClockDivider(enum CLKINDEX ind); +int setReadoutSpeed(int val); +int getReadoutSpeed(int *retval); int setPhase(enum CLKINDEX ind, int val, int degrees); int getPhase(enum CLKINDEX ind, int degrees); int getMaxPhase(enum CLKINDEX ind); @@ -495,8 +497,8 @@ uint64_t getSelectCurrentSource(); // eiger specific - iodelay, pulse, rate, temp, activate, delay nw parameter #elif EIGERD -int setClockDivider(enum CLKINDEX ind, int val); -int getClockDivider(enum CLKINDEX ind); +int setReadoutSpeed(int val); +int getReadoutSpeed(int *retval); int setIODelay(int val); int setCounterBit(int val); int pulsePixel(int n, int x, int y); @@ -548,6 +550,8 @@ int validatePhaseinDegrees(enum CLKINDEX ind, int val, int retval); // void setFrequency(enum CLKINDEX ind, int val); int getFrequency(enum CLKINDEX ind); int getVCOFrequency(enum CLKINDEX ind); +int setReadoutSpeed(int val); +int getReadoutSpeed(int *retval); int getMaxClockDivider(); int setClockDivider(enum CLKINDEX ind, int val); int getClockDivider(enum CLKINDEX ind); diff --git a/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h b/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h index bedad75f6..a8be872ab 100644 --- a/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h +++ b/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "clogger.h" #include "common.h" @@ -272,4 +274,6 @@ int set_dest_udp_list(int); int get_num_dest_list(int); int clear_all_udp_dst(int); int get_udp_first_dest(int); -int set_udp_first_dest(int); \ No newline at end of file +int set_udp_first_dest(int); +int get_readout_speed(int); +int set_readout_speed(int); \ No newline at end of file diff --git a/slsDetectorServers/slsDetectorServer/src/AD7689.c b/slsDetectorServers/slsDetectorServer/src/AD7689.c index b83e70a1f..066424816 100644 --- a/slsDetectorServers/slsDetectorServer/src/AD7689.c +++ b/slsDetectorServers/slsDetectorServer/src/AD7689.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "AD7689.h" #include "blackfin.h" #include "clogger.h" diff --git a/slsDetectorServers/slsDetectorServer/src/AD9252.c b/slsDetectorServers/slsDetectorServer/src/AD9252.c index 9f0ed3bcf..164e2dc13 100644 --- a/slsDetectorServers/slsDetectorServer/src/AD9252.c +++ b/slsDetectorServers/slsDetectorServer/src/AD9252.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "AD9252.h" #include "blackfin.h" #include "clogger.h" diff --git a/slsDetectorServers/slsDetectorServer/src/AD9257.c b/slsDetectorServers/slsDetectorServer/src/AD9257.c index 68cc42cee..20502922d 100644 --- a/slsDetectorServers/slsDetectorServer/src/AD9257.c +++ b/slsDetectorServers/slsDetectorServer/src/AD9257.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "AD9257.h" #include "blackfin.h" #include "clogger.h" diff --git a/slsDetectorServers/slsDetectorServer/src/ALTERA_PLL.c b/slsDetectorServers/slsDetectorServer/src/ALTERA_PLL.c index dab4a66cc..2d03c673c 100644 --- a/slsDetectorServers/slsDetectorServer/src/ALTERA_PLL.c +++ b/slsDetectorServers/slsDetectorServer/src/ALTERA_PLL.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "ALTERA_PLL.h" #include "blackfin.h" #include "clogger.h" diff --git a/slsDetectorServers/slsDetectorServer/src/ALTERA_PLL_CYCLONE10.c b/slsDetectorServers/slsDetectorServer/src/ALTERA_PLL_CYCLONE10.c index 12849f106..fcf60e68b 100644 --- a/slsDetectorServers/slsDetectorServer/src/ALTERA_PLL_CYCLONE10.c +++ b/slsDetectorServers/slsDetectorServer/src/ALTERA_PLL_CYCLONE10.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "ALTERA_PLL_CYCLONE10.h" #include "clogger.h" #include "nios.h" diff --git a/slsDetectorServers/slsDetectorServer/src/ASIC_Driver.c b/slsDetectorServers/slsDetectorServer/src/ASIC_Driver.c index e084557f9..562396b16 100644 --- a/slsDetectorServers/slsDetectorServer/src/ASIC_Driver.c +++ b/slsDetectorServers/slsDetectorServer/src/ASIC_Driver.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "ASIC_Driver.h" #include "clogger.h" #include "common.h" diff --git a/slsDetectorServers/slsDetectorServer/src/DAC6571.c b/slsDetectorServers/slsDetectorServer/src/DAC6571.c index 26b3cac68..3ed121aae 100644 --- a/slsDetectorServers/slsDetectorServer/src/DAC6571.c +++ b/slsDetectorServers/slsDetectorServer/src/DAC6571.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "DAC6571.h" #include "clogger.h" #include "common.h" diff --git a/slsDetectorServers/slsDetectorServer/src/I2C.c b/slsDetectorServers/slsDetectorServer/src/I2C.c index 3172fa2cb..31efc129a 100644 --- a/slsDetectorServers/slsDetectorServer/src/I2C.c +++ b/slsDetectorServers/slsDetectorServer/src/I2C.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "I2C.h" #include "blackfin.h" #include "clogger.h" diff --git a/slsDetectorServers/slsDetectorServer/src/INA226.c b/slsDetectorServers/slsDetectorServer/src/INA226.c index cf2c792dd..2c7d2297e 100644 --- a/slsDetectorServers/slsDetectorServer/src/INA226.c +++ b/slsDetectorServers/slsDetectorServer/src/INA226.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "INA226.h" #include "I2C.h" #include "clogger.h" diff --git a/slsDetectorServers/slsDetectorServer/src/LTC2620.c b/slsDetectorServers/slsDetectorServer/src/LTC2620.c index d3c80f03a..ab28d4c8a 100644 --- a/slsDetectorServers/slsDetectorServer/src/LTC2620.c +++ b/slsDetectorServers/slsDetectorServer/src/LTC2620.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "LTC2620.h" #include "blackfin.h" #include "clogger.h" diff --git a/slsDetectorServers/slsDetectorServer/src/LTC2620_Driver.c b/slsDetectorServers/slsDetectorServer/src/LTC2620_Driver.c index be331225b..5add339b1 100644 --- a/slsDetectorServers/slsDetectorServer/src/LTC2620_Driver.c +++ b/slsDetectorServers/slsDetectorServer/src/LTC2620_Driver.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "LTC2620_Driver.h" #include "clogger.h" #include "common.h" diff --git a/slsDetectorServers/slsDetectorServer/src/MAX1932.c b/slsDetectorServers/slsDetectorServer/src/MAX1932.c index 833d18d50..2edf69f27 100644 --- a/slsDetectorServers/slsDetectorServer/src/MAX1932.c +++ b/slsDetectorServers/slsDetectorServer/src/MAX1932.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "MAX1932.h" #include "blackfin.h" #include "clogger.h" diff --git a/slsDetectorServers/slsDetectorServer/src/UDPPacketHeaderGenerator.c b/slsDetectorServers/slsDetectorServer/src/UDPPacketHeaderGenerator.c index 89d760db2..df6cbd525 100644 --- a/slsDetectorServers/slsDetectorServer/src/UDPPacketHeaderGenerator.c +++ b/slsDetectorServers/slsDetectorServer/src/UDPPacketHeaderGenerator.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "UDPPacketHeaderGenerator.h" #include "clogger.h" #include "sls/sls_detector_defs.h" diff --git a/slsDetectorServers/slsDetectorServer/src/blackfin.c b/slsDetectorServers/slsDetectorServer/src/blackfin.c index 6d8ad90f7..3976a5d89 100644 --- a/slsDetectorServers/slsDetectorServer/src/blackfin.c +++ b/slsDetectorServers/slsDetectorServer/src/blackfin.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "blackfin.h" #include "RegisterDefs.h" #include "clogger.h" diff --git a/slsDetectorServers/slsDetectorServer/src/common.c b/slsDetectorServers/slsDetectorServer/src/common.c index 618187215..5c2390172 100644 --- a/slsDetectorServers/slsDetectorServer/src/common.c +++ b/slsDetectorServers/slsDetectorServer/src/common.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #define _GNU_SOURCE // needed for strptime to be at the top #include "common.h" #include "clogger.h" @@ -7,7 +9,6 @@ #include #include // readlink - int ConvertToDifferentRange(int inputMin, int inputMax, int outputMin, int outputMax, int inputValue, int *outputValue) { LOG(logDEBUG1, (" Input Value: %d (Input:(%d - %d), Output:(%d - %d))\n", @@ -243,7 +244,8 @@ int verifyChecksumFromFlash(char *mess, char *clientChecksum, char *fname, // read only until a particular size (drive) if (fsize != 0 && totalBytesRead >= fsize) { - LOG(logINFO, ("\tReached %lu bytes. Not reading more\n", totalBytesRead)); + LOG(logINFO, + ("\tReached %lu bytes. Not reading more\n", totalBytesRead)); break; } bytes = fread(buf, 1, readUnitSize, fp); diff --git a/slsDetectorServers/slsDetectorServer/src/commonServerFunctions.c b/slsDetectorServers/slsDetectorServer/src/commonServerFunctions.c index 5b90b51d9..7026ba407 100644 --- a/slsDetectorServers/slsDetectorServer/src/commonServerFunctions.c +++ b/slsDetectorServers/slsDetectorServer/src/commonServerFunctions.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "commonServerFunctions.h" #include "blackfin.h" #include "clogger.h" diff --git a/slsDetectorServers/slsDetectorServer/src/communication_funcs.c b/slsDetectorServers/slsDetectorServer/src/communication_funcs.c index 29b7d2941..f176012a7 100644 --- a/slsDetectorServers/slsDetectorServer/src/communication_funcs.c +++ b/slsDetectorServers/slsDetectorServer/src/communication_funcs.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "communication_funcs.h" #include "clogger.h" diff --git a/slsDetectorServers/slsDetectorServer/src/communication_funcs_UDP.c b/slsDetectorServers/slsDetectorServer/src/communication_funcs_UDP.c index 95a0fc641..d74c8ca6b 100644 --- a/slsDetectorServers/slsDetectorServer/src/communication_funcs_UDP.c +++ b/slsDetectorServers/slsDetectorServer/src/communication_funcs_UDP.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "communication_funcs_UDP.h" #include "clogger.h" #include "sls/sls_detector_defs.h" @@ -28,8 +30,9 @@ void setupUDPCommParameters() { memset(udpDestinationIp, 0, sizeof(udpDestinationIp)); } -int getUdPSocketDescriptor(int iRxEntry, int index) { return udpSockfd[iRxEntry][index]; } - +int getUdPSocketDescriptor(int iRxEntry, int index) { + return udpSockfd[iRxEntry][index]; +} int setUDPDestinationDetails(int iRxEntry, int index, const char *ip, unsigned short int port) { @@ -60,16 +63,20 @@ int setUDPDestinationDetails(int iRxEntry, int index, const char *ip, int err = getaddrinfo(udpDestinationIp[iRxEntry][index], sport, &hints, &udpServerAddrInfo[iRxEntry][index]); if (err != 0) { - LOG(logERROR, ("Failed to resolve remote socket address %s at port %d [entry:%d]. " + LOG(logERROR, ("Failed to resolve remote socket address %s at port %d " + "[entry:%d]. " "(Error code:%d, %s)\n", - udpDestinationIp[iRxEntry][index], udpDestinationPort[iRxEntry][index], iRxEntry, err, + udpDestinationIp[iRxEntry][index], + udpDestinationPort[iRxEntry][index], iRxEntry, err, gai_strerror(err))); return FAIL; } if (udpServerAddrInfo[iRxEntry][index] == NULL) { - LOG(logERROR, ("Failed to resolve remote socket address %s at port %d [entry:%d]." - "(getaddrinfo returned NULL)\n", - udpDestinationIp[iRxEntry][index], udpDestinationPort[iRxEntry][index], iRxEntry)); + LOG(logERROR, + ("Failed to resolve remote socket address %s at port %d [entry:%d]." + "(getaddrinfo returned NULL)\n", + udpDestinationIp[iRxEntry][index], + udpDestinationPort[iRxEntry][index], iRxEntry)); udpServerAddrInfo[iRxEntry][index] = 0; return FAIL; } @@ -78,41 +85,51 @@ int setUDPDestinationDetails(int iRxEntry, int index, const char *ip, } int createUDPSocket(int index) { - + for (int iRxEntry = 0; iRxEntry != numUdpDestinations; ++iRxEntry) { - LOG(logDEBUG2, ("Creating UDP Socket %d [entry:%d]\n", index, iRxEntry)); + LOG(logDEBUG2, + ("Creating UDP Socket %d [entry:%d]\n", index, iRxEntry)); if (!strlen(udpDestinationIp[iRxEntry][index])) { - LOG(logERROR, ("No destination UDP ip specified for socket %d [entry:%d].\n", index, iRxEntry)); + LOG(logERROR, + ("No destination UDP ip specified for socket %d [entry:%d].\n", + index, iRxEntry)); return FAIL; } if (udpSockfd[iRxEntry][index] != -1) { - LOG(logERROR, ("Strange that Udp socket was still open [socket:%d, entry:%d]. Closing it to " - "create a new one.\n", index, iRxEntry)); + LOG(logERROR, ("Strange that Udp socket was still open [socket:%d, " + "entry:%d]. Closing it to " + "create a new one.\n", + index, iRxEntry)); close(udpSockfd[iRxEntry][index]); udpSockfd[iRxEntry][index] = -1; } // Creating socket file descriptor - udpSockfd[iRxEntry][index] = socket(udpServerAddrInfo[iRxEntry][index]->ai_family, - udpServerAddrInfo[iRxEntry][index]->ai_socktype, - udpServerAddrInfo[iRxEntry][index]->ai_protocol); + udpSockfd[iRxEntry][index] = + socket(udpServerAddrInfo[iRxEntry][index]->ai_family, + udpServerAddrInfo[iRxEntry][index]->ai_socktype, + udpServerAddrInfo[iRxEntry][index]->ai_protocol); if (udpSockfd[iRxEntry][index] == -1) { - LOG(logERROR, ("UDP socket at port %d failed [entry:%d]. (Error code:%d, %s)\n", - udpDestinationPort[iRxEntry][index], iRxEntry, errno, gai_strerror(errno))); + LOG(logERROR, ("UDP socket at port %d failed [entry:%d]. (Error " + "code:%d, %s)\n", + udpDestinationPort[iRxEntry][index], iRxEntry, errno, + gai_strerror(errno))); return FAIL; } - LOG(logINFO, ("Udp client socket created for server (entry:%d, port %d, ip:%s)\n", - iRxEntry, udpDestinationPort[iRxEntry][index], udpDestinationIp[iRxEntry][index])); - - // Using connect expects that the receiver (udp server) exists to listen to - // these packets connecting allows to use "send/write" instead of "sendto", - // avoiding checking for server address for each packet using write without - // a connect will end in segv - LOG(logINFO, ("Udp client socket connected [%d, %d, %s]\n", iRxEntry, udpDestinationPort[iRxEntry][index], - udpDestinationIp[iRxEntry][index])); + LOG(logINFO, ("Udp client socket created for server (entry:%d, port " + "%d, ip:%s)\n", + iRxEntry, udpDestinationPort[iRxEntry][index], + udpDestinationIp[iRxEntry][index])); + // Using connect expects that the receiver (udp server) exists to listen + // to these packets connecting allows to use "send/write" instead of + // "sendto", avoiding checking for server address for each packet using + // write without a connect will end in segv + LOG(logINFO, ("Udp client socket connected [%d, %d, %s]\n", iRxEntry, + udpDestinationPort[iRxEntry][index], + udpDestinationIp[iRxEntry][index])); } return OK; } @@ -123,9 +140,9 @@ int sendUDPPacket(int iRxEntry, int index, const char *buf, int length) { udpServerAddrInfo[iRxEntry][index]->ai_addrlen); // udp sends atomically, no need to handle partial data if (n == -1) { - LOG(logERROR, - ("Could not send udp packet for socket %d [entry:%d]. (Error code:%d, %s)\n", - index, iRxEntry, errno, gai_strerror(errno))); + LOG(logERROR, ("Could not send udp packet for socket %d [entry:%d]. " + "(Error code:%d, %s)\n", + index, iRxEntry, errno, gai_strerror(errno))); } else { LOG(logDEBUG2, ("%d bytes sent\n", n)); } diff --git a/slsDetectorServers/slsDetectorServer/src/loadPattern.c b/slsDetectorServers/slsDetectorServer/src/loadPattern.c index 0a360a10d..6465ac73b 100644 --- a/slsDetectorServers/slsDetectorServer/src/loadPattern.c +++ b/slsDetectorServers/slsDetectorServer/src/loadPattern.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "loadPattern.h" #include "RegisterDefs.h" #include "common.h" diff --git a/slsDetectorServers/slsDetectorServer/src/nios.c b/slsDetectorServers/slsDetectorServer/src/nios.c index 27de69d7b..03c9f364a 100644 --- a/slsDetectorServers/slsDetectorServer/src/nios.c +++ b/slsDetectorServers/slsDetectorServer/src/nios.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "nios.h" #include "RegisterDefs.h" #include "clogger.h" diff --git a/slsDetectorServers/slsDetectorServer/src/programFpgaBlackfin.c b/slsDetectorServers/slsDetectorServer/src/programFpgaBlackfin.c index bd8b4a6b6..bfbe08b28 100644 --- a/slsDetectorServers/slsDetectorServer/src/programFpgaBlackfin.c +++ b/slsDetectorServers/slsDetectorServer/src/programFpgaBlackfin.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "programFpgaBlackfin.h" #include "clogger.h" #include "common.h" @@ -5,8 +7,8 @@ #include "slsDetectorServer_defs.h" #include -#include // usleep #include +#include // usleep /* global variables */ // clang-format off @@ -16,7 +18,7 @@ #define FLASH_BUFFER_MEMORY_SIZE (128 * 1024) // 500 KB // clang-format on -#define FLASH_DRIVE_NAME_SIZE 16 +#define FLASH_DRIVE_NAME_SIZE 16 char flashDriveName[FLASH_DRIVE_NAME_SIZE] = {0}; int gpioDefined = 0; @@ -69,16 +71,25 @@ void resetFPGA() { int deleteOldFile(char *mess) { char cmd[MAX_STR_LENGTH] = {0}; char retvals[MAX_STR_LENGTH] = {0}; - sprintf(cmd, "rm -fr %s", TEMP_PROG_FILE_NAME); - if (FAIL == executeCommand(cmd, retvals, logDEBUG1)) { - strcpy(mess, - "Could not program fpga. (could not delete old file: "); - strncat(mess, retvals, sizeof(mess) - strlen(mess) - 1); - strcat(mess, "\n"); + + char *format = "rm -fr %s"; + if (snprintf(cmd, MAX_STR_LENGTH, format, TEMP_PROG_FILE_NAME) >= + MAX_STR_LENGTH) { + strcpy( + mess, + "Could not program fpga. Command to delete old file is too long\n"); LOG(logERROR, (mess)); return FAIL; } - LOG(logINFO, ("\tDeleted old programming file (%s)\n", TEMP_PROG_FILE_NAME)); + if (executeCommand(cmd, retvals, logDEBUG1) == FAIL) { + snprintf(mess, MAX_STR_LENGTH, + "Could not program fpga. (could not delete old file: %s)\n", + retvals); + // LOG(logERROR, (mess)); already printed in executecommand + return FAIL; + } + LOG(logINFO, + ("\tDeleted old programming file (%s)\n", TEMP_PROG_FILE_NAME)); return OK; } @@ -140,12 +151,11 @@ int copyToFlash(ssize_t fsize, char *clientChecksum, char *mess) { return FAIL; } -/* ignoring this until a consistent way to read from bfin flash - if (verifyChecksumFromFlash(mess, clientChecksum, flashDriveName, fsize) == - FAIL) { - return FAIL; - } -*/ + /* ignoring this until a consistent way to read from bfin flash + if (verifyChecksumFromFlash(mess, clientChecksum, flashDriveName, fsize) + == FAIL) { return FAIL; + } + */ if (waitForFPGAtoTouchFlash(mess) == FAIL) { return FAIL; } @@ -169,12 +179,13 @@ int getDrive(char *mess) { char cmd[MAX_STR_LENGTH] = {0}; char retvals[MAX_STR_LENGTH] = {0}; + strcpy(cmd, CMD_GET_FLASH); if (executeCommand(cmd, retvals, logDEBUG1) == FAIL) { - strcpy(mess, "Could not program fpga. (could not get flash drive: "); - strncat(mess, retvals, sizeof(mess) - strlen(mess) - 1); - strcat(mess, "\n"); - LOG(logERROR, (mess)); + snprintf(mess, MAX_STR_LENGTH, + "Could not program fpga. (could not get flash drive: %s)\n", + retvals); + // LOG(logERROR, (mess)); already printed in executecommand return FAIL; } @@ -228,15 +239,21 @@ int eraseFlash(char *mess) { #endif char cmd[MAX_STR_LENGTH] = {0}; char retvals[MAX_STR_LENGTH] = {0}; - sprintf(cmd, "flash_eraseall %s", flashDriveName); - if (FAIL == executeCommand(cmd, retvals, logDEBUG1)) { - strcpy(mess, "Could not program fpga. (could not erase flash: "); - strncat(mess, retvals, sizeof(mess) - strlen(mess) - 1); - strcat(mess, "\n"); + char *format = "flash_eraseall %s"; + if (snprintf(cmd, MAX_STR_LENGTH, format, flashDriveName) >= + MAX_STR_LENGTH) { + strcpy(mess, + "Could not program fpga. Command to erase flash is too long\n"); LOG(logERROR, (mess)); return FAIL; } - + if (executeCommand(cmd, retvals, logDEBUG1) == FAIL) { + snprintf(mess, MAX_STR_LENGTH, + "Could not program fpga. (could not erase flash: %s)\n", + retvals); + // LOG(logERROR, (mess)); already printed in executecommand + return FAIL; + } LOG(logINFO, ("\tFlash erased\n")); return OK; } @@ -244,8 +261,7 @@ int eraseFlash(char *mess) { int writeToFlash(ssize_t fsize, FILE *flashfd, FILE *srcfd, char *mess) { LOG(logDEBUG1, ("writing to flash\n")); - - char* buffer = malloc(FLASH_BUFFER_MEMORY_SIZE); + char *buffer = malloc(FLASH_BUFFER_MEMORY_SIZE); if (buffer == NULL) { fclose(flashfd); fclose(srcfd); @@ -258,12 +274,13 @@ int writeToFlash(ssize_t fsize, FILE *flashfd, FILE *srcfd, char *mess) { int oldProgress = 0; ssize_t totalBytes = 0; - ssize_t bytes = fread((void*)buffer, sizeof(char), FLASH_BUFFER_MEMORY_SIZE, srcfd); + ssize_t bytes = + fread((void *)buffer, sizeof(char), FLASH_BUFFER_MEMORY_SIZE, srcfd); while (bytes > 0) { ssize_t bytesWritten = - fwrite((void*)buffer, sizeof(char), bytes, flashfd); + fwrite((void *)buffer, sizeof(char), bytes, flashfd); totalBytes += bytesWritten; if (bytesWritten != bytes) { @@ -287,9 +304,11 @@ int writeToFlash(ssize_t fsize, FILE *flashfd, FILE *srcfd, char *mess) { fflush(stdout); oldProgress = progress; } - } else printf("."); + } else + printf("."); - bytes = fread((void*)buffer, sizeof(char), FLASH_BUFFER_MEMORY_SIZE, srcfd); + bytes = fread((void *)buffer, sizeof(char), FLASH_BUFFER_MEMORY_SIZE, + srcfd); } if (fsize <= 0) { printf("\n"); @@ -300,15 +319,18 @@ int writeToFlash(ssize_t fsize, FILE *flashfd, FILE *srcfd, char *mess) { LOG(logINFO, ("\tWrote %ld bytes to flash\n", totalBytes)); if (totalBytes != fsize) { - sprintf(mess, "Could not program fpga. Incorrect bytes written to flash %lu [expected: %lu]\n", totalBytes, fsize); + sprintf(mess, + "Could not program fpga. Incorrect bytes written to flash %lu " + "[expected: %lu]\n", + totalBytes, fsize); LOG(logERROR, (mess)); - return FAIL; + return FAIL; } return OK; } -int waitForFPGAtoTouchFlash(char* mess) { - // touch and program +int waitForFPGAtoTouchFlash(char *mess) { + // touch and program FPGATouchFlash(); #ifdef VIRTUAL @@ -316,36 +338,41 @@ int waitForFPGAtoTouchFlash(char* mess) { #endif LOG(logINFO, ("\tWaiting for FPGA to program from flash\n")); int timeSpent = 0; - + int result = 0; while (result == 0) { // time taken for fpga to pick up from flash usleep(1000); timeSpent += 1000; if (timeSpent >= MAX_TIME_FPGA_TOUCH_FLASH_US) { - sprintf(mess, "Could not program fpga. (exceeded max time allowed: %ds)\n", - MAX_TIME_FPGA_TOUCH_FLASH_US/(1000 * 1000)); + sprintf( + mess, + "Could not program fpga. (exceeded max time allowed: %ds)\n", + MAX_TIME_FPGA_TOUCH_FLASH_US / (1000 * 1000)); LOG(logERROR, (mess)); return FAIL; } - // read gpio status + // read gpio status char retvals[MAX_STR_LENGTH] = {0}; - if (FAIL == executeCommand(CMD_FPGA_PICKED_STATUS, retvals, logDEBUG1)) { - strcpy(mess, - "Could not program fpga. (could not read gpio status: "); - strncat(mess, retvals, sizeof(mess) - strlen(mess) - 1); - strcat(mess, "\n"); - LOG(logERROR, (mess)); + if (FAIL == + executeCommand(CMD_FPGA_PICKED_STATUS, retvals, logDEBUG1)) { + snprintf( + mess, MAX_STR_LENGTH, + "Could not program fpga. (could not read gpio status: %s)\n", + retvals); + // LOG(logERROR, (mess)); already printed in executecommand return FAIL; } // convert to int if (sscanf(retvals, "%d\n", &result) != 1) { - sprintf(mess, "Could not program fpga. (could not scan int for gpio status: [%s])\n", - retvals); + snprintf(mess, MAX_STR_LENGTH, + "Could not program fpga. (could not scan int for gpio " + "status: [%s])\n", + retvals); LOG(logERROR, (mess)); - return FAIL; + return FAIL; } LOG(logDEBUG1, ("gpi07 returned %d\n", result)); } diff --git a/slsDetectorServers/slsDetectorServer/src/programFpgaNios.c b/slsDetectorServers/slsDetectorServer/src/programFpgaNios.c index 08dbe4f13..c82685224 100644 --- a/slsDetectorServers/slsDetectorServer/src/programFpgaNios.c +++ b/slsDetectorServers/slsDetectorServer/src/programFpgaNios.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "programFpgaNios.h" #include "clogger.h" #include "common.h" @@ -9,9 +11,9 @@ /* global variables */ -#define CMD_GET_FLASH "awk \'$5== \"Application\" {print $1}\' /proc/mtd" +#define CMD_GET_FLASH "awk \'$5== \"Application\" {print $1}\' /proc/mtd" -#define FLASH_DRIVE_NAME_SIZE 16 +#define FLASH_DRIVE_NAME_SIZE 16 char flashDriveName[FLASH_DRIVE_NAME_SIZE] = {0}; #define MICROCONTROLLER_FILE "/dev/ttyAL0" @@ -49,7 +51,7 @@ int eraseAndWriteToFlash(char *mess, char *checksum, char *fpgasrc, return FAIL; } - if (eraseFlash(mess) == FAIL) { + if (eraseFlash(mess) == FAIL) { fclose(flashfd); return FAIL; } @@ -86,10 +88,10 @@ int getDrive(char *mess) { char retvals[MAX_STR_LENGTH] = {0}; strcpy(cmd, CMD_GET_FLASH); if (executeCommand(cmd, retvals, logDEBUG1) == FAIL) { - strcpy(mess, "Could not program fpga. (could not get flash drive: "); - strncat(mess, retvals, sizeof(mess) - strlen(mess) - 1); - strcat(mess, "\n"); - LOG(logERROR, (mess)); + snprintf(mess, MAX_STR_LENGTH, + "Could not program fpga. (could not get flash drive: %s)\n", + retvals); + // LOG(logERROR, (mess)); already printed in executecommand return FAIL; } @@ -127,14 +129,22 @@ int eraseFlash(char *mess) { #endif char cmd[MAX_STR_LENGTH] = {0}; char retvals[MAX_STR_LENGTH] = {0}; - sprintf(cmd, "flash_erase %s 0 0", flashDriveName); - if (FAIL == executeCommand(cmd, retvals, logDEBUG1)) { - strcpy(mess, "Could not program fpga. (could not erase flash: "); - strncat(mess, retvals, sizeof(mess) - strlen(mess) - 1); - strcat(mess, "\n"); + + char *format = "flash_erase %s 0 0"; + if (snprintf(cmd, MAX_STR_LENGTH, format, flashDriveName) >= + MAX_STR_LENGTH) { + strcpy(mess, + "Could not program fpga. Command to erase flash is too long\n"); LOG(logERROR, (mess)); return FAIL; } + if (executeCommand(cmd, retvals, logDEBUG1) == FAIL) { + snprintf(mess, MAX_STR_LENGTH, + "Could not program fpga. (could not erase flash: %s)\n", + retvals); + // LOG(logERROR, (mess)); already printed in executecommand + return FAIL; + } LOG(logINFO, ("\tFlash erased\n")); return OK; @@ -146,10 +156,10 @@ int writeToFlash(ssize_t fsize, FILE *flashfd, char *buffer, char *mess) { ssize_t bytesWritten = fwrite((void *)buffer, sizeof(char), fsize, flashfd); if (bytesWritten != fsize) { fclose(flashfd); - sprintf( - mess, - "Could not program fpga. Incorrect bytes written to flash %lu [expected: %lu]\n", - (long int)bytesWritten, (long int)fsize); + sprintf(mess, + "Could not program fpga. Incorrect bytes written to flash %lu " + "[expected: %lu]\n", + (long int)bytesWritten, (long int)fsize); LOG(logERROR, (mess)); return FAIL; } diff --git a/slsDetectorServers/slsDetectorServer/src/sharedMemory.c b/slsDetectorServers/slsDetectorServer/src/sharedMemory.c index 42b49683c..ce4bee979 100644 --- a/slsDetectorServers/slsDetectorServer/src/sharedMemory.c +++ b/slsDetectorServers/slsDetectorServer/src/sharedMemory.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "sharedMemory.h" #include "clogger.h" diff --git a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer.c b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer.c index 87acd4693..7b633e4d1 100644 --- a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer.c +++ b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package /* A simple server in the internet domain using TCP The port number is passed as an argument */ diff --git a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c index 5c724b10e..1c6299153 100644 --- a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c +++ b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "slsDetectorServer_funcs.h" #include "clogger.h" #include "communication_funcs.h" @@ -13,8 +15,8 @@ #include #include #include -#include #include +#include // defined in the detector specific Makefile #ifdef GOTTHARDD @@ -89,7 +91,7 @@ void init_detector() { udpDetails[0].dstport = DEFAULT_UDP_DST_PORTNO; #ifdef EIGERD udpDetails[0].dstport2 = DEFAULT_UDP_DST_PORTNO + 1; -#endif +#endif if (isControlServer) { basictests(); @@ -410,7 +412,8 @@ void function_table() { flist[F_CLEAR_ALL_UDP_DEST] = &clear_all_udp_dst; flist[F_GET_UDP_FIRST_DEST] = &get_udp_first_dest; flist[F_SET_UDP_FIRST_DEST] = &set_udp_first_dest; - + flist[F_GET_READOUT_SPEED] = &get_readout_speed; + flist[F_SET_READOUT_SPEED] = &set_readout_speed; // check if (NUM_DET_FUNCTIONS >= RECEIVER_ENUM_START) { LOG(logERROR, ("The last detector function enum has reached its " @@ -445,7 +448,7 @@ int executeCommand(char *command, char *result, enum TLogLevel level) { memset(result, 0, MAX_STR_LENGTH); // copy command - char cmd[MAX_STR_LENGTH]= {0}; + char cmd[MAX_STR_LENGTH] = {0}; sprintf(cmd, "%s 2>&1", command); LOG(level, ("Executing command:\n[%s]\n", cmd)); @@ -1057,7 +1060,7 @@ int validateAndSetDac(enum dacIndex ind, int val, int mV) { ret = AD9257_SetVrefVoltage(val, mV); if (ret == FAIL) { sprintf(mess, "Could not set Adc Vpp. Please set a " - "proper value\n"); + "proper value\n"); LOG(logERROR, (mess)); } } @@ -1083,14 +1086,14 @@ int validateAndSetDac(enum dacIndex ind, int val, int mV) { retval = setHighVoltage(val); LOG(logDEBUG1, ("High Voltage: %d\n", retval)); #if defined(JUNGFRAUD) || defined(CHIPTESTBOARDD) || defined(MOENCHD) || \ -defined(GOTTHARD2D) || defined(MYTHEN3D) + defined(GOTTHARD2D) || defined(MYTHEN3D) validate(&ret, mess, val, retval, "set high voltage", DEC); #endif #ifdef GOTTHARDD if (retval == -1) { ret = FAIL; strcpy(mess, "Invalid Voltage. Valid values are 0, 90, " - "110, 120, 150, 180, 200\n"); + "110, 120, 150, 180, 200\n"); LOG(logERROR, (mess)); } else validate(&ret, mess, val, retval, "set high voltage", DEC); @@ -1104,10 +1107,10 @@ defined(GOTTHARD2D) || defined(MYTHEN3D) val); else if (retval == -2) strcpy(mess, "Setting high voltage failed. " - "Serial/i2c communication failed.\n"); + "Serial/i2c communication failed.\n"); else if (retval == -3) strcpy(mess, "Getting high voltage failed. " - "Serial/i2c communication failed.\n"); + "Serial/i2c communication failed.\n"); LOG(logERROR, (mess)); } #endif @@ -1137,13 +1140,13 @@ defined(GOTTHARD2D) || defined(MYTHEN3D) LOG(logERROR, (mess)); } else if (!isPowerValid(serverDacIndex, val)) { ret = FAIL; - sprintf(mess, - "Could not set power. Power regulator %d " - "should be between %d and %d mV\n", - ind, - (serverDacIndex == D_PWR_IO ? VIO_MIN_MV - : POWER_RGLTR_MIN), - (VCHIP_MAX_MV - VCHIP_POWER_INCRMNT)); + sprintf( + mess, + "Could not set power. Power regulator %d " + "should be between %d and %d mV\n", + ind, + (serverDacIndex == D_PWR_IO ? VIO_MIN_MV : POWER_RGLTR_MIN), + (VCHIP_MAX_MV - VCHIP_POWER_INCRMNT)); LOG(logERROR, (mess)); } else { setPower(serverDacIndex, val); @@ -1158,8 +1161,8 @@ defined(GOTTHARD2D) || defined(MYTHEN3D) if (val >= 0) { ret = FAIL; sprintf(mess, "Can not set Vchip. Can only be set " - "automatically in the background (+200mV " - "from highest power regulator voltage).\n"); + "automatically in the background (+200mV " + "from highest power regulator voltage).\n"); LOG(logERROR, (mess)); /* restrict users from setting vchip if (!mV) { @@ -1189,7 +1192,7 @@ defined(GOTTHARD2D) || defined(MYTHEN3D) if (!mV) { ret = FAIL; strcpy(mess, "Could not set power. VLimit should be in " - "mV and not dac units.\n"); + "mV and not dac units.\n"); LOG(logERROR, (mess)); } else { setVLimit(val); @@ -1218,10 +1221,9 @@ defined(GOTTHARD2D) || defined(MYTHEN3D) LOG(logERROR, (mess)); } else { #if defined(CHIPTESTBOARDD) || defined(MOENCHD) - if ((val != GET_FLAG && mV && - checkVLimitCompliant(val) == FAIL) || + if ((val != GET_FLAG && mV && checkVLimitCompliant(val) == FAIL) || (val != GET_FLAG && !mV && - checkVLimitDacCompliant(val) == FAIL)) { + checkVLimitDacCompliant(val) == FAIL)) { ret = FAIL; sprintf(mess, "Could not set dac %d to value %d. " @@ -1245,7 +1247,7 @@ defined(GOTTHARD2D) || defined(MYTHEN3D) case E_VCP: setSettings(UNDEFINED); LOG(logERROR, ("Settings has been changed " - "to undefined (changed specific dacs)\n")); + "to undefined (changed specific dacs)\n")); break; default: break; @@ -1597,34 +1599,34 @@ void validate_settings(enum detectorSettings sett) { case GAIN0: case HIGHGAIN0: #elif GOTTHARDD - case DYNAMICGAIN: - case HIGHGAIN: - case LOWGAIN: - case MEDIUMGAIN: - case VERYHIGHGAIN: + case DYNAMICGAIN: + case HIGHGAIN: + case LOWGAIN: + case MEDIUMGAIN: + case VERYHIGHGAIN: #elif GOTTHARD2D - case DYNAMICGAIN: - case FIXGAIN1: - case FIXGAIN2: + case DYNAMICGAIN: + case FIXGAIN1: + case FIXGAIN2: #elif MOENCHD - case G1_HIGHGAIN: - case G1_LOWGAIN: - case G2_HIGHCAP_HIGHGAIN: - case G2_HIGHCAP_LOWGAIN: - case G2_LOWCAP_HIGHGAIN: - case G2_LOWCAP_LOWGAIN: - case G4_HIGHGAIN: - case G4_LOWGAIN: + case G1_HIGHGAIN: + case G1_LOWGAIN: + case G2_HIGHCAP_HIGHGAIN: + case G2_HIGHCAP_LOWGAIN: + case G2_LOWCAP_HIGHGAIN: + case G2_LOWCAP_LOWGAIN: + case G4_HIGHGAIN: + case G4_LOWGAIN: #elif MYTHEN3D - case STANDARD: - case FAST: - case HIGHGAIN: + case STANDARD: + case FAST: + case HIGHGAIN: #endif - break; - default: - modeNotImplemented("Settings Index", (int)sett); - break; - } + break; + default: + modeNotImplemented("Settings Index", (int)sett); + break; + } } int set_settings(int file_des) { @@ -1716,16 +1718,16 @@ int acquire(int blocking, int file_des) { // only set if (Server_VerifyLock() == OK) { #ifdef JUNGFRAUD - // chipv1.1 has to be configured before acquisition - if (getChipVersion() == 11 && !isChipConfigured()) { + // chipv1.1 has to be configured before acquisition + if (getChipVersion() == 11 && !isChipConfigured()) { ret = FAIL; strcpy(mess, "Could not start acquisition. Chip is not configured. " "Power it on to configure it.\n"); LOG(logERROR, (mess)); - } else + } else #endif #ifdef MOENCHD - if (getNumAnalogSamples() <= 0) { + if (getNumAnalogSamples() <= 0) { ret = FAIL; sprintf(mess, "Could not start acquisition. Invalid number of analog " @@ -2075,7 +2077,8 @@ int set_num_additional_storage_cells(int file_des) { if (Server_VerifyLock() == OK) { if (getChipVersion() == 11) { ret = FAIL; - sprintf(mess, "Cannot set addl. number of storage cells for chip v1.1\n"); + sprintf(mess, + "Cannot set addl. number of storage cells for chip v1.1\n"); LOG(logERROR, (mess)); } else if (arg > getMaxStoragecellStart()) { ret = FAIL; @@ -2531,7 +2534,7 @@ int get_storage_cell_delay(int file_des) { } else { retval = getStorageCellDelay(); LOG(logDEBUG1, - ("retval storage cell delay %lld ns\n", (long long int)retval)); + ("retval storage cell delay %lld ns\n", (long long int)retval)); } #endif return Server_SendResult(file_des, INT64, &retval, sizeof(retval)); @@ -2554,7 +2557,8 @@ int set_storage_cell_delay(int file_des) { if (Server_VerifyLock() == OK) { if (getChipVersion() == 11) { ret = FAIL; - strcpy(mess, "Storage cell delay is not applicable for chipv 1.1\n"); + strcpy(mess, + "Storage cell delay is not applicable for chipv 1.1\n"); LOG(logERROR, (mess)); } else if (arg > MAX_STORAGE_CELL_DLY_NS_VAL) { ret = FAIL; @@ -3699,7 +3703,10 @@ int program_fpga(int file_des) { fclose(fd); struct sysinfo info; sysinfo(&info); - sprintf(mess, "Could not allocate memory to get fpga program. Free space: %d MB\n", (int)(info.freeram/ (1024 * 1024))); + sprintf(mess, + "Could not allocate memory to get fpga program. Free " + "space: %d MB\n", + (int)(info.freeram / (1024 * 1024))); LOG(logERROR, (mess)); ret = FAIL; } @@ -3732,7 +3739,7 @@ int program_fpga(int file_des) { // unitprogramsize++; } else filesize -= unitprogramsize; - + // copy program if (fwrite((void *)src, sizeof(char), unitprogramsize, fd) != unitprogramsize) { @@ -3756,8 +3763,7 @@ int program_fpga(int file_des) { // checksum of copied program if (ret == OK) { - ret = - verifyChecksumFromFile(mess, checksum, TEMP_PROG_FILE_NAME); + ret = verifyChecksumFromFile(mess, checksum, TEMP_PROG_FILE_NAME); } Server_SendResult(file_des, INT32, NULL, 0); if (ret == FAIL) { @@ -3770,7 +3776,7 @@ int program_fpga(int file_des) { Server_SendResult(file_des, INT32, NULL, 0); if (ret == FAIL) { LOG(logERROR, ("Program FPGA FAIL!\n")); - return FAIL; + return FAIL; } #endif // end of Blackfin programming @@ -4024,7 +4030,8 @@ int storage_cell_start(int file_des) { if ((arg == GET_FLAG) || (Server_VerifyLock() == OK)) { if (arg > getMaxStoragecellStart()) { ret = FAIL; - sprintf(mess, "Max Storage cell number should not exceed %d\n", getMaxStoragecellStart()); + sprintf(mess, "Max Storage cell number should not exceed %d\n", + getMaxStoragecellStart()); LOG(logERROR, (mess)); } else { retval = selectStoragecellStart(arg); @@ -4207,7 +4214,7 @@ int copy_detector_server(int file_des) { if (receiveData(file_des, args, sizeof(args), OTHER) < 0) return printSocketReadError(); -#ifdef EIGERD +#ifdef VIRTUAL functionNotImplemented(); #else @@ -4216,57 +4223,114 @@ int copy_detector_server(int file_des) { char *sname = args[0]; char *hostname = args[1]; LOG(logINFOBLUE, ("Copying server %s from host %s\n", sname, hostname)); + char cmd[MAX_STR_LENGTH] = {0}; - char cmd[MAX_STR_LENGTH]; - memset(cmd, 0, MAX_STR_LENGTH); - - // copy server - strcpy(cmd, "tftp "); - strcat(cmd, hostname); - strcat(cmd, " -r "); - strcat(cmd, sname); - strcat(cmd, " -g"); - int success = executeCommand(cmd, retvals, logDEBUG1); - if (success == FAIL) { + // tftp server + char *format = "tftp %s -r %s -g"; + if (snprintf(cmd, MAX_STR_LENGTH, format, hostname, sname) >= + MAX_STR_LENGTH) { ret = FAIL; - strcpy(mess, retvals); + strcpy(mess, "Could not copy detector server. Command to copy " + "server too long\n"); + LOG(logERROR, (mess)); + } else if (executeCommand(cmd, retvals, logDEBUG1) == FAIL) { + ret = FAIL; + snprintf(mess, MAX_STR_LENGTH, + "Could not copy detector server (tftp). %s\n", retvals); // LOG(logERROR, (mess)); already printed in executecommand + } else { + LOG(logINFO, ("\tServer copied\n")); } - // success - else { - LOG(logINFO, ("Server copied successfully\n")); - // give permissions - strcpy(cmd, "chmod 777 "); - strcat(cmd, sname); - executeCommand(cmd, retvals, logDEBUG1); - -#if !defined(GOTTHARD2D) && !defined(MYTHEN3D) - // edit /etc/inittab - // find line numbers in /etc/inittab where DetectorServer - strcpy(cmd, "sed -n '/DetectorServer/=' /etc/inittab"); - executeCommand(cmd, retvals, logDEBUG1); - while (strlen(retvals)) { - // get first linen number - int lineNumber = atoi(retvals); - // delete that line - sprintf(cmd, "sed -i \'%dd\' /etc/inittab", lineNumber); - executeCommand(cmd, retvals, logDEBUG1); - // find line numbers again - strcpy(cmd, "sed -n '/DetectorServer/=' /etc/inittab"); - executeCommand(cmd, retvals, logDEBUG1); + // give permissions + if (ret == OK) { + if (snprintf(cmd, MAX_STR_LENGTH, "chmod 777 %s", sname) >= + MAX_STR_LENGTH) { + ret = FAIL; + strcpy(mess, "Could not copy detector server. Command to give " + "permissions to server is too long\n"); + LOG(logERROR, (mess)); + } else if (executeCommand(cmd, retvals, logDEBUG1) == FAIL) { + ret = FAIL; + snprintf(mess, MAX_STR_LENGTH, + "Could not copy detector server (permissions). %s\n", + retvals); + // LOG(logERROR, (mess)); already printed in executecommand + } else { + LOG(logINFO, ("\tPermissions modified\n")); } - LOG(logINFO, ("Deleted all lines containing DetectorServer in " - "/etc/inittab\n")); + } - // append line - strcpy(cmd, "echo \"ttyS0::respawn:/./"); - strcat(cmd, sname); - strcat(cmd, "\" >> /etc/inittab"); - executeCommand(cmd, retvals, logDEBUG1); + // symbolic link + if (ret == OK) { + if (snprintf(cmd, MAX_STR_LENGTH, "ln -sf %s %s", sname, + LINKED_SERVER_NAME) >= MAX_STR_LENGTH) { + ret = FAIL; + strcpy(mess, "Could not copy detector server. Command to " + "create symbolic link too long\n"); + LOG(logERROR, (mess)); + } else if (executeCommand(cmd, retvals, logDEBUG1) == FAIL) { + ret = FAIL; + snprintf(mess, MAX_STR_LENGTH, + "Could not copy detector server (symbolic link). %s\n", + retvals); + // LOG(logERROR, (mess)); already printed in executecommand + } else { + LOG(logINFO, ("\tSymbolic link created\n")); + } + } - LOG(logINFO, ("/etc/inittab modified to have %s\n", sname)); + // blackfin boards (respawn) (only kept for backwards compatibility) +#if defined(JUNGFRAUD) || defined(CHIPTESTBOARDD) || defined(MOENCHD) || \ + defined(GOTTHARDD) + // delete every line with DetectorServer in /etc/inittab + if (ret == OK) { + strcpy(cmd, "sed -i '/DetectorServer/d' /etc/inittab"); + if (executeCommand(cmd, retvals, logDEBUG1) == FAIL) { + ret = FAIL; + snprintf( + mess, MAX_STR_LENGTH, + "Could not copy detector server (del respawning). %s\n", + retvals); + // LOG(logERROR, (mess)); already printed in executecommand + } else { + LOG(logINFO, ("\tinittab: DetectoServer line deleted\n")); + } + } + + // add new link name to /etc/inittab + if (ret == OK) { + format = "echo 'ttyS0::respawn:/./%s' >> /etc/inittab"; + if (snprintf(cmd, MAX_STR_LENGTH, format, LINKED_SERVER_NAME) >= + MAX_STR_LENGTH) { + ret = FAIL; + strcpy(mess, "Could not copy detector server. Command " + "to add new server for spawning is too long\n"); + LOG(logERROR, (mess)); + } else if (executeCommand(cmd, retvals, logDEBUG1) == FAIL) { + ret = FAIL; + snprintf(mess, MAX_STR_LENGTH, + "Could not copy detector server (respawning). %s\n", + retvals); + // LOG(logERROR, (mess)); already printed in executecommand + } else { + LOG(logINFO, ("\tinittab: updated for respawning\n")); + } + } #endif + + // sync + if (ret == OK) { + strcpy(cmd, "sync"); + if (executeCommand(cmd, retvals, logDEBUG1) == FAIL) { + ret = FAIL; + snprintf(mess, MAX_STR_LENGTH, + "Could not copy detector server (sync). %s\n", + retvals); + // LOG(logERROR, (mess)); already printed in executecommand + } else { + LOG(logINFO, ("\tsync\n")); + } } } #endif @@ -4753,14 +4817,15 @@ int set_read_n_rows(int file_des) { LOG(logERROR, (mess)); } else #elif JUNGFRAUD - if ((check_detector_idle("set number of rows") == OK) && (arg % READ_N_ROWS_MULTIPLE != 0)) { + if ((check_detector_idle("set number of rows") == OK) && + (arg % READ_N_ROWS_MULTIPLE != 0)) { ret = FAIL; sprintf(mess, "Could not set number of rows. %d must be a multiple " "of %d\n", arg, READ_N_ROWS_MULTIPLE); LOG(logERROR, (mess)); - } else + } else #endif { if (setReadNRows(arg) == FAIL) { @@ -4894,7 +4959,9 @@ int set_detector_position(int file_des) { // only set if (Server_VerifyLock() == OK) { - if (check_detector_idle("configure mac") == OK) { + // if in update mode, there is no need to do this (also detector not set + // up) + if (!updateFlag && check_detector_idle("configure mac") == OK) { maxydet = args[0]; detectorId = args[1]; calculate_and_set_position(); @@ -4920,44 +4987,52 @@ int check_detector_idle(const char *s) { int is_udp_configured() { for (int i = 0; i != numUdpDestinations; ++i) { if (udpDetails[i].dstip == 0) { - sprintf(configureMessage, "udp destination ip not configured [entry:%d]\n", i); + sprintf(configureMessage, + "udp destination ip not configured [entry:%d]\n", i); LOG(logWARNING, ("%s", configureMessage)); return FAIL; } if (udpDetails[i].srcip == 0) { - sprintf(configureMessage, "udp source ip not configured [entry:%d]\n", i); + sprintf(configureMessage, + "udp source ip not configured [entry:%d]\n", i); LOG(logWARNING, ("%s", configureMessage)); return FAIL; } if (udpDetails[i].srcmac == 0) { - sprintf(configureMessage, "udp source mac not configured [entry:%d]\n", i); + sprintf(configureMessage, + "udp source mac not configured [entry:%d]\n", i); LOG(logWARNING, ("%s", configureMessage)); return FAIL; } if (udpDetails[i].dstmac == 0) { - sprintf(configureMessage, "udp destination mac not configured [entry:%d]\n", i); + sprintf(configureMessage, + "udp destination mac not configured [entry:%d]\n", i); LOG(logWARNING, ("%s", configureMessage)); return FAIL; } #if defined(JUNGFRAUD) || defined(GOTTHARD2D) if (getNumberofUDPInterfaces() == 2) { if (udpDetails[i].srcip2 == 0) { - sprintf(configureMessage, "udp source ip2 not configured [entry:%d]\n", i); + sprintf(configureMessage, + "udp source ip2 not configured [entry:%d]\n", i); LOG(logWARNING, ("%s", configureMessage)); return FAIL; } if (udpDetails[i].dstip2 == 0) { - sprintf(configureMessage, "udp destination ip2 not configured [entry:%d]\n", i); + sprintf(configureMessage, + "udp destination ip2 not configured [entry:%d]\n", i); LOG(logWARNING, ("%s", configureMessage)); return FAIL; } if (udpDetails[i].srcmac2 == 0) { - sprintf(configureMessage, "udp source mac2 not configured [entry:%d]\n", i); + sprintf(configureMessage, + "udp source mac2 not configured [entry:%d]\n", i); LOG(logWARNING, ("%s", configureMessage)); return FAIL; } if (udpDetails[i].dstmac2 == 0) { - sprintf(configureMessage, "udp destination mac2 not configured [entry:%d]\n", i); + sprintf(configureMessage, + "udp destination mac2 not configured [entry:%d]\n", i); LOG(logWARNING, ("%s", configureMessage)); return FAIL; } @@ -4968,25 +5043,28 @@ int is_udp_configured() { } void configure_mac() { - if (is_udp_configured() == OK) { - ret = configureMAC(); - if (ret != OK) { + if (isControlServer) { + if (is_udp_configured() == OK) { + ret = configureMAC(); + if (ret != OK) { #if defined(CHIPTESTBOARDD) || defined(MOENCHD) - if (ret == -1) { - sprintf(mess, "Could not allocate RAM\n"); - } else { - sprintf(mess, "Could not configure mac because of incorrect " - "udp 1G destination IP and port\n"); - } + if (ret == -1) { + sprintf(mess, "Could not allocate RAM\n"); + } else { + sprintf(mess, + "Could not configure mac because of incorrect " + "udp 1G destination IP and port\n"); + } #else - sprintf(mess, "Configure Mac failed\n"); + sprintf(mess, "Configure Mac failed\n"); #endif - strcpy(configureMessage, mess); - LOG(logERROR, (mess)); - } else { - LOG(logINFOGREEN, ("\tConfigure MAC successful\n")); - configured = OK; - return; + strcpy(configureMessage, mess); + LOG(logERROR, (mess)); + } else { + LOG(logINFOGREEN, ("\tConfigure MAC successful\n")); + configured = OK; + return; + } } } configured = FAIL; @@ -5411,7 +5489,8 @@ int set_num_interfaces(int file_des) { } else if (check_detector_idle("configure mac") == OK) { if (getNumberofUDPInterfaces() != arg) { setNumberofUDPInterfaces(arg); - for (int iRxEntry = 0; iRxEntry != numUdpDestinations; ++iRxEntry) { + for (int iRxEntry = 0; iRxEntry != numUdpDestinations; + ++iRxEntry) { if (arg == 1) { udpDetails[iRxEntry].srcport2 = 0; udpDetails[iRxEntry].srcip2 = 0; @@ -5420,20 +5499,25 @@ int set_num_interfaces(int file_des) { udpDetails[iRxEntry].dstip2 = 0; udpDetails[iRxEntry].dstmac2 = 0; } else { - // if still 0, set defaults - udpDetails[iRxEntry].srcport2 = DEFAULT_UDP_SRC_PORTNO + 1; + // if still 0, set defaults + udpDetails[iRxEntry].srcport2 = + DEFAULT_UDP_SRC_PORTNO + 1; if (udpDetails[iRxEntry].dstport2 == 0) { - udpDetails[iRxEntry].dstport2 = 2 * iRxEntry + 1 + DEFAULT_UDP_DST_PORTNO; + udpDetails[iRxEntry].dstport2 = + 2 * iRxEntry + 1 + DEFAULT_UDP_DST_PORTNO; } // if still 0, copy from entry 0 if (iRxEntry != 0) { udpDetails[iRxEntry].srcip2 = udpDetails[0].srcip2; - udpDetails[iRxEntry].srcmac2 = udpDetails[0].srcmac2; + udpDetails[iRxEntry].srcmac2 = + udpDetails[0].srcmac2; if (udpDetails[iRxEntry].dstip2 == 0) { - udpDetails[iRxEntry].dstip2 = udpDetails[0].dstip2; + udpDetails[iRxEntry].dstip2 = + udpDetails[0].dstip2; } if (udpDetails[iRxEntry].dstmac2 == 0) { - udpDetails[iRxEntry].dstmac2 = udpDetails[0].dstmac2; + udpDetails[iRxEntry].dstmac2 = + udpDetails[0].dstmac2; } } } @@ -6010,46 +6094,22 @@ int set_clock_divider(int file_des) { return printSocketReadError(); LOG(logDEBUG1, ("Setting clock (%d) divider: %u\n", args[0], args[1])); -#if !defined(EIGERD) && !defined(JUNGFRAUD) && !defined(GOTTHARD2D) && \ - !defined(MYTHEN3D) +#if !defined(GOTTHARD2D) && !defined(MYTHEN3D) functionNotImplemented(); #else // only set if (Server_VerifyLock() == OK) { - int ind = args[0]; - int val = args[1]; - enum CLKINDEX c = 0; - switch (ind) { - // specific clock index -#if defined(EIGERD) || defined(JUNGFRAUD) - case RUN_CLOCK: - c = RUN_CLK; - break; -#endif - default: - // any clock index -#if defined(GOTTHARD2D) || defined(MYTHEN3D) - if (ind < NUM_CLOCKS) { - c = (enum CLKINDEX)ind; - break; - } -#endif - modeNotImplemented("clock index (divider set)", ind); - break; + + if (args[0] >= NUM_CLOCKS) { + modeNotImplemented("clock index (divider set)", args[0]); } - // validate val range - if (ret != FAIL) { -#ifdef JUNGFRAUD - if (val == (int)FULL_SPEED && isHardwareVersion2()) { - ret = FAIL; - strcpy(mess, - "Full speed not implemented for this board version.\n"); - LOG(logERROR, (mess)); - } else -#endif -#if defined(GOTTHARD2D) || defined(MYTHEN3D) - if (val < 2 || val > getMaxClockDivider()) { + enum CLKINDEX c = 0; + int val = args[1]; + if (ret == OK) { + c = (enum CLKINDEX)args[0]; + // validate val range + if (val < 2 || val > getMaxClockDivider()) { char *clock_names[] = {CLK_NAMES}; ret = FAIL; sprintf(mess, @@ -6058,24 +6118,12 @@ int set_clock_divider(int file_des) { clock_names[c], (int)c, val, getMaxClockDivider()); LOG(logERROR, (mess)); } -#else - if (val < (int)FULL_SPEED || val > (int)QUARTER_SPEED) { - ret = FAIL; - sprintf(mess, - "Cannot set speed to %d. Value should be in range " - "[%d-%d]\n", - val, (int)FULL_SPEED, (int)QUARTER_SPEED); - LOG(logERROR, (mess)); - } -#endif } if (ret != FAIL) { - char modeName[50] = "speed"; -#if defined(GOTTHARD2D) || defined(MYTHEN3D) + char modeName[50]; char *clock_names[] = {CLK_NAMES}; sprintf(modeName, "%s clock (%d) divider", clock_names[c], (int)c); -#endif if (getClockDivider(c) == val) { LOG(logINFO, ("Same %s: %d\n", modeName, val)); } else { @@ -6105,29 +6153,15 @@ int get_clock_divider(int file_des) { return printSocketReadError(); LOG(logDEBUG1, ("Getting clock (%d) divider\n", arg)); -#if !defined(EIGERD) && !defined(JUNGFRAUD) && !defined(GOTTHARD2D) && \ - !defined(MYTHEN3D) +#if !defined(GOTTHARD2D) && !defined(MYTHEN3D) functionNotImplemented(); #else // get only - enum CLKINDEX c = 0; - switch (arg) { -#if defined(EIGERD) || defined(JUNGFRAUD) - case RUN_CLOCK: - c = RUN_CLK; - break; -#endif - default: -#if defined(GOTTHARD2D) || defined(MYTHEN3D) - if (arg < NUM_CLOCKS) { - c = (enum CLKINDEX)arg; - break; - } -#endif - modeNotImplemented("clock index (divider get)", arg); - break; + if (arg >= NUM_CLOCKS) { + modeNotImplemented("clock index (divider set)", arg); } if (ret == OK) { + enum CLKINDEX c = (enum CLKINDEX)arg; retval = getClockDivider(c); char *clock_names[] = {CLK_NAMES}; LOG(logDEBUG1, ("retval %s clock (%d) divider: %d\n", clock_names[c], @@ -6740,9 +6774,9 @@ int set_current_source(int file_des) { int fix = args[1]; int normal = args[2]; - LOG(logINFOBLUE, ("Setting current source [enable:%d, fix:%d, select:%lld, " - "normal:%d]\n", - enable, fix, (long long int)select, normal)); + LOG(logDEBUG1, ("Setting current source [enable:%d, fix:%d, select:%lld, " + "normal:%d]\n", + enable, fix, (long long int)select, normal)); #if !defined(GOTTHARD2D) && !defined(JUNGFRAUD) functionNotImplemented(); @@ -6751,25 +6785,26 @@ int set_current_source(int file_des) { if (Server_VerifyLock() == OK) { if (enable != 0 && enable != 1) { ret = FAIL; - strcpy(mess, - "Could not enable/disable current source. Enable can be 0 or 1 only.\n"); + strcpy(mess, "Could not enable/disable current source. Enable can " + "be 0 or 1 only.\n"); LOG(logERROR, (mess)); - } + } // disable - else if (enable == 0 && (fix != -1 || normal != -1)) { + else if (enable == 0 && (fix != -1 || normal != -1)) { ret = FAIL; - strcpy(mess, - "Could not disable current source. Requires no parameters.\n"); - LOG(logERROR, (mess)); + strcpy( + mess, + "Could not disable current source. Requires no parameters.\n"); + LOG(logERROR, (mess)); } // enable else if (enable == 1) { -#ifdef GOTTHARD2D +#ifdef GOTTHARD2D // no parameters allowed if (fix != -1 || normal != -1) { ret = FAIL; - strcpy(mess, - "Could not enable current source. Fix and normal are invalid parameters for this detector.\n"); + strcpy(mess, "Could not enable current source. Fix and normal " + "are invalid parameters for this detector.\n"); LOG(logERROR, (mess)); } #else @@ -6792,7 +6827,8 @@ int set_current_source(int file_des) { if (fix != 0 && fix != 1) { ret = FAIL; strcpy(mess, - "Could not enable current source. Invalid value for parameter (fix). Options: 0 or 1.\n"); + "Could not enable current source. Invalid value " + "for parameter (fix). Options: 0 or 1.\n"); LOG(logERROR, (mess)); } else if (normal != -1) { ret = FAIL; @@ -6826,7 +6862,8 @@ int set_current_source(int file_des) { #endif int retval = getCurrentSource(); LOG(logDEBUG1, ("current source enable retval: %u\n", retval)); - validate(&ret, mess, enable, retval, "set current source enable", DEC); + validate(&ret, mess, enable, retval, "set current source enable", + DEC); } } #endif @@ -7892,10 +7929,11 @@ int set_filter_resistor(int file_des) { if (Server_VerifyLock() == OK) { if (arg < 0 || arg > ASIC_FILTER_MAX_RES_VALUE) { ret = FAIL; - sprintf(mess, - "Could not set filter resistor. Invalid filter argument %d. " - "Options [0-%d]\n", - arg, ASIC_FILTER_MAX_RES_VALUE); + sprintf( + mess, + "Could not set filter resistor. Invalid filter argument %d. " + "Options [0-%d]\n", + arg, ASIC_FILTER_MAX_RES_VALUE); LOG(logERROR, (mess)); } #ifdef JUNGFRAUD @@ -7911,7 +7949,7 @@ int set_filter_resistor(int file_des) { if (ret == FAIL) { ret = FAIL; strcpy(mess, "Could not set filter resistor.\n"); - LOG(logERROR, (mess)); + LOG(logERROR, (mess)); } #ifndef JUNGFRAUD // jungfrau might take time to update status register if acquiring @@ -8528,8 +8566,8 @@ int set_veto_algorithm(int file_des) { enum vetoAlgorithm alg = args[0]; enum streamingInterface interface = args[1]; - LOG(logDEBUG1, ("Setting vetoalgorithm (interface: %d): %u\n", (int)interface, - (int)alg)); + LOG(logDEBUG1, ("Setting vetoalgorithm (interface: %d): %u\n", + (int)interface, (int)alg)); #ifndef GOTTHARD2D functionNotImplemented(); @@ -8819,10 +8857,10 @@ int set_flip_rows(int file_des) { #else // only set if (Server_VerifyLock() == OK) { - if ((check_detector_idle("set flip rows") == OK) && (arg != 0 && arg != 1)) { + if ((check_detector_idle("set flip rows") == OK) && + (arg != 0 && arg != 1)) { ret = FAIL; - sprintf(mess, - "Could not set flip rows. Invalid argument %d.\n", + sprintf(mess, "Could not set flip rows. Invalid argument %d.\n", arg); LOG(logERROR, (mess)); } @@ -8848,7 +8886,6 @@ int set_flip_rows(int file_des) { return Server_SendResult(file_des, INT32, NULL, 0); } - int get_filter_cell(int file_des) { ret = OK; memset(mess, 0, sizeof(mess)); @@ -8884,7 +8921,8 @@ int set_filter_cell(int file_des) { if (arg < 0 || arg > MAX_FILTER_CELL_VAL) { ret = FAIL; sprintf(mess, - "Could not set filter cell. Invalid argument %d. Options: 0 - %d\n", + "Could not set filter cell. Invalid argument %d. Options: " + "0 - %d\n", arg, MAX_FILTER_CELL_VAL); LOG(logERROR, (mess)); } @@ -8896,7 +8934,8 @@ int set_filter_cell(int file_des) { LOG(logERROR, (mess)); } else { setFilterCell(arg); - // no validation as it might take time to update status register if acquiring + // no validation as it might take time to update status register if + // acquiring } } #endif @@ -9011,12 +9050,12 @@ int get_dest_udp_list(int file_des) { #if !defined(EIGERD) && !defined(JUNGFRAUD) functionNotImplemented(); #else - if (arg > MAX_UDP_DESTINATION) { + if (arg >= MAX_UDP_DESTINATION) { ret = FAIL; sprintf( mess, "Could not set udp destination. Invalid entry. Options: 0 - %d\n", - MAX_UDP_DESTINATION); + MAX_UDP_DESTINATION - 1); LOG(logERROR, (mess)); } else { retvals[0] = arg; @@ -9064,8 +9103,8 @@ int set_dest_udp_list(int file_des) { return printSocketReadError(); // swap ip - args[3] = __builtin_bswap32(args[3]); - args[4] = __builtin_bswap32(args[4]); + args[3] = __builtin_bswap32(args[3]); + args[4] = __builtin_bswap32(args[4]); // convert to string char ip[INET_ADDRSTRLEN], ip2[INET_ADDRSTRLEN]; @@ -9084,22 +9123,21 @@ int set_dest_udp_list(int file_des) { LOG(logINFOBLUE, ("Setting udp dest. [%d]: [port %d, port2 %d, ip %s, ip2 %s, " "mac %s, mac2 %s]\n", - entry, args[1], args[2], ip, ip2, mac, mac2)); + entry, args[1], args[2], ip, ip2, mac, mac2)); - if (entry < 1 || entry > MAX_UDP_DESTINATION) { + if (entry < 1 || entry >= MAX_UDP_DESTINATION) { ret = FAIL; - sprintf( - mess, - "Could not set udp destination. Invalid entry. Options: 1 - %d\n", - MAX_UDP_DESTINATION); + sprintf(mess, + "Could not set udp destination. Invalid entry. Options: 1 " + "- %d\n", + MAX_UDP_DESTINATION - 1); LOG(logERROR, (mess)); - } + } #ifdef EIGERD else if (args[4] != 0 || args64[1] != 0) { ret = FAIL; - strcpy( - mess, - "Could not set udp destination. ip2 and mac2 not implemented for this detector.\n"); + strcpy(mess, "Could not set udp destination. ip2 and mac2 not " + "implemented for this detector.\n"); LOG(logERROR, (mess)); } #endif @@ -9108,7 +9146,7 @@ int set_dest_udp_list(int file_des) { if (args[1] != 0) { udpDetails[entry].dstport = args[1]; } - if (args[2] != 0) { + if (args[2] != 0) { udpDetails[entry].dstport2 = args[2]; } if (args[3] != 0) { @@ -9131,12 +9169,14 @@ int set_dest_udp_list(int file_des) { #endif udpDetails[entry].srcport = DEFAULT_UDP_SRC_PORTNO; if (udpDetails[entry].dstport == 0) { - udpDetails[entry].dstport = 2 * entry + DEFAULT_UDP_DST_PORTNO; + udpDetails[entry].dstport = + 2 * entry + DEFAULT_UDP_DST_PORTNO; } if (myDetectorType == EIGER || twoInterfaces) { udpDetails[entry].srcport2 = DEFAULT_UDP_SRC_PORTNO + 1; if (udpDetails[entry].dstport2 == 0) { - udpDetails[entry].dstport2 = 2 * entry + 1 + DEFAULT_UDP_DST_PORTNO; + udpDetails[entry].dstport2 = + 2 * entry + 1 + DEFAULT_UDP_DST_PORTNO; } } // if still 0, copy from entry 0 @@ -9162,7 +9202,7 @@ int set_dest_udp_list(int file_des) { } // find number of destinations int numdest = 0; - for (int i = MAX_UDP_DESTINATION; i >= 0; --i) { + for (int i = MAX_UDP_DESTINATION - 1; i >= 0; --i) { if (udpDetails[i].dstip != 0) { numdest = i + 1; break; @@ -9206,11 +9246,12 @@ int get_num_dest_list(int file_des) { int retval1 = 0; if (getNumberofDestinations(&retval1) == FAIL || retval1 != retval) { - ret = FAIL; - sprintf( - mess, - "Could not get number of udp destinations. (server reads %d, fpga reads %d).\n", retval1, retval); - LOG(logERROR, (mess)); + ret = FAIL; + sprintf(mess, + "Could not get number of udp destinations. (server reads %d, " + "fpga reads %d).\n", + retval1, retval); + LOG(logERROR, (mess)); } #endif @@ -9277,10 +9318,11 @@ int set_udp_first_dest(int file_des) { if (check_detector_idle("set first udp destination") == OK) { setFirstUDPDestination(arg); int retval = getFirstUDPDestination(); - validate(&ret, mess, arg, retval, "set udp first destination", DEC); + validate(&ret, mess, arg, retval, "set udp first destination", + DEC); if (ret == OK) { firstUDPDestination = arg; - //configure_mac(); + // configure_mac(); } } } @@ -9288,3 +9330,83 @@ int set_udp_first_dest(int file_des) { #endif return Server_SendResult(file_des, INT32, NULL, 0); } + +int get_readout_speed(int file_des) { + ret = OK; + memset(mess, 0, sizeof(mess)); + int retval = -1; + LOG(logDEBUG1, ("Getting readout speed\n")); + +#if !defined(JUNGFRAUD) && !defined(EIGERD) && !defined(GOTTHARD2D) + functionNotImplemented(); +#else + // get only + ret = getReadoutSpeed(&retval); + LOG(logDEBUG1, ("retval readout speed: %d\n", retval)); + if (ret == FAIL) { + strcpy(mess, "Could not get readout speed\n"); + LOG(logERROR, (mess)); + } +#endif + return Server_SendResult(file_des, INT32, &retval, sizeof(retval)); +} + +int set_readout_speed(int file_des) { + ret = OK; + memset(mess, 0, sizeof(mess)); + int arg = -1; + + if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0) + return printSocketReadError(); + LOG(logDEBUG1, ("Setting readout speed : %u\n", arg)); + +#if !defined(JUNGFRAUD) && !defined(EIGERD) && !defined(GOTTHARD2D) + functionNotImplemented(); +#else + // only set + if (Server_VerifyLock() == OK) { +#ifdef JUNGFRAUD + if (arg == (int)FULL_SPEED && isHardwareVersion2()) { + ret = FAIL; + strcpy( + mess, + "Full speed not implemented for this board version (v1.0).\n"); + LOG(logERROR, (mess)); + } +#endif + if (ret == OK) { + switch (arg) { +#if defined(EIGERD) || defined(JUNGFRAUD) + case FULL_SPEED: + case HALF_SPEED: + case QUARTER_SPEED: +#elif GOTTHARD2D + case G2_108MHZ: + case G2_144MHZ: +#endif + break; + default: + modeNotImplemented("readout speed index", arg); + break; + } + if (ret == OK) { + ret = setReadoutSpeed(arg); + if (ret == FAIL) { + sprintf(mess, "Could not set readout speed to %d.\n", arg); + LOG(logERROR, (mess)); + } else { + int retval = 0; + ret = getReadoutSpeed(&retval); + LOG(logDEBUG1, ("retval readout speed: %d\n", retval)); + if (ret == FAIL) { + strcpy(mess, "Could not get readout speed\n"); + LOG(logERROR, (mess)); + } + validate(&ret, mess, arg, retval, "set readout speed", DEC); + } + } + } + } +#endif + return Server_SendResult(file_des, INT32, NULL, 0); +} \ No newline at end of file diff --git a/slsDetectorServers/stripDetectorDaemon/Makefile b/slsDetectorServers/stripDetectorDaemon/Makefile index 1935c390d..4b2c764e9 100644 --- a/slsDetectorServers/stripDetectorDaemon/Makefile +++ b/slsDetectorServers/stripDetectorDaemon/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package current_dir = $(shell pwd) CROSS = nios2-buildroot-linux-gnu- diff --git a/slsDetectorServers/stripDetectorDaemon/stripd.c b/slsDetectorServers/stripDetectorDaemon/stripd.c index 873a2cb6e..6be9f0111 100644 --- a/slsDetectorServers/stripDetectorDaemon/stripd.c +++ b/slsDetectorServers/stripDetectorDaemon/stripd.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include #include #include diff --git a/slsDetectorSoftware/CMakeLists.txt b/slsDetectorSoftware/CMakeLists.txt index 91697a939..1a6b922f0 100755 --- a/slsDetectorSoftware/CMakeLists.txt +++ b/slsDetectorSoftware/CMakeLists.txt @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package set(SOURCES src/DetectorImpl.cpp src/Module.cpp @@ -41,6 +43,8 @@ if(SLS_BUILD_SHARED_LIBRARIES) add_library(slsDetectorShared SHARED $) target_link_libraries(slsDetectorShared PUBLIC slsDetectorObject) set_target_properties(slsDetectorShared PROPERTIES + VERSION ${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH} + SOVERSION ${PACKAGE_VERSION_MAJOR} LIBRARY_OUTPUT_NAME SlsDetector LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin PUBLIC_HEADER "${PUBLICHEADERS}" diff --git a/slsDetectorSoftware/include/sls/Detector.h b/slsDetectorSoftware/include/sls/Detector.h index e35bd4739..94dc2ad14 100644 --- a/slsDetectorSoftware/include/sls/Detector.h +++ b/slsDetectorSoftware/include/sls/Detector.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/Pattern.h" #include "sls/Result.h" @@ -81,7 +83,8 @@ class Detector { /* [Jungfrau][Gotthard][Mythen3][Gotthard2][CTB][Moench] */ Result getSerialNumber(Positions pos = {}) const; - /** [Eiger][Gotthard2][Mythen3] 6 bit value (ideally unique) that is streamed out in the UDP header of the detector.*/ + /** [Eiger][Gotthard2][Mythen3] 6 bit value (ideally unique) that is + * streamed out in the UDP header of the detector.*/ Result getModuleId(Positions pos = {}) const; Result getReceiverVersion(Positions pos = {}) const; @@ -300,16 +303,21 @@ class Detector { /** list of possible timing modes for this detector */ std::vector getTimingModeList() const; - /** [Eiger][Jungfrau] */ - Result getSpeed(Positions pos = {}) const; + /** [Eiger][Jungfrau][Gotthard2] */ + Result getReadoutSpeed(Positions pos = {}) const; - /** [Eiger][Jungfrau] - * Options: FULL_SPEED, HALF_SPEED, QUARTER_SPEED \n - * [Jungfrau] FULL_SPEED option only available from v2.0 boards and with - * setting number of interfaces to 2. \n Also overwrites adcphase to - * recommended default. + /** [Eiger][Jungfrau][Gotthard2] + * [Jungfrau] Options: FULL_SPEED, HALF_SPEED (Default), QUARTER_SPEED \n + * [Eiger] Options: FULL_SPEED (Default), HALF_SPEED, QUARTER_SPEED \n + * [Gotthard2] Options: G2_108MHZ (Default), G2_144MHZ \n + * [Jungfrau] FULL_SPEED option only available from v2.0 boards and is + * recommended to set number of interfaces to 2. \n Also overwrites adcphase + * to recommended default. */ - void setSpeed(defs::speedLevel value, Positions pos = {}); + void setReadoutSpeed(defs::speedLevel value, Positions pos = {}); + + /** list of possible readoutspeed modes for this detector */ + std::vector getReadoutSpeedList() const; /** [Jungfrau][CTB][Moench] */ Result getADCPhase(Positions pos = {}) const; @@ -397,8 +405,9 @@ class Detector { * [Moench] Default is disabled. \n * [Jungfrau] Default is disabled. Get will return power status. Can be off * if temperature event occured (temperature over temp_threshold with - * temp_control enabled. Will configure chip (only chip v1.1)\n [Mythen3][Gotthard2] Default is 1. If module not - * connected or wrong module, powerchip will fail. + * temp_control enabled. Will configure chip (only chip v1.1)\n + * [Mythen3][Gotthard2] Default is 1. If module not connected or wrong + * module, powerchip will fail. */ void setPowerChip(bool on, Positions pos = {}); @@ -511,7 +520,9 @@ class Detector { /** [Eiger] Number of rows to read out per half module * Options: 0 - 256. 256 is default. The permissible values depend on - * dynamic range and 10Gbe enabled. \n[Jungfrau] Number of rows per module starting from the centre. Options: 8 - 512, must be multiples of 8. Default is 512. + * dynamic range and 10Gbe enabled. \n[Jungfrau] Number of rows per module + * starting from the centre. Options: 8 - 512, must be multiples of 8. + * Default is 512. */ void setReadNRows(const int lines, Positions pos = {}); @@ -1219,7 +1230,8 @@ class Detector { Result getStorageCellStart(Positions pos = {}) const; /** [Jungfrau] Advanced. Sets the storage cell storing the first acquisition - * of the series. Options: 0-max. max is 15 (default) for chipv1.0 and 3 (default) for chipv1.1. + * of the series. Options: 0-max. max is 15 (default) for chipv1.0 and 3 + * (default) for chipv1.1. */ void setStorageCellStart(int cell, Positions pos = {}); @@ -1228,7 +1240,7 @@ class Detector { /** [Jungfrau] Advanced \n Additional time delay between 2 consecutive * exposures in burst mode. \n Options: (0-1638375 ns (resolution of 25ns)\n - * Only applicable for chipv1.0. + * Only applicable for chipv1.0. */ void setStorageCellDelay(ns value, Positions pos = {}); @@ -1360,14 +1372,15 @@ class Detector { /** [Gotthard2] */ Result getVetoStream(Positions pos = {}) const; - /** [Gotthard2] Options: NONE (Default), LOW_LATENCY_LINK, ETHERNET_10GB (debugging), ALL - * Enable or disable the 2 veto streaming interfaces available. Can - * concatenate more than one interface. \nLOW_LATENCY_LINK is the default - * interface to work with. \nETHERNET_10GB is for debugging and also enables second - * interface in receiver for listening to veto packets (writes a separate - * file if writing enabled). Also restarts client and receiver zmq sockets - * if zmq streaming enabled.*/ - void setVetoStream(const defs::streamingInterface value, Positions pos = {}); + /** [Gotthard2] Options: NONE (Default), LOW_LATENCY_LINK, ETHERNET_10GB + * (debugging), ALL Enable or disable the 2 veto streaming interfaces + * available. Can concatenate more than one interface. \nLOW_LATENCY_LINK is + * the default interface to work with. \nETHERNET_10GB is for debugging and + * also enables second interface in receiver for listening to veto packets + * (writes a separate file if writing enabled). Also restarts client and + * receiver zmq sockets if zmq streaming enabled.*/ + void setVetoStream(const defs::streamingInterface value, + Positions pos = {}); /** [Gotthard2] */ Result @@ -1539,7 +1552,7 @@ class Detector { /** [CTB] */ void setDBITClock(int value_in_MHz, Positions pos = {}); - /** + /** * [CTB] mV * Options: V_POWER_A, V_POWER_B, V_POWER_C, V_POWER_D, V_POWER_IO */ Result getMeasuredVoltage(defs::dacIndex index, @@ -1723,21 +1736,24 @@ class Detector { * * * ************************************************/ - /** Advanced user Function! - * [Jungfrau][CTB][Moench] fname is a pof file, rebooting the controller is - * recommended \n [Mythen3][Gotthard2] fname is an rbf file, power cycling - * the detector is recommended + /** [Jungfrau][Gotthard][CTB][Moench][Mythen3][Gotthard2] + * Advanced user Function! + * Program firmware from command line, after which detector controller is + * rebooted. [Jungfrau][CTB][Moench] fname is a pof file (full path) \n + * [Mythen3][Gotthard2] fname is an rbf file (full path) */ void programFPGA(const std::string &fname, Positions pos = {}); /** [Jungfrau][CTB][Moench] Advanced user Function! */ void resetFPGA(Positions pos = {}); - /** [Jungfrau][Gotthard][CTB][Moench][Mythen3][Gotthard2] + /** [Jungfrau][Eiger][Gotthard][CTB][Moench][Mythen3][Gotthard2] * Advanced user Function! \n - * Copy detector server fname from tftp folder of hostname to detector \n - * [Jungfrau][Gotthard][CTB][Moench] Also changes respawn server, which is - * effective after a reboot. + * Copy detector server fname from tftp folder of hostname to detector. Also + * creates a symbolic link to a shorter name (without vx.x.x). Then the + * detector controller reboots (except eiger) \n + * [Jungfrau][Gotthard][CTB][Moench] Also changes respawn server (to the + * link), which is effective after a reboot. */ void copyDetectorServer(const std::string &fname, const std::string &hostname, Positions pos = {}); @@ -1748,11 +1764,11 @@ class Detector { /** * Advanced user Function!\n [Jungfrau][Gotthard][CTB][Moench] Updates the - * firmware, detector server and then reboots detector controller blackfin. - * \n [Mythen3][Gotthard2] Will still have old server starting up as the new - * server is not respawned \n sname is name of detector server binary found - * on tftp folder of host pc \n hostname is name of pc to tftp from \n fname - * is programming file name + * firmware, detector server, make a soft link and then reboots detector + * controller. \n [Mythen3][Gotthard2] Will require a script to start up the + * shorter named server link at start up \n sname is name of detector + * server binary found on tftp folder of host pc \n hostname is name of pc + * to tftp from \n fname is programming file name with full path to it */ void updateFirmwareAndServer(const std::string &sname, const std::string &hostname, diff --git a/slsDetectorSoftware/include/sls/Pattern.h b/slsDetectorSoftware/include/sls/Pattern.h index 7f435ba54..7319a3f94 100644 --- a/slsDetectorSoftware/include/sls/Pattern.h +++ b/slsDetectorSoftware/include/sls/Pattern.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/sls_detector_defs.h" diff --git a/slsDetectorSoftware/include/sls/Result.h b/slsDetectorSoftware/include/sls/Result.h index c7f71e481..2578ad2ba 100644 --- a/slsDetectorSoftware/include/sls/Result.h +++ b/slsDetectorSoftware/include/sls/Result.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once /** @@ -68,7 +70,7 @@ template > class Result { * @tparam Args template paramter pack to forward */ template - Result(Args &&... args) : vec(std::forward(args)...) {} + Result(Args &&...args) : vec(std::forward(args)...) {} using value_type = typename std::vector::value_type; using iterator = typename std::vector::iterator; diff --git a/slsDetectorSoftware/include/sls/detectorData.h b/slsDetectorSoftware/include/sls/detectorData.h index b4fbaf089..3205dbdce 100644 --- a/slsDetectorSoftware/include/sls/detectorData.h +++ b/slsDetectorSoftware/include/sls/detectorData.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include #include diff --git a/slsDetectorSoftware/src/CmdLineApp.cpp b/slsDetectorSoftware/src/CmdLineApp.cpp index fc7867ce3..cc86cfcfa 100644 --- a/slsDetectorSoftware/src/CmdLineApp.cpp +++ b/slsDetectorSoftware/src/CmdLineApp.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package /* This file is used to generate the command line binaries diff --git a/slsDetectorSoftware/src/CmdParser.cpp b/slsDetectorSoftware/src/CmdParser.cpp index ab7dc52ad..109a50b77 100644 --- a/slsDetectorSoftware/src/CmdParser.cpp +++ b/slsDetectorSoftware/src/CmdParser.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "CmdParser.h" #include "sls/string_utils.h" diff --git a/slsDetectorSoftware/src/CmdParser.h b/slsDetectorSoftware/src/CmdParser.h index 7e1bd970e..47a1703ea 100644 --- a/slsDetectorSoftware/src/CmdParser.h +++ b/slsDetectorSoftware/src/CmdParser.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package /* This class parses command line input or string input to extract the diff --git a/slsDetectorSoftware/src/CmdProxy.cpp b/slsDetectorSoftware/src/CmdProxy.cpp index 1cfff609d..2c46b78c0 100644 --- a/slsDetectorSoftware/src/CmdProxy.cpp +++ b/slsDetectorSoftware/src/CmdProxy.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "CmdProxy.h" #include "HelpDacs.h" #include "sls/TimeHelper.h" @@ -605,57 +607,38 @@ std::string CmdProxy::Exptime(int action) { return os.str(); } -std::string CmdProxy::Speed(int action) { +std::string CmdProxy::ReadoutSpeed(int action) { std::ostringstream os; os << cmd << ' '; if (action == defs::HELP_ACTION) { - os << "[0 or full_speed|1 or half_speed|2 or " - "quarter_speed]\n\t[Eiger][Jungfrau] Readout speed of " - "chip.\n\t[Jungfrau] FULL_SPEED option only available from v2.0 " - "boards and with setting number of interfaces to 2. Also " - "overwrites adcphase to recommended default. " + os << "\n\t[0 or full_speed|1 or half_speed|2 or " + "quarter_speed]\n\t\t[Eiger][Jungfrau] Readout " + "speed of chip.\n\t\t[Eiger] Default speed is full_speed." + "\n\t\t[Jungfrau] Default speed is half_speed. full_speed " + "option only available from v2.0 boards and is recommended to " + "set " + "number of interfaces to 2. Also overwrites " + "adcphase to recommended default.\n\t [144|108]\n\t\t[Gotthard2] " + "Readout speed of chip in MHz. Default is 108." << '\n'; } else { defs::detectorType type = det->getDetectorType().squash(); if (type == defs::CHIPTESTBOARD || type == defs::MOENCH) { throw sls::RuntimeError( - "Speed not implemented. Did you mean runclk?"); - } - if (type != defs::EIGER && type != defs::JUNGFRAU) { - throw sls::RuntimeError( - "Speed not implemented."); // setspped one function problem. tbr - // after change + "ReadoutSpeed not implemented. Did you mean runclk?"); } if (action == defs::GET_ACTION) { if (!args.empty()) { WrongNumberOfParameters(0); } - auto t = det->getSpeed(std::vector{det_id}); + auto t = det->getReadoutSpeed(std::vector{det_id}); os << OutString(t) << '\n'; } else if (action == defs::PUT_ACTION) { if (args.size() != 1) { WrongNumberOfParameters(1); } - defs::speedLevel t; - try { - int ival = StringTo(args[0]); - switch (ival) { - case 0: - t = defs::FULL_SPEED; - break; - case 1: - t = defs::HALF_SPEED; - break; - case 2: - t = defs::QUARTER_SPEED; - break; - default: - throw sls::RuntimeError("Unknown speed " + args[0]); - } - } catch (...) { - t = sls::StringTo(args[0]); - } - det->setSpeed(t, std::vector{det_id}); + defs::speedLevel t = sls::StringTo(args[0]); + det->setReadoutSpeed(t, std::vector{det_id}); os << sls::ToString(t) << '\n'; // no args to convert 0,1,2 as well } else { throw sls::RuntimeError("Unknown action"); @@ -965,7 +948,8 @@ std::string CmdProxy::CurrentSource(int action) { std::ostringstream os; os << cmd << ' '; if (action == defs::HELP_ACTION) { - os << "\n\t[0|1]\n\t\t[Gotthard2] Enable or disable current source. Default " + os << "\n\t[0|1]\n\t\t[Gotthard2] Enable or disable current source. " + "Default " "is disabled.\n\t[0|1] [fix|nofix] [select source] [(only for " "chipv1.1)normal|low]\n\t\t[Jungfrau] Disable or enable current " "source with some parameters. The select source is 0-63 for " @@ -995,7 +979,7 @@ std::string CmdProxy::CurrentSource(int action) { } if (args.size() == 3) { det->setCurrentSource(defs::currentSrcParameters( - fix, StringTo(args[2]))); + fix, StringTo(args[2]))); } else if (args.size() == 4) { bool normalCurrent = false; if (args[3] == "normal") { @@ -1007,7 +991,7 @@ std::string CmdProxy::CurrentSource(int action) { ". Did you mean normal or low?"); } det->setCurrentSource(defs::currentSrcParameters( - fix, StringTo(args[2]), normalCurrent)); + fix, StringTo(args[2]), normalCurrent)); } else { throw sls::RuntimeError( "Invalid number of parareters for this command."); @@ -1338,7 +1322,8 @@ std::string CmdProxy::Trigger(int action) { os << cmd << ' '; if (action == defs::HELP_ACTION) { if (cmd == "trigger") { - os << "\n\t[Eiger][Mythen3] Sends software trigger signal to detector"; + os << "\n\t[Eiger][Mythen3] Sends software trigger signal to " + "detector"; } else if (cmd == "blockingtrigger") { os << "\n\t[Eiger] Sends software trigger signal to detector and " "blocks till " @@ -2050,7 +2035,8 @@ std::string CmdProxy::VetoStreaming(int action) { if (action == defs::HELP_ACTION) { os << "[none|lll|10gbe|...]\n\t[Gotthard2] Enable or disable the 2 " "veto streaming interfaces available. Can include more than one " - "interface. \n\tDefault: none. lll (low latency link) is the default " + "interface. \n\tDefault: none. lll (low latency link) is the " + "default " "interface to work with. \n\t10GbE is for debugging and also " "enables second interface in receiver for listening to veto " "packets (writes a separate file if writing enabled). Also " @@ -2833,10 +2819,11 @@ std::string CmdProxy::ProgramFpga(int action) { std::ostringstream os; os << cmd << ' '; if (action == defs::HELP_ACTION) { - os << "[fname.pof | fname.rbf]\n\t[Jungfrau][Ctb][Moench] Programs " - "FPGA from pof file. Rebooting controller is recommended. " - "\n\t[Mythen3][Gotthard2] Programs FPGA from rbf file. Power " - "cycling the detector is recommended. " + os << "[fname.pof | fname.rbf (full path)]\n\t[Jungfrau][Ctb][Moench] " + "Programs FPGA from pof file (full path). Then, detector " + "controller is rebooted \n\t[Mythen3][Gotthard2] Programs FPGA " + "from rbf file (full path). Then, detector controller is " + "rebooted." << '\n'; } else if (action == defs::GET_ACTION) { throw sls::RuntimeError("Cannot get"); @@ -2856,11 +2843,13 @@ std::string CmdProxy::CopyDetectorServer(int action) { std::ostringstream os; os << cmd << ' '; if (action == defs::HELP_ACTION) { - os << "[server_name] " - "[pc_host_name]\n\t[Jungfrau][Ctb][Moench][Mythen3][Gotthard2] " - "Copies detector server via tftp from pc. " - "\n\t[Jungfrau][Ctb][Moench]Also changes respawn server, which " - "is effective after a reboot." + os << "[server_name (in tftp folder)] " + "[pc_host_name]\n\t[Jungfrau][Eiger][Ctb][Moench][Mythen3][" + "Gotthard2] Copies detector server via tftp from pc. Ensure that " + "server is in the pc's tftp folder. Makes a symbolic link with a " + "shorter name (without vx.x.x). Then, detector reboots (except " + "Eiger).\n\t[Jungfrau][Ctb][Moench]Also changes respawn server " + "to the link, which is effective after a reboot." << '\n'; } else if (action == defs::GET_ACTION) { throw sls::RuntimeError("Cannot get"); @@ -2880,14 +2869,14 @@ std::string CmdProxy::UpdateFirmwareAndDetectorServer(int action) { std::ostringstream os; os << cmd << ' '; if (action == defs::HELP_ACTION) { - os << "[server_name] [pc_host_name] " - "[fname.pof]\n\t[Jungfrau][Gotthard][CTB][Moench] Updates the " - "firmware, detector server and then reboots detector controller " - "blackfin. \n\t[Mythen3][Gotthard2] Will still have old server " - "starting up as the new server is not respawned \n\tsname is " - "name of detector server binary found on tftp folder of host pc " - "\n\thostname is name of pc to tftp from \n\tfname is " - "programming file name" + os << "[server_name (in tftp folder)] [pc_host_name] [fname.pof (incl " + "full path)]\n\t[Jungfrau][Gotthard][CTB][Moench] Updates the " + "firmware, detector server, creates the symbolic link and then " + "reboots detector controller. \n\t[Mythen3][Gotthard2] will " + "require a script to start up the shorter named server link at " + "start up. \n\tsname is name of detector server binary found on " + "tftp folder of host pc \n\thostname is name of pc to tftp from " + "\n\tfname is programming file name" << '\n'; } else if (action == defs::GET_ACTION) { throw sls::RuntimeError("Cannot get"); diff --git a/slsDetectorSoftware/src/CmdProxy.h b/slsDetectorSoftware/src/CmdProxy.h index 2424f89cd..c96c4f2e2 100644 --- a/slsDetectorSoftware/src/CmdProxy.h +++ b/slsDetectorSoftware/src/CmdProxy.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/Detector.h" @@ -591,7 +593,8 @@ class CmdProxy { /* acquisition parameters */ {"cycles", "triggers"}, {"cyclesl", "triggersl"}, - {"clkdivider", "speed"}, + {"clkdivider", "readoutspeed"}, + {"speed", "readoutspeed"}, {"vhighvoltage", "highvoltage"}, {"digitest", "imagetest"}, {"filter", "filterresistor"}, @@ -792,7 +795,8 @@ class CmdProxy { {"drlist", &CmdProxy::drlist}, {"timing", &CmdProxy::timing}, {"timinglist", &CmdProxy::timinglist}, - {"speed", &CmdProxy::Speed}, + {"readoutspeed", &CmdProxy::ReadoutSpeed}, + {"readoutspeedlist", &CmdProxy::readoutspeedlist}, {"adcphase", &CmdProxy::Adcphase}, {"maxadcphaseshift", &CmdProxy::maxadcphaseshift}, {"dbitphase", &CmdProxy::Dbitphase}, @@ -1097,7 +1101,7 @@ class CmdProxy { std::string Acquire(int action); std::string Exptime(int action); std::string DynamicRange(int action); - std::string Speed(int action); + std::string ReadoutSpeed(int action); std::string Adcphase(int action); std::string Dbitphase(int action); std::string ClockFrequency(int action); @@ -1205,10 +1209,10 @@ class CmdProxy { "\n\t[Jungfrau][Gotthard][Mythen3][Gotthard2][CTB][Moench]" "Serial number of detector."); - GET_COMMAND( - moduleid, getModuleId, - "\n\t[Gotthard2][Eiger][Mythen3] 16 bit value (ideally unique) " - "that is streamed out in the UDP header of the detector. Picked up from a file on the module."); + GET_COMMAND(moduleid, getModuleId, + "\n\t[Gotthard2][Eiger][Mythen3] 16 bit value (ideally unique) " + "that is streamed out in the UDP header of the detector. " + "Picked up from a file on the module."); GET_COMMAND(type, getDetectorType, "\n\tReturns detector type. Can be Eiger, Jungfrau, Gotthard, " @@ -1328,6 +1332,10 @@ class CmdProxy { GET_COMMAND_NOID(timinglist, getTimingModeList, "\n\tGets the list of timing modes for this detector."); + GET_COMMAND_NOID( + readoutspeedlist, getReadoutSpeedList, + "\n\tList of readout speed levels implemented for this detector."); + GET_COMMAND(maxadcphaseshift, getMaxADCPhaseShift, "\n\t[Jungfrau][CTB][Moench] Absolute maximum Phase shift of " "ADC clock."); @@ -1349,7 +1357,8 @@ class CmdProxy { "the chip. \n\t[Moench] Default is 0. \n\t[Jungfrau] Default is 0. Get " "will return power status. Can be off if temperature event occured " "(temperature over temp_threshold with temp_control " - "enabled. Will configure chip (only chip v1.1)\n\t[Mythen3][Gotthard2] Default is 1. If module not " + "enabled. Will configure chip (only chip v1.1)\n\t[Mythen3][Gotthard2] " + "Default is 1. If module not " "connected or wrong module, powerchip will fail."); INTEGER_COMMAND_VEC_ID( @@ -1382,7 +1391,10 @@ class CmdProxy { readnrows, getReadNRows, setReadNRows, StringTo, "\n\t[1-256]\n\t\t[Eiger] Number of rows to readout per half module " "starting from the centre. Options: 0 - 256. 256 is default. The " - "permissible values depend on dynamic range and 10Gbe enabled.\n\t[8-512 (multiple of 8)]\n\t\t[Jungfrau] Number of rows per module starting from the centre. Options: 8 - 512, must be multiples of 8. Default is 512."); + "permissible values depend on dynamic range and 10Gbe " + "enabled.\n\t[8-512 (multiple of 8)]\n\t\t[Jungfrau] Number of rows " + "per module starting from the centre. Options: 8 - 512, must be " + "multiples of 8. Default is 512."); /** temperature */ GET_COMMAND_NOID( @@ -1537,10 +1549,11 @@ class CmdProxy { "[0, 1]\n\t[Jungfrau] The udp interface to stream data from detector. " "Effective only when number of interfaces is 1. Default: 0 (outer)"); - GET_COMMAND(udp_numdst, getNumberofUDPDestinations, - "\n\t[Jungfrau][Eiger] One can enter upto 32 " - "destinations that the detector will stream images " - "out in a round robin fashion. This is get only command. Default: 1"); + GET_COMMAND( + udp_numdst, getNumberofUDPDestinations, + "\n\t[Jungfrau][Eiger] One can enter upto 32 " + "destinations that the detector will stream images " + "out in a round robin fashion. This is get only command. Default: 1"); EXECUTE_SET_COMMAND(udp_cleardst, clearUDPDestinations, "\n\tClears udp destination details on the detector."); @@ -1548,7 +1561,8 @@ class CmdProxy { INTEGER_COMMAND_VEC_ID( udp_firstdst, getFirstUDPDestination, setFirstUDPDestination, StringTo, - "[0 - 31 (or number of udp destinations)]\n\t[Jungfrau] One can set which is the first " + "[0 - 31 (or number of udp destinations)]\n\t[Jungfrau] One can set " + "which is the first " "destination that the detector will stream images " "out from in a round robin fashion. The entry must not have been " "empty. Default: 0"); @@ -1856,10 +1870,9 @@ class CmdProxy { "[(optional unit) ns|us|ms|s]\n\t[Eiger] Measured sub " "frame period between last sub frame and previous one."); - - INTEGER_COMMAND_VEC_ID( - activate, getActive, setActive, StringTo, - "[0, 1] \n\t[Eiger] 1 is default. 0 deactivates readout and does not send data."); + INTEGER_COMMAND_VEC_ID(activate, getActive, setActive, StringTo, + "[0, 1] \n\t[Eiger] 1 is default. 0 deactivates " + "readout and does not send data."); INTEGER_COMMAND_VEC_ID( partialreset, getPartialReset, setPartialReset, StringTo, @@ -1912,7 +1925,8 @@ class CmdProxy { INTEGER_COMMAND_SET_NOID_GET_ID( storagecells, getNumberOfAdditionalStorageCells, setNumberOfAdditionalStorageCells, StringTo, - "[0-15]\n\t[Jungfrau] Only for chipv1.0. Number of additional storage cells. Default is " + "[0-15]\n\t[Jungfrau] Only for chipv1.0. Number of additional storage " + "cells. Default is " "0. For advanced users only. \n\tThe #images = #frames x #triggers x " "(#storagecells + 1)."); @@ -1920,13 +1934,15 @@ class CmdProxy { storagecell_start, getStorageCellStart, setStorageCellStart, StringTo, "[0-max]\n\t[Jungfrau] Storage cell that stores the first acquisition " - "of the series. max is 15 (default) for chipv1.0 and 3 (default) for chipv1.1. For advanced users only."); + "of the series. max is 15 (default) for chipv1.0 and 3 (default) for " + "chipv1.1. For advanced users only."); TIME_COMMAND( storagecell_delay, getStorageCellDelay, setStorageCellDelay, "[duration (0-1638375 ns)] [(optional unit) ns|us|ms|s]\n\t[Jungfrau] " "Additional time delay between 2 consecutive exposures in burst mode " - "(resolution of 25ns). Only applicable for chipv1.0. For advanced users only."); + "(resolution of 25ns). Only applicable for chipv1.0. For advanced " + "users only."); INTEGER_COMMAND_VEC_ID( gainmode, getGainMode, setGainMode, @@ -1935,9 +1951,10 @@ class CmdProxy { "Jungfrau] Gain mode.\n\tCAUTION: Do not use fixg0 without caution, " "you can damage the detector!!!"); - INTEGER_COMMAND_VEC_ID( - filtercell, getFilterCell, setFilterCell, sls::StringTo, - "[0-12]\n\t[Jungfrau] Set Filter Cell. Only for chipv1.1. Advanced user Command"); + INTEGER_COMMAND_VEC_ID(filtercell, getFilterCell, setFilterCell, + sls::StringTo, + "[0-12]\n\t[Jungfrau] Set Filter Cell. Only for " + "chipv1.1. Advanced user Command"); /* Gotthard Specific */ TIME_GET_COMMAND(exptimel, getExptimeLeft, diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index ccb8e8b40..5951e6889 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "sls/Detector.h" #include "sls/detectorData.h" @@ -412,18 +414,25 @@ std::vector Detector::getTimingModeList() const { } } -Result Detector::getSpeed(Positions pos) const { - auto res = pimpl->Parallel(&Module::getClockDivider, pos, defs::RUN_CLOCK); - Result speedResult(res.size()); - for (unsigned int i = 0; i < res.size(); ++i) { - speedResult[i] = static_cast(res[i]); - } - return speedResult; +Result Detector::getReadoutSpeed(Positions pos) const { + return pimpl->Parallel(&Module::getReadoutSpeed, pos); } -void Detector::setSpeed(defs::speedLevel value, Positions pos) { - pimpl->Parallel(&Module::setClockDivider, pos, defs::RUN_CLOCK, - static_cast(value)); +void Detector::setReadoutSpeed(defs::speedLevel value, Positions pos) { + pimpl->Parallel(&Module::setReadoutSpeed, pos, value); +} + +std::vector Detector::getReadoutSpeedList() const { + switch (getDetectorType().squash()) { + case defs::EIGER: + case defs::JUNGFRAU: + return std::vector{defs::FULL_SPEED, defs::HALF_SPEED, + defs::QUARTER_SPEED}; + case defs::GOTTHARD2: + return std::vector{defs::G2_108MHZ, defs::G2_144MHZ}; + default: + throw RuntimeError("Readout speed not implemented for this detector"); + } } Result Detector::getADCPhase(Positions pos) const { @@ -657,10 +666,6 @@ void Detector::setDefaultDac(defs::dacIndex index, int defaultValue, pimpl->setDefaultDac(index, defaultValue, sett, pos); } - - - - void Detector::resetToDefaultDacs(const bool hardReset, Positions pos) { pimpl->Parallel(&Module::resetToDefaultDacs, pos, hardReset); } @@ -822,10 +827,6 @@ Result Detector::getScanErrorMessage(Positions pos) const { // Network Configuration (Detector<->Receiver) Result Detector::getNumberofUDPInterfaces(Positions pos) const { - if (getDetectorType().squash() != defs::JUNGFRAU) { - throw sls::RuntimeError( - "Cannot set number of udp interfaces for this detector."); - } // also called by vetostream (for gotthard2) return pimpl->getNumberofUDPInterfaces(pos); } @@ -1450,7 +1451,6 @@ void Detector::setActive(const bool active, Positions pos) { pimpl->Parallel(&Module::setActivate, pos, active); } - Result Detector::getPartialReset(Positions pos) const { return pimpl->Parallel(&Module::getCounterBit, pos); } @@ -1565,12 +1565,9 @@ void Detector::setStorageCellDelay(ns value, Positions pos) { std::vector Detector::getGainModeList() const { switch (getDetectorType().squash()) { case defs::JUNGFRAU: - return std::vector{defs::DYNAMIC, - defs::FORCE_SWITCH_G1, - defs::FORCE_SWITCH_G2, - defs::FIX_G1, - defs::FIX_G2, - defs::FIX_G0}; + return std::vector{ + defs::DYNAMIC, defs::FORCE_SWITCH_G1, defs::FORCE_SWITCH_G2, + defs::FIX_G1, defs::FIX_G2, defs::FIX_G0}; break; default: throw RuntimeError("Gain mode is not implemented for this detector."); @@ -1717,19 +1714,22 @@ Result Detector::getVetoStream(Positions pos) const { return res; } -void Detector::setVetoStream(defs::streamingInterface interface, Positions pos) { +void Detector::setVetoStream(defs::streamingInterface interface, + Positions pos) { // 3gbe - bool LOW_LATENCY_LINK = ((interface & defs::streamingInterface::LOW_LATENCY_LINK) == - defs::streamingInterface::LOW_LATENCY_LINK); + bool LOW_LATENCY_LINK = + ((interface & defs::streamingInterface::LOW_LATENCY_LINK) == + defs::streamingInterface::LOW_LATENCY_LINK); pimpl->Parallel(&Module::setVetoStream, pos, LOW_LATENCY_LINK); // 10gbe (debugging interface) opens 2nd udp interface in receiver int old_numinterfaces = pimpl->getNumberofUDPInterfaces(pos).tsquash( "retrieved inconsistent number of udp interfaces"); - int numinterfaces = (((interface & defs::streamingInterface::ETHERNET_10GB) == - defs::streamingInterface::ETHERNET_10GB) - ? 2 - : 1); + int numinterfaces = + (((interface & defs::streamingInterface::ETHERNET_10GB) == + defs::streamingInterface::ETHERNET_10GB) + ? 2 + : 1); if (numinterfaces != old_numinterfaces) { setNumberofUDPInterfaces_(numinterfaces, pos); } diff --git a/slsDetectorSoftware/src/DetectorImpl.cpp b/slsDetectorSoftware/src/DetectorImpl.cpp index f5a455992..f9aa1a1ab 100644 --- a/slsDetectorSoftware/src/DetectorImpl.cpp +++ b/slsDetectorSoftware/src/DetectorImpl.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "DetectorImpl.h" #include "Module.h" #include "SharedMemory.h" @@ -289,7 +291,9 @@ void DetectorImpl::updateDetectorSize() { const slsDetectorDefs::xy det_size = modules[0]->getNumberOfChannels(); if (det_size.x == 0 || det_size.y == 0) { - throw sls::RuntimeError("Module size for x or y dimensions is 0. Unable to proceed in updating detector size. "); + throw sls::RuntimeError( + "Module size for x or y dimensions is 0. Unable to proceed in " + "updating detector size. "); } int maxx = shm()->numberOfChannels.x; @@ -1092,13 +1096,13 @@ int DetectorImpl::acquire() { // start and read all try { if (detector_type == defs::MYTHEN3 && modules.size() > 1) { - //Multi module mythen + // Multi module mythen std::vector master; std::vector slaves; auto is_master = Parallel(&Module::isMaster, {}); slaves.reserve(modules.size() - 1); // check this one!! for (size_t i = 0; i < modules.size(); ++i) { - if(is_master[i]) + if (is_master[i]) master.push_back(i); else slaves.push_back(i); @@ -1106,7 +1110,7 @@ int DetectorImpl::acquire() { Parallel(&Module::startAcquisition, slaves); Parallel(&Module::startAndReadAll, master); } else { - //Normal acquire + // Normal acquire Parallel(&Module::startAndReadAll, {}); } @@ -1358,7 +1362,7 @@ std::vector DetectorImpl::readProgrammingFile(const std::string &fname) { LOG(logINFOBLUE) << "File has been converted to " << destfname; // loading dst file to memory - // FILE *fp = fopen("/tmp/SLS_DET_MCB.tzgmUT", "r"); + // FILE *fp = fopen("/tmp/SLS_DET_MCB.tzgmUT", "r"); FILE *fp = fopen(destfname, "r"); if (fp == nullptr) { throw RuntimeError("Program FPGA: Could not open rawbin file"); @@ -1382,7 +1386,7 @@ std::vector DetectorImpl::readProgrammingFile(const std::string &fname) { "Program FPGA: Could not close destination file after converting"); } - //unlink(destfname); // delete temporary file + // unlink(destfname); // delete temporary file LOG(logDEBUG1) << "Successfully loaded the rawbin file to program memory"; LOG(logDEBUG1) << "Read file into memory"; return buffer; diff --git a/slsDetectorSoftware/src/DetectorImpl.h b/slsDetectorSoftware/src/DetectorImpl.h index e312979fb..37d57d7bf 100644 --- a/slsDetectorSoftware/src/DetectorImpl.h +++ b/slsDetectorSoftware/src/DetectorImpl.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "SharedMemory.h" @@ -17,7 +19,7 @@ class detectorData; #define DETECTOR_SHMAPIVERSION 0x190809 #define DETECTOR_SHMVERSION 0x201007 -#define SHORT_STRING_LENGTH 50 +#define SHORT_STRING_LENGTH 50 #include #include diff --git a/slsDetectorSoftware/src/HelpDacs.h b/slsDetectorSoftware/src/HelpDacs.h index 93d2af134..236167838 100644 --- a/slsDetectorSoftware/src/HelpDacs.h +++ b/slsDetectorSoftware/src/HelpDacs.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "sls/string_utils.h" std::string GetHelpDac(std::string dac) { diff --git a/slsDetectorSoftware/src/Module.cpp b/slsDetectorSoftware/src/Module.cpp index f80b383a1..8717fb88f 100644 --- a/slsDetectorSoftware/src/Module.cpp +++ b/slsDetectorSoftware/src/Module.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "Module.h" #include "SharedMemory.h" #include "sls/ClientSocket.h" @@ -475,7 +477,8 @@ bool Module::getFlipRows() const { void Module::setFlipRows(bool value) { if (shm()->detType == EIGER) { const int rxIndex = -1; - sendToReceiver(rxIndex, F_SET_FLIP_ROWS_RECEIVER, static_cast(value)); + sendToReceiver(rxIndex, F_SET_FLIP_ROWS_RECEIVER, + static_cast(value)); } else { sendToDetector(F_SET_FLIP_ROWS, static_cast(value), nullptr); } @@ -505,7 +508,7 @@ void Module::setNumberOfTriggers(int64_t value) { sendToDetector(F_SET_NUM_TRIGGERS, value, nullptr); if (shm()->useReceiverFlag) { const int rxIndex = -1; - sendToReceiver(rxIndex, F_SET_RECEIVER_NUM_TRIGGERS, value, nullptr); + sendToReceiver(rxIndex, F_SET_RECEIVER_NUM_TRIGGERS, value, nullptr); } } @@ -522,7 +525,7 @@ void Module::setExptime(int gateIndex, int64_t value) { sendToDetector(F_SET_EXPTIME, args, nullptr); if (shm()->useReceiverFlag) { const int rxIndex = -1; - sendToReceiver(rxIndex, F_RECEIVER_SET_EXPTIME, args, nullptr); + sendToReceiver(rxIndex, F_RECEIVER_SET_EXPTIME, args, nullptr); } if (prevVal != value) { updateRateCorrection(); @@ -537,7 +540,7 @@ void Module::setPeriod(int64_t value) { sendToDetector(F_SET_PERIOD, value, nullptr); if (shm()->useReceiverFlag) { const int rxIndex = -1; - sendToReceiver(rxIndex, F_RECEIVER_SET_PERIOD, value, nullptr); + sendToReceiver(rxIndex, F_RECEIVER_SET_PERIOD, value, nullptr); } } @@ -586,11 +589,11 @@ void Module::setDynamicRange(int dr) { if (dr == 32) { LOG(logINFO) << "Setting Clock to Quarter Speed to cope with " "Dynamic Range of 32"; - setClockDivider(RUN_CLOCK, 2); + setReadoutSpeed(defs::QUARTER_SPEED); } else { LOG(logINFO) << "Setting Clock to Full Speed for Dynamic Range of " << dr; - setClockDivider(RUN_CLOCK, 0); + setReadoutSpeed(defs::FULL_SPEED); } // EIGER only, update speed and rate correction when dr changes if (dr != prev_val) { @@ -607,10 +610,18 @@ void Module::setTimingMode(timingMode value) { sendToDetector(F_SET_TIMING_MODE, value); if (shm()->useReceiverFlag) { const int rxIndex = -1; - sendToReceiver(rxIndex, F_SET_RECEIVER_TIMING_MODE, value, nullptr); + sendToReceiver(rxIndex, F_SET_RECEIVER_TIMING_MODE, value, nullptr); } } +slsDetectorDefs::speedLevel Module::getReadoutSpeed() const { + return sendToDetector(F_GET_READOUT_SPEED); +} + +void Module::setReadoutSpeed(speedLevel value) { + sendToDetector(F_SET_READOUT_SPEED, value, nullptr); +} + int Module::getClockDivider(int clkIndex) const { return sendToDetector(F_GET_CLOCK_DIVIDER, clkIndex); } @@ -758,14 +769,14 @@ void Module::setReadNRows(const int value) { void Module::startReceiver() { shm()->stoppedFlag = false; - const int rxIndex = -1; - sendToReceiver(rxIndex, F_START_RECEIVER); + const int rxIndex = -1; + sendToReceiver(rxIndex, F_START_RECEIVER); } void Module::stopReceiver() { - const int rxIndex = -1; - sendToReceiver(rxIndex, F_STOP_RECEIVER, static_cast(shm()->stoppedFlag), - nullptr); + const int rxIndex = -1; + sendToReceiver(rxIndex, F_STOP_RECEIVER, + static_cast(shm()->stoppedFlag), nullptr); } void Module::startAcquisition() { @@ -803,8 +814,8 @@ void Module::stopAcquisition() { } void Module::restreamStopFromReceiver() { - const int rxIndex = -1; - sendToReceiver(rxIndex, F_RESTREAM_STOP_FROM_RECEIVER); + const int rxIndex = -1; + sendToReceiver(rxIndex, F_RESTREAM_STOP_FROM_RECEIVER); } void Module::startAndReadAll() { @@ -817,17 +828,17 @@ slsDetectorDefs::runStatus Module::getRunStatus() const { } slsDetectorDefs::runStatus Module::getReceiverStatus() const { - const int rxIndex = -1; + const int rxIndex = -1; return sendToReceiver(rxIndex, F_GET_RECEIVER_STATUS); } double Module::getReceiverProgress() const { - const int rxIndex = -1; + const int rxIndex = -1; return sendToReceiver(rxIndex, F_GET_RECEIVER_PROGRESS); } int64_t Module::getFramesCaughtByReceiver() const { - const int rxIndex = -1; + const int rxIndex = -1; return sendToReceiver(rxIndex, F_GET_RECEIVER_FRAMES_CAUGHT); } @@ -836,7 +847,8 @@ std::vector Module::getNumMissingPackets() const { LOG(logDEBUG1) << "Getting num missing packets"; if (shm()->useReceiverFlag) { const int rxIndex = 0; - auto client = ReceiverSocket(shm()->receivers[rxIndex].hostname, shm()->receivers[rxIndex].tcpPort); + auto client = ReceiverSocket(shm()->receivers[rxIndex].hostname, + shm()->receivers[rxIndex].tcpPort); client.Send(F_GET_NUM_MISSING_PACKETS); if (client.Receive() == FAIL) { throw ReceiverError( @@ -847,7 +859,7 @@ std::vector Module::getNumMissingPackets() const { std::vector retval(nports); client.Receive(retval); LOG(logDEBUG1) << "Missing packets of Receiver" << moduleIndex - << ": " << sls::ToString(retval); + << ": " << sls::ToString(retval); return retval; } } @@ -874,7 +886,7 @@ void Module::setScan(const defs::scanParameters t) { auto retval = sendToDetector(F_SET_SCAN, t); if (shm()->useReceiverFlag) { const int rxIndex = -1; - sendToReceiver(rxIndex, F_SET_RECEIVER_SCAN, t, nullptr); + sendToReceiver(rxIndex, F_SET_RECEIVER_SCAN, t, nullptr); } // if disabled, retval is 1, else its number of steps setNumberOfFrames(retval); @@ -902,7 +914,7 @@ void Module::setNumberofUDPInterfaces(int n) { shm()->numUDPInterfaces = n; if (shm()->useReceiverFlag) { const int rxIndex = -1; - sendToReceiver(rxIndex, F_SET_RECEIVER_NUM_INTERFACES, n, nullptr); + sendToReceiver(rxIndex, F_SET_RECEIVER_NUM_INTERFACES, n, nullptr); } } @@ -1024,7 +1036,7 @@ void Module::setDestinationUDPIP(const IpAddr ip, const int rxIndex) { } if (shm()->useReceiverFlag) { sls::MacAddr retval(0LU); - sendToReceiver(rxIndex, F_SET_RECEIVER_UDP_IP, ip, retval); + sendToReceiver(rxIndex, F_SET_RECEIVER_UDP_IP, ip, retval); LOG(logINFO) << "Setting destination udp mac of Module [" << moduleIndex << ", " << rxIndex << "] to " << retval; if (rxIndex == 0) { @@ -1061,7 +1073,7 @@ void Module::setDestinationUDPIP2(const IpAddr ip, const int rxIndex) { if (shm()->useReceiverFlag) { sls::MacAddr retval(0LU); - sendToReceiver(rxIndex, F_SET_RECEIVER_UDP_IP2, ip, retval); + sendToReceiver(rxIndex, F_SET_RECEIVER_UDP_IP2, ip, retval); LOG(logINFO) << "Setting destination udp mac2 of Module " << moduleIndex << " to " << retval; if (rxIndex == 0) { @@ -1096,7 +1108,7 @@ void Module::setDestinationUDPMAC(const MacAddr mac, const int rxIndex) { } sls::MacAddr Module::getDestinationUDPMAC2(const int rxIndex) const { - if (rxIndex == 0) { + if (rxIndex == 0) { return sendToDetector(F_GET_DEST_UDP_MAC2); } auto t = getDestinationUDPList(rxIndex); @@ -1117,7 +1129,7 @@ void Module::setDestinationUDPMAC2(const MacAddr mac, const int rxIndex) { } int Module::getDestinationUDPPort(const int rxIndex) const { - if (rxIndex == 0) { + if (rxIndex == 0) { return sendToDetector(F_GET_DEST_UDP_PORT); } auto t = getDestinationUDPList(rxIndex); @@ -1133,12 +1145,12 @@ void Module::setDestinationUDPPort(const int port, const int rxIndex) { setDestinationUDPList(t); } if (shm()->useReceiverFlag) { - sendToReceiver(rxIndex, F_SET_RECEIVER_UDP_PORT, port, nullptr); + sendToReceiver(rxIndex, F_SET_RECEIVER_UDP_PORT, port, nullptr); } } int Module::getDestinationUDPPort2(const int rxIndex) const { - if (rxIndex == 0) { + if (rxIndex == 0) { return sendToDetector(F_GET_DEST_UDP_PORT2); } auto t = getDestinationUDPList(rxIndex); @@ -1154,7 +1166,7 @@ void Module::setDestinationUDPPort2(const int port, const int rxIndex) { setDestinationUDPList(t); } if (shm()->useReceiverFlag) { - sendToReceiver(rxIndex, F_SET_RECEIVER_UDP_PORT2, port, nullptr); + sendToReceiver(rxIndex, F_SET_RECEIVER_UDP_PORT2, port, nullptr); } } @@ -1166,15 +1178,15 @@ void Module::validateUDPConfiguration() { std::string Module::printReceiverConfiguration(const int rxIndex) { std::ostringstream os; - os << "\n\nModule " << moduleIndex << "\nReceiver [" << rxIndex << "] Hostname:\t" - << getReceiverHostname(rxIndex); + os << "\n\nModule " << moduleIndex << "\nReceiver [" << rxIndex + << "] Hostname:\t" << getReceiverHostname(rxIndex); if (shm()->detType == JUNGFRAU) { os << "\nNumber of Interfaces:\t" << getNumberofUDPInterfaces() << "\nSelected Interface:\t" << getSelectedUDPInterface(); } auto t = getDestinationUDPList(rxIndex); - + os << "\nSource UDP IP:\t" << getSourceUDPIP() << "\nSource UDP MAC:\t" << getSourceUDPMAC() << "\nDestination UDP IP:\t" << t.ip << "\nDestination UDP MAC:\t" << t.mac; @@ -1182,8 +1194,8 @@ std::string Module::printReceiverConfiguration(const int rxIndex) { if (shm()->detType == JUNGFRAU) { os << "\nSource UDP IP2:\t" << getSourceUDPIP2() << "\nSource UDP MAC2:\t" << getSourceUDPMAC2() - << "\nDestination UDP IP2:\t" << t.ip2 - << "\nDestination UDP MAC2:\t" << t.mac2; + << "\nDestination UDP IP2:\t" << t.ip2 << "\nDestination UDP MAC2:\t" + << t.mac2; } os << "\nDestination UDP Port:\t" << t.port; if (shm()->detType == JUNGFRAU || shm()->detType == EIGER) { @@ -1249,7 +1261,8 @@ std::string Module::getReceiverHostname(const int rxIndex) const { return std::string(shm()->receivers[rxIndex].hostname); } -void Module::setReceiverHostname(const std::string &receiverIP, const int rxIndex) { +void Module::setReceiverHostname(const std::string &receiverIP, + const int rxIndex) { LOG(logDEBUG1) << "Setting up Receiver with " << receiverIP; if (receiverIP == "none") { @@ -1287,7 +1300,7 @@ void Module::setReceiverHostname(const std::string &receiverIP, const int rxInde strcpy_safe(retval.hostname, shm()->hostname); sls::MacAddr retvals[2]; - sendToReceiver(rxIndex, F_SETUP_RECEIVER, retval, retvals); + sendToReceiver(rxIndex, F_SETUP_RECEIVER, retval, retvals); // update Modules with dest mac if (retval.udp_dstmac == 0 && retvals[0] != 0) { LOG(logINFO) << "Setting destination udp mac of " @@ -1308,7 +1321,9 @@ void Module::setReceiverHostname(const std::string &receiverIP, const int rxInde updateReceiverStreamingIP(rxIndex); } -int Module::getReceiverPort(const int rxIndex) const { return shm()->receivers[rxIndex].tcpPort; } +int Module::getReceiverPort(const int rxIndex) const { + return shm()->receivers[rxIndex].tcpPort; +} int Module::setReceiverPort(int port_number, const int rxIndex) { if (port_number >= 0 && port_number != shm()->receivers[rxIndex].tcpPort) { @@ -1334,19 +1349,21 @@ bool Module::getReceiverSilentMode() const { void Module::setReceiverSilentMode(bool enable) { const int rxIndex = -1; - sendToReceiver(rxIndex, F_SET_RECEIVER_SILENT_MODE, static_cast(enable), - nullptr); + sendToReceiver(rxIndex, F_SET_RECEIVER_SILENT_MODE, + static_cast(enable), nullptr); } slsDetectorDefs::frameDiscardPolicy Module::getReceiverFramesDiscardPolicy() const { const int rxIndex = 0; - return sendToReceiver(rxIndex, F_GET_RECEIVER_DISCARD_POLICY); + return sendToReceiver(rxIndex, + F_GET_RECEIVER_DISCARD_POLICY); } void Module::setReceiverFramesDiscardPolicy(frameDiscardPolicy f) { const int rxIndex = -1; - sendToReceiver(rxIndex, F_SET_RECEIVER_DISCARD_POLICY, static_cast(f), nullptr); + sendToReceiver(rxIndex, F_SET_RECEIVER_DISCARD_POLICY, static_cast(f), + nullptr); } bool Module::getPartialFramesPadding() const { @@ -1356,7 +1373,8 @@ bool Module::getPartialFramesPadding() const { void Module::setPartialFramesPadding(bool padding) { const int rxIndex = -1; - sendToReceiver(rxIndex, F_SET_RECEIVER_PADDING, static_cast(padding), nullptr); + sendToReceiver(rxIndex, F_SET_RECEIVER_PADDING, static_cast(padding), + nullptr); } int Module::getReceiverUDPSocketBufferSize() const { @@ -1392,8 +1410,8 @@ sls::IpAddr Module::getReceiverLastClientIP() const { std::array Module::getReceiverThreadIds() const { const int rxIndex = 0; - return sendToReceiver>(rxIndex, - F_GET_RECEIVER_THREAD_IDS); + return sendToReceiver>( + rxIndex, F_GET_RECEIVER_THREAD_IDS); } // File @@ -1404,13 +1422,13 @@ slsDetectorDefs::fileFormat Module::getFileFormat() const { void Module::setFileFormat(fileFormat f) { const int rxIndex = -1; - sendToReceiver(rxIndex, F_SET_RECEIVER_FILE_FORMAT, f, nullptr); + sendToReceiver(rxIndex, F_SET_RECEIVER_FILE_FORMAT, f, nullptr); } std::string Module::getFilePath() const { char ret[MAX_STR_LENGTH]{}; const int rxIndex = 0; - sendToReceiver(rxIndex, F_GET_RECEIVER_FILE_PATH, nullptr, ret); + sendToReceiver(rxIndex, F_GET_RECEIVER_FILE_PATH, nullptr, ret); return ret; } @@ -1421,13 +1439,13 @@ void Module::setFilePath(const std::string &path) { char args[MAX_STR_LENGTH]{}; sls::strcpy_safe(args, path.c_str()); const int rxIndex = -1; - sendToReceiver(rxIndex, F_SET_RECEIVER_FILE_PATH, args, nullptr); + sendToReceiver(rxIndex, F_SET_RECEIVER_FILE_PATH, args, nullptr); } std::string Module::getFileName() const { char buff[MAX_STR_LENGTH]{}; const int rxIndex = 0; - sendToReceiver(rxIndex, F_GET_RECEIVER_FILE_NAME, nullptr, buff); + sendToReceiver(rxIndex, F_GET_RECEIVER_FILE_NAME, nullptr, buff); return buff; } @@ -1438,7 +1456,7 @@ void Module::setFileName(const std::string &fname) { char args[MAX_STR_LENGTH]{}; sls::strcpy_safe(args, fname.c_str()); const int rxIndex = -1; - sendToReceiver(rxIndex, F_SET_RECEIVER_FILE_NAME, args, nullptr); + sendToReceiver(rxIndex, F_SET_RECEIVER_FILE_NAME, args, nullptr); } int64_t Module::getFileIndex() const { @@ -1448,12 +1466,12 @@ int64_t Module::getFileIndex() const { void Module::setFileIndex(int64_t file_index) { const int rxIndex = -1; - sendToReceiver(rxIndex, F_SET_RECEIVER_FILE_INDEX, file_index, nullptr); + sendToReceiver(rxIndex, F_SET_RECEIVER_FILE_INDEX, file_index, nullptr); } -void Module::incrementFileIndex() { +void Module::incrementFileIndex() { const int rxIndex = -1; - sendToReceiver(rxIndex, F_INCREMENT_FILE_INDEX); + sendToReceiver(rxIndex, F_INCREMENT_FILE_INDEX); } bool Module::getFileWrite() const { @@ -1463,7 +1481,8 @@ bool Module::getFileWrite() const { void Module::setFileWrite(bool value) { const int rxIndex = -1; - sendToReceiver(rxIndex, F_SET_RECEIVER_FILE_WRITE, static_cast(value), nullptr); + sendToReceiver(rxIndex, F_SET_RECEIVER_FILE_WRITE, static_cast(value), + nullptr); } bool Module::getMasterFileWrite() const { @@ -1473,8 +1492,8 @@ bool Module::getMasterFileWrite() const { void Module::setMasterFileWrite(bool value) { const int rxIndex = -1; - sendToReceiver(rxIndex, F_SET_RECEIVER_MASTER_FILE_WRITE, static_cast(value), - nullptr); + sendToReceiver(rxIndex, F_SET_RECEIVER_MASTER_FILE_WRITE, + static_cast(value), nullptr); } bool Module::getFileOverWrite() const { @@ -1484,7 +1503,8 @@ bool Module::getFileOverWrite() const { void Module::setFileOverWrite(bool value) { const int rxIndex = -1; - sendToReceiver(rxIndex, F_SET_RECEIVER_OVERWRITE, static_cast(value), nullptr); + sendToReceiver(rxIndex, F_SET_RECEIVER_OVERWRITE, static_cast(value), + nullptr); } int Module::getFramesPerFile() const { @@ -1494,7 +1514,7 @@ int Module::getFramesPerFile() const { void Module::setFramesPerFile(int n_frames) { const int rxIndex = -1; - sendToReceiver(rxIndex, F_SET_RECEIVER_FRAMES_PER_FILE, n_frames, nullptr); + sendToReceiver(rxIndex, F_SET_RECEIVER_FRAMES_PER_FILE, n_frames, nullptr); } // ZMQ Streaming Parameters (Receiver<->Client) @@ -1506,7 +1526,8 @@ bool Module::getReceiverStreaming() const { void Module::setReceiverStreaming(bool enable) { const int rxIndex = -1; - sendToReceiver(rxIndex, F_SET_RECEIVER_STREAMING, static_cast(enable), nullptr); + sendToReceiver(rxIndex, F_SET_RECEIVER_STREAMING, static_cast(enable), + nullptr); } int Module::getReceiverStreamingFrequency() const { @@ -1520,7 +1541,7 @@ void Module::setReceiverStreamingFrequency(int freq) { std::to_string(freq)); } const int rxIndex = -1; - sendToReceiver(rxIndex, F_SET_RECEIVER_STREAMING_FREQUENCY, freq, nullptr); + sendToReceiver(rxIndex, F_SET_RECEIVER_STREAMING_FREQUENCY, freq, nullptr); } int Module::getReceiverStreamingTimer() const { @@ -1544,7 +1565,7 @@ void Module::setReceiverStreamingStartingFrame(int fnum) { std::to_string(fnum)); } const int rxIndex = -1; - sendToReceiver(rxIndex, F_SET_RECEIVER_STREAMING_START_FNUM, fnum, nullptr); + sendToReceiver(rxIndex, F_SET_RECEIVER_STREAMING_START_FNUM, fnum, nullptr); } int Module::getReceiverStreamingPort() const { @@ -1554,12 +1575,13 @@ int Module::getReceiverStreamingPort() const { void Module::setReceiverStreamingPort(int port) { const int rxIndex = -1; - sendToReceiver(rxIndex, F_SET_RECEIVER_STREAMING_PORT, port, nullptr); + sendToReceiver(rxIndex, F_SET_RECEIVER_STREAMING_PORT, port, nullptr); } sls::IpAddr Module::getReceiverStreamingIP() const { const int rxIndex = 0; - return sendToReceiver(rxIndex, F_GET_RECEIVER_STREAMING_SRC_IP); + return sendToReceiver(rxIndex, + F_GET_RECEIVER_STREAMING_SRC_IP); } void Module::setReceiverStreamingIP(const sls::IpAddr ip, const int rxIndex) { @@ -1593,7 +1615,7 @@ int Module::getReceiverStreamingHwm() const { void Module::setReceiverStreamingHwm(const int limit) { const int rxIndex = -1; - sendToReceiver(rxIndex, F_SET_RECEIVER_STREAMING_HWM, limit, nullptr); + sendToReceiver(rxIndex, F_SET_RECEIVER_STREAMING_HWM, limit, nullptr); } // Eiger Specific @@ -1609,8 +1631,8 @@ void Module::setSubExptime(int64_t value) { } sendToDetector(F_SET_SUB_EXPTIME, value, nullptr); if (shm()->useReceiverFlag) { - const int rxIndex = -1; - sendToReceiver(rxIndex, F_RECEIVER_SET_SUB_EXPTIME, value, nullptr); + const int rxIndex = -1; + sendToReceiver(rxIndex, F_RECEIVER_SET_SUB_EXPTIME, value, nullptr); } if (prevVal != value) { updateRateCorrection(); @@ -1624,8 +1646,8 @@ int64_t Module::getSubDeadTime() const { void Module::setSubDeadTime(int64_t value) { sendToDetector(F_SET_SUB_DEADTIME, value, nullptr); if (shm()->useReceiverFlag) { - const int rxIndex = -1; - sendToReceiver(rxIndex, F_RECEIVER_SET_SUB_DEADTIME, value, nullptr); + const int rxIndex = -1; + sendToReceiver(rxIndex, F_RECEIVER_SET_SUB_DEADTIME, value, nullptr); } } @@ -1654,7 +1676,8 @@ void Module::sendReceiverRateCorrections(const std::vector &t) { LOG(logDEBUG) << "Sending to receiver 0 [rate corrections: " << ToString(t) << ']'; // only to master receiver - auto client = ReceiverSocket(shm()->receivers[0].hostname, shm()->receivers[0].tcpPort); + auto client = ReceiverSocket(shm()->receivers[0].hostname, + shm()->receivers[0].tcpPort); client.Send(F_SET_RECEIVER_RATE_CORRECT); client.Send(static_cast(t.size())); client.Send(t); @@ -1697,8 +1720,8 @@ void Module::setActivate(const bool enable) { auto retval = sendToDetector(F_ACTIVATE, arg); sendToDetectorStop(F_ACTIVATE, arg); if (shm()->useReceiverFlag) { - const int rxIndex = -1; - sendToReceiver(rxIndex, F_RECEIVER_ACTIVATE, retval, nullptr); + const int rxIndex = -1; + sendToReceiver(rxIndex, F_RECEIVER_ACTIVATE, retval, nullptr); } } @@ -1731,8 +1754,8 @@ void Module::setQuad(const bool enable) { int value = enable ? 1 : 0; sendToDetector(F_SET_QUAD, value, nullptr); if (shm()->useReceiverFlag) { - const int rxIndex = -1; - sendToReceiver(rxIndex, F_SET_RECEIVER_QUAD, value, nullptr); + const int rxIndex = -1; + sendToReceiver(rxIndex, F_SET_RECEIVER_QUAD, value, nullptr); } } @@ -1744,8 +1767,8 @@ void Module::setDataStream(const portPosition port, const bool enable) { int args[]{static_cast(port), static_cast(enable)}; sendToDetector(F_SET_DATASTREAM, args, nullptr); if (shm()->useReceiverFlag) { - const int rxIndex = -1; - sendToReceiver(rxIndex, F_RECEIVER_SET_DATASTREAM, args, nullptr); + const int rxIndex = -1; + sendToReceiver(rxIndex, F_RECEIVER_SET_DATASTREAM, args, nullptr); } } @@ -1853,8 +1876,8 @@ void Module::setROI(slsDetectorDefs::ROI arg) { } sendToDetector(F_SET_ROI, arg, nullptr); if (shm()->useReceiverFlag) { - const int rxIndex = -1; - sendToReceiver(rxIndex, F_RECEIVER_SET_ROI, arg, nullptr); + const int rxIndex = -1; + sendToReceiver(rxIndex, F_RECEIVER_SET_ROI, arg, nullptr); } } @@ -1873,8 +1896,8 @@ int64_t Module::getNumberOfBursts() const { void Module::setNumberOfBursts(int64_t value) { sendToDetector(F_SET_NUM_BURSTS, value, nullptr); if (shm()->useReceiverFlag) { - const int rxIndex = -1; - sendToReceiver(rxIndex, F_SET_RECEIVER_NUM_BURSTS, value, nullptr); + const int rxIndex = -1; + sendToReceiver(rxIndex, F_SET_RECEIVER_NUM_BURSTS, value, nullptr); } } @@ -2106,8 +2129,8 @@ slsDetectorDefs::burstMode Module::getBurstMode() const { void Module::setBurstMode(slsDetectorDefs::burstMode value) { sendToDetector(F_SET_BURST_MODE, value, nullptr); if (shm()->useReceiverFlag) { - const int rxIndex = -1; - sendToReceiver(rxIndex, F_SET_RECEIVER_BURST_MODE, value, nullptr); + const int rxIndex = -1; + sendToReceiver(rxIndex, F_SET_RECEIVER_BURST_MODE, value, nullptr); } } @@ -2241,8 +2264,9 @@ void Module::setCounterMask(uint32_t countermask) { sendToDetector(F_SET_COUNTER_MASK, countermask, nullptr); if (shm()->useReceiverFlag) { LOG(logDEBUG1) << "Sending Reciver counter mask: " << countermask; - const int rxIndex = -1; - sendToReceiver(rxIndex, F_RECEIVER_SET_COUNTER_MASK, countermask, nullptr); + const int rxIndex = -1; + sendToReceiver(rxIndex, F_RECEIVER_SET_COUNTER_MASK, countermask, + nullptr); } } @@ -2253,8 +2277,8 @@ int Module::getNumberOfGates() const { void Module::setNumberOfGates(int value) { sendToDetector(F_SET_NUM_GATES, value, nullptr); if (shm()->useReceiverFlag) { - const int rxIndex = -1; - sendToReceiver(rxIndex, F_SET_RECEIVER_NUM_GATES, value, nullptr); + const int rxIndex = -1; + sendToReceiver(rxIndex, F_SET_RECEIVER_NUM_GATES, value, nullptr); } } @@ -2270,8 +2294,8 @@ void Module::setGateDelay(int gateIndex, int64_t value) { int64_t args[]{static_cast(gateIndex), value}; sendToDetector(F_SET_GATE_DELAY, args, nullptr); if (shm()->useReceiverFlag) { - const int rxIndex = -1; - sendToReceiver(rxIndex, F_SET_RECEIVER_GATE_DELAY, args, nullptr); + const int rxIndex = -1; + sendToReceiver(rxIndex, F_SET_RECEIVER_GATE_DELAY, args, nullptr); } } @@ -2301,8 +2325,9 @@ void Module::setNumberOfAnalogSamples(int value) { // update #nchan, as it depends on #samples, adcmask updateNumberOfChannels(); if (shm()->useReceiverFlag) { - const int rxIndex = -1; - sendToReceiver(rxIndex, F_RECEIVER_SET_NUM_ANALOG_SAMPLES, value, nullptr); + const int rxIndex = -1; + sendToReceiver(rxIndex, F_RECEIVER_SET_NUM_ANALOG_SAMPLES, value, + nullptr); } } @@ -2324,7 +2349,7 @@ void Module::setADCEnableMask(uint32_t mask) { updateNumberOfChannels(); if (shm()->useReceiverFlag) { - const int rxIndex = -1; + const int rxIndex = -1; sendToReceiver(rxIndex, F_RECEIVER_SET_ADC_MASK, mask); } } @@ -2338,7 +2363,7 @@ void Module::setTenGigaADCEnableMask(uint32_t mask) { updateNumberOfChannels(); // depends on samples and adcmask if (shm()->useReceiverFlag) { - const int rxIndex = -1; + const int rxIndex = -1; sendToReceiver(rxIndex, F_RECEIVER_SET_ADC_MASK_10G, mask); } } @@ -2356,8 +2381,9 @@ void Module::setNumberOfDigitalSamples(int value) { if (shm()->useReceiverFlag) { LOG(logDEBUG1) << "Sending number of digital samples to Receiver: " << value; - const int rxIndex = -1; - sendToReceiver(rxIndex, F_RECEIVER_SET_NUM_DIGITAL_SAMPLES, value, nullptr); + const int rxIndex = -1; + sendToReceiver(rxIndex, F_RECEIVER_SET_NUM_DIGITAL_SAMPLES, value, + nullptr); } } @@ -2373,8 +2399,8 @@ void Module::setReadoutMode(const slsDetectorDefs::readoutMode mode) { updateNumberOfChannels(); } if (shm()->useReceiverFlag) { - const int rxIndex = -1; - sendToReceiver(rxIndex, F_RECEIVER_SET_READOUT_MODE, mode, nullptr); + const int rxIndex = -1; + sendToReceiver(rxIndex, F_RECEIVER_SET_READOUT_MODE, mode, nullptr); } } @@ -2396,8 +2422,8 @@ void Module::setExternalSampling(bool value) { std::vector Module::getReceiverDbitList() const { const int rxIndex = 0; - return sendToReceiver>(rxIndex, - F_GET_RECEIVER_DBIT_LIST); + return sendToReceiver>( + rxIndex, F_GET_RECEIVER_DBIT_LIST); } void Module::setReceiverDbitList(std::vector list) { @@ -2417,7 +2443,7 @@ void Module::setReceiverDbitList(std::vector list) { sls::StaticVector arg = list; const int rxIndex = -1; - sendToReceiver(rxIndex, F_SET_RECEIVER_DBIT_LIST, arg, nullptr); + sendToReceiver(rxIndex, F_SET_RECEIVER_DBIT_LIST, arg, nullptr); } int Module::getReceiverDbitOffset() const { @@ -2427,7 +2453,7 @@ int Module::getReceiverDbitOffset() const { void Module::setReceiverDbitOffset(int value) { const int rxIndex = -1; - sendToReceiver(rxIndex, F_SET_RECEIVER_DBIT_OFFSET, value, nullptr); + sendToReceiver(rxIndex, F_SET_RECEIVER_DBIT_OFFSET, value, nullptr); } void Module::setDigitalIODelay(uint64_t pinMask, int delay) { @@ -2549,11 +2575,12 @@ std::map Module::getAdditionalJsonHeader() const { "(zmq json header)"); } const int rxIndex = 0; - auto client = ReceiverSocket(shm()->receivers[rxIndex].hostname, shm()->receivers[rxIndex].tcpPort); + auto client = ReceiverSocket(shm()->receivers[rxIndex].hostname, + shm()->receivers[rxIndex].tcpPort); client.Send(F_GET_ADDITIONAL_JSON_HEADER); if (client.Receive() == FAIL) { throw ReceiverError("Receiver " + std::to_string(moduleIndex) + - " returned error: " + client.readErrorMessage()); + " returned error: " + client.readErrorMessage()); } else { auto size = client.Receive(); std::string buff(size, '\0'); @@ -2595,7 +2622,8 @@ void Module::setAdditionalJsonHeader( LOG(logDEBUG) << "Sending to receiver additional json header " << ToString(jsonHeader); const int rxIndex = -1; - auto client = ReceiverSocket(shm()->receivers[rxIndex].hostname, shm()->receivers[rxIndex].tcpPort); + auto client = ReceiverSocket(shm()->receivers[rxIndex].hostname, + shm()->receivers[rxIndex].tcpPort); client.Send(F_SET_ADDITIONAL_JSON_HEADER); client.Send(size); if (size > 0) @@ -2603,7 +2631,7 @@ void Module::setAdditionalJsonHeader( if (client.Receive() == FAIL) { throw RuntimeError("Receiver " + std::to_string(moduleIndex) + - " returned error: " + client.readErrorMessage()); + " returned error: " + client.readErrorMessage()); } } @@ -2612,7 +2640,7 @@ std::string Module::getAdditionalJsonParameter(const std::string &key) const { sls::strcpy_safe(arg, key.c_str()); char retval[SHORT_STR_LENGTH]{}; const int rxIndex = 0; - sendToReceiver(rxIndex, F_GET_ADDITIONAL_JSON_PARAMETER, arg, retval); + sendToReceiver(rxIndex, F_GET_ADDITIONAL_JSON_PARAMETER, arg, retval); return retval; } @@ -2629,7 +2657,7 @@ void Module::setAdditionalJsonParameter(const std::string &key, sls::strcpy_safe(args[0], key.c_str()); sls::strcpy_safe(args[1], value.c_str()); const int rxIndex = -1; - sendToReceiver(rxIndex, F_SET_ADDITIONAL_JSON_PARAMETER, args, nullptr); + sendToReceiver(rxIndex, F_SET_ADDITIONAL_JSON_PARAMETER, args, nullptr); } // Advanced @@ -2658,7 +2686,18 @@ void Module::copyDetectorServer(const std::string &fname, sls::strcpy_safe(args[1], hostname.c_str()); LOG(logINFO) << "Sending detector server " << args[0] << " from host " << args[1]; - sendToDetector(F_COPY_DET_SERVER, args, nullptr); + auto client = DetectorSocket(shm()->hostname, shm()->controlPort); + client.Send(F_COPY_DET_SERVER); + client.Send(args); + if (client.Receive() == FAIL) { + std::cout << '\n'; + std::ostringstream os; + os << "Module " << moduleIndex << " (" << shm()->hostname << ")" + << " returned error: " << client.readErrorMessage(); + throw RuntimeError(os.str()); + } + LOG(logINFO) << "Module " << moduleIndex << " (" << shm()->hostname + << "): detector server copied"; } void Module::rebootController() { @@ -2727,9 +2766,7 @@ void Module::setControlPort(int port_number) { int Module::getStopPort() const { return shm()->stopPort; } -void Module::setStopPort(int port_number) { - shm()->stopPort = port_number; -} +void Module::setStopPort(int port_number) { shm()->stopPort = port_number; } bool Module::getLockDetector() const { return sendToDetector(F_LOCK_SERVER, GET_FLAG); @@ -3023,8 +3060,9 @@ Ret Module::sendToDetectorStop(int fnum, const Arg &args) { //-------------------------------------------------------------- sendToReceiver -void Module::sendToReceiver(const int rxIndex, int fnum, const void *args, size_t args_size, - void *retval, size_t retval_size) const { +void Module::sendToReceiver(const int rxIndex, int fnum, const void *args, + size_t args_size, void *retval, + size_t retval_size) const { // This is the only function that actually sends data to the receiver // the other versions use templates to deduce sizes and create // the return type @@ -3036,7 +3074,8 @@ void Module::sendToReceiver(const int rxIndex, int fnum, const void *args, size_ } checkArgs(args, args_size, retval, retval_size); if (rxIndex >= MAX_UDP_DESTINATION) { - throw RuntimeError("Invalid destination index " + std::to_string(rxIndex)); + throw RuntimeError("Invalid destination index " + + std::to_string(rxIndex)); } int startReceiver = 0; int endReceiver = MAX_UDP_DESTINATION; @@ -3051,26 +3090,30 @@ void Module::sendToReceiver(const int rxIndex, int fnum, const void *args, size_ LOG(logDEBUG1) << "Receiver [" << shm()->receivers[i].hostname << ", " << shm()->receivers[i].tcpPort << ']'; try { - auto receiver = ReceiverSocket(shm()->receivers[i].hostname, shm()->receivers[i].tcpPort); + auto receiver = ReceiverSocket(shm()->receivers[i].hostname, + shm()->receivers[i].tcpPort); receiver.sendCommandThenRead(fnum, args, args_size, retval, - retval_size); + retval_size); receiver.close(); - } catch (ReceiverError& e) { + } catch (ReceiverError &e) { std::ostringstream oss; - oss << e.what() << '[' << shm()->receivers[i].hostname << ", " << shm()->receivers[i].tcpPort << ']'; - throw ReceiverError (oss.str()); + oss << e.what() << '[' << shm()->receivers[i].hostname << ", " + << shm()->receivers[i].tcpPort << ']'; + throw ReceiverError(oss.str()); } } } -void Module::sendToReceiver(const int rxIndex, int fnum, const void *args, size_t args_size, - void *retval, size_t retval_size) { - static_cast(*this).sendToReceiver(rxIndex, fnum, args, args_size, - retval, retval_size); +void Module::sendToReceiver(const int rxIndex, int fnum, const void *args, + size_t args_size, void *retval, + size_t retval_size) { + static_cast(*this).sendToReceiver( + rxIndex, fnum, args, args_size, retval, retval_size); } template -void Module::sendToReceiver(const int rxIndex, int fnum, const Arg &args, Ret &retval) const { +void Module::sendToReceiver(const int rxIndex, int fnum, const Arg &args, + Ret &retval) const { LOG(logDEBUG1) << "Sending to Receiver " << rxIndex << ": [" << getFunctionNameFromEnum(static_cast(fnum)) << ", " << args << ", " << sizeof(args) << ", " @@ -3082,12 +3125,15 @@ void Module::sendToReceiver(const int rxIndex, int fnum, const Arg &args, Ret &r } template -void Module::sendToReceiver(const int rxIndex, int fnum, const Arg &args, Ret &retval) { - static_cast(*this).sendToReceiver(rxIndex, fnum, args, retval); +void Module::sendToReceiver(const int rxIndex, int fnum, const Arg &args, + Ret &retval) { + static_cast(*this).sendToReceiver(rxIndex, fnum, args, + retval); } template -void Module::sendToReceiver(const int rxIndex, int fnum, const Arg &args, std::nullptr_t) const { +void Module::sendToReceiver(const int rxIndex, int fnum, const Arg &args, + std::nullptr_t) const { LOG(logDEBUG1) << "Sending to Receiver " << rxIndex << ": [" << getFunctionNameFromEnum(static_cast(fnum)) << ", " << typeid(Arg).name() << ", " << sizeof(Arg) @@ -3097,12 +3143,15 @@ void Module::sendToReceiver(const int rxIndex, int fnum, const Arg &args, std::n } template -void Module::sendToReceiver(const int rxIndex, int fnum, const Arg &args, std::nullptr_t) { - static_cast(*this).sendToReceiver(rxIndex, fnum, args, nullptr); +void Module::sendToReceiver(const int rxIndex, int fnum, const Arg &args, + std::nullptr_t) { + static_cast(*this).sendToReceiver(rxIndex, fnum, args, + nullptr); } template -void Module::sendToReceiver(const int rxIndex, int fnum, std::nullptr_t, Ret &retval) const { +void Module::sendToReceiver(const int rxIndex, int fnum, std::nullptr_t, + Ret &retval) const { LOG(logDEBUG1) << "Sending to Receiver " << rxIndex << ": [" << getFunctionNameFromEnum(static_cast(fnum)) << ", nullptr, 0, " << typeid(Ret).name() << ", " @@ -3113,11 +3162,14 @@ void Module::sendToReceiver(const int rxIndex, int fnum, std::nullptr_t, Ret &re } template -void Module::sendToReceiver(const int rxIndex, int fnum, std::nullptr_t, Ret &retval) { - static_cast(*this).sendToReceiver(rxIndex, fnum, nullptr, retval); +void Module::sendToReceiver(const int rxIndex, int fnum, std::nullptr_t, + Ret &retval) { + static_cast(*this).sendToReceiver(rxIndex, fnum, nullptr, + retval); } -template Ret Module::sendToReceiver(const int rxIndex, int fnum) const { +template +Ret Module::sendToReceiver(const int rxIndex, int fnum) const { LOG(logDEBUG1) << "Sending to Receiver " << rxIndex << ": [" << getFunctionNameFromEnum(static_cast(fnum)) << ", nullptr, 0, " << typeid(Ret).name() << ", " @@ -3129,8 +3181,10 @@ template Ret Module::sendToReceiver(const int rxIndex, int fnum) return retval; } -template Ret Module::sendToReceiver(const int rxIndex, int fnum) { - return static_cast(*this).sendToReceiver(rxIndex, fnum); +template +Ret Module::sendToReceiver(const int rxIndex, int fnum) { + return static_cast(*this).sendToReceiver(rxIndex, + fnum); } void Module::sendToReceiver(const int rxIndex, int fnum) const { @@ -3160,7 +3214,8 @@ Ret Module::sendToReceiver(const int rxIndex, int fnum, const Arg &args) const { template Ret Module::sendToReceiver(const int rxIndex, int fnum, const Arg &args) { - return static_cast(*this).sendToReceiver(rxIndex, fnum, args); + return static_cast(*this).sendToReceiver(rxIndex, fnum, + args); } slsDetectorDefs::detectorType Module::getDetectorTypeFromShm(int det_id, @@ -3267,7 +3322,8 @@ void Module::checkDetectorVersionCompatibility() { void Module::checkReceiverVersionCompatibility() { // TODO! Verify that this works as intended when version don't match const int rxIndex = -1; - sendToReceiver(rxIndex, F_RECEIVER_CHECK_VERSION, int64_t(APIRECEIVER), nullptr); + sendToReceiver(rxIndex, F_RECEIVER_CHECK_VERSION, int64_t(APIRECEIVER), + nullptr); } int Module::sendModule(sls_detector_module *myMod, sls::ClientSocket &client) { @@ -3337,7 +3393,7 @@ void Module::setModule(sls_detector_module &module, bool trimbits) { } } -//TODO Will need to update to each round robin entry +// TODO Will need to update to each round robin entry void Module::updateReceiverStreamingIP(const int rxIndex) { auto ip = getReceiverStreamingIP(); if (ip == 0) { @@ -3346,8 +3402,8 @@ void Module::updateReceiverStreamingIP(const int rxIndex) { if (ip == 0) { ip = HostnameToIp(shm()->receivers[rxIndex].hostname); } - LOG(logINFO) << "Setting default receiver [" << moduleIndex - << " , " << rxIndex << "] streaming zmq ip to " << ip; + LOG(logINFO) << "Setting default receiver [" << moduleIndex << " , " + << rxIndex << "] streaming zmq ip to " << ip; } setReceiverStreamingIP(ip, rxIndex); } @@ -3629,7 +3685,7 @@ void Module::programFPGAviaBlackfin(std::vector buffer) { currentPointer += unitprogramsize; } - // checksum + // checksum if (client.Receive() == FAIL) { std::ostringstream os; os << "Module " << moduleIndex << " (" << shm()->hostname << ")" @@ -3641,8 +3697,8 @@ void Module::programFPGAviaBlackfin(std::vector buffer) { // simulating erasing flash { - LOG(logINFO) << "(Simulating) Erasing Flash for module " << moduleIndex << " (" - << shm()->hostname << ")"; + LOG(logINFO) << "(Simulating) Erasing Flash for module " << moduleIndex + << " (" << shm()->hostname << ")"; printf("%d%%\r", 0); std::cout << std::flush; // erasing takes 65 seconds, printing here (otherwise need threads @@ -3652,10 +3708,10 @@ void Module::programFPGAviaBlackfin(std::vector buffer) { while (count > 0) { std::this_thread::sleep_for(std::chrono::seconds(1)); --count; - printf( - "%d%%\r", - static_cast( - (static_cast(ERASE_TIME - count) / ERASE_TIME) * 100)); + printf("%d%%\r", + static_cast( + (static_cast(ERASE_TIME - count) / ERASE_TIME) * + 100)); std::cout << std::flush; } printf("\n"); @@ -3663,7 +3719,8 @@ void Module::programFPGAviaBlackfin(std::vector buffer) { // simulating writing to flash { - LOG(logINFO) << "(Simulating) Writing to Flash for module " << moduleIndex << " (" << shm()->hostname << ")"; + LOG(logINFO) << "(Simulating) Writing to Flash for module " + << moduleIndex << " (" << shm()->hostname << ")"; printf("%d%%\r", 0); std::cout << std::flush; // writing takes 30 seconds, printing here (otherwise need threads @@ -3673,10 +3730,10 @@ void Module::programFPGAviaBlackfin(std::vector buffer) { while (count > 0) { std::this_thread::sleep_for(std::chrono::seconds(1)); --count; - printf( - "%d%%\r", - static_cast( - (static_cast(ERASE_TIME - count) / ERASE_TIME) * 100)); + printf("%d%%\r", + static_cast( + (static_cast(ERASE_TIME - count) / ERASE_TIME) * + 100)); std::cout << std::flush; } printf("\n"); @@ -3719,8 +3776,8 @@ void Module::programFPGAviaNios(std::vector buffer) { // simulating erasing flash { - LOG(logINFO) << "(Simulating) Erasing Flash for module " << moduleIndex << " (" - << shm()->hostname << ")"; + LOG(logINFO) << "(Simulating) Erasing Flash for module " << moduleIndex + << " (" << shm()->hostname << ")"; printf("%d%%\r", 0); std::cout << std::flush; // erasing takes 10 seconds, printing here (otherwise need threads @@ -3730,10 +3787,10 @@ void Module::programFPGAviaNios(std::vector buffer) { while (count > 0) { std::this_thread::sleep_for(std::chrono::seconds(1)); --count; - printf( - "%d%%\r", - static_cast( - (static_cast(ERASE_TIME - count) / ERASE_TIME) * 100)); + printf("%d%%\r", + static_cast( + (static_cast(ERASE_TIME - count) / ERASE_TIME) * + 100)); std::cout << std::flush; } printf("\n"); @@ -3741,7 +3798,8 @@ void Module::programFPGAviaNios(std::vector buffer) { // simulating writing to flash { - LOG(logINFO) << "(Simulating) Writing to Flash for module " << moduleIndex << " (" << shm()->hostname << ")"; + LOG(logINFO) << "(Simulating) Writing to Flash for module " + << moduleIndex << " (" << shm()->hostname << ")"; printf("%d%%\r", 0); std::cout << std::flush; // writing takes 45 seconds, printing here (otherwise need threads @@ -3751,10 +3809,10 @@ void Module::programFPGAviaNios(std::vector buffer) { while (count > 0) { std::this_thread::sleep_for(std::chrono::seconds(1)); --count; - printf( - "%d%%\r", - static_cast( - (static_cast(ERASE_TIME - count) / ERASE_TIME) * 100)); + printf("%d%%\r", + static_cast( + (static_cast(ERASE_TIME - count) / ERASE_TIME) * + 100)); std::cout << std::flush; } printf("\n"); diff --git a/slsDetectorSoftware/src/Module.h b/slsDetectorSoftware/src/Module.h index 1647ebcff..64a8cf48d 100644 --- a/slsDetectorSoftware/src/Module.h +++ b/slsDetectorSoftware/src/Module.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "SharedMemory.h" #include "sls/ClientSocket.h" @@ -152,6 +154,8 @@ class Module : public virtual slsDetectorDefs { void setDynamicRange(int dr); timingMode getTimingMode() const; void setTimingMode(timingMode value); + speedLevel getReadoutSpeed() const; + void setReadoutSpeed(speedLevel value); int getClockDivider(int clkIndex) const; void setClockDivider(int clkIndex, int value); int getClockPhase(int clkIndex, bool inDegrees) const; @@ -393,7 +397,7 @@ class Module : public virtual slsDetectorDefs { void setGainMode(const gainMode mode); int getFilterCell() const; void setFilterCell(int value); - + /************************************************** * * * Gotthard Specific * diff --git a/slsDetectorSoftware/src/Pattern.cpp b/slsDetectorSoftware/src/Pattern.cpp index aade2548c..a804f0d71 100644 --- a/slsDetectorSoftware/src/Pattern.cpp +++ b/slsDetectorSoftware/src/Pattern.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "sls/Pattern.h" #include "sls/ToString.h" #include "sls/logger.h" diff --git a/slsDetectorSoftware/src/SharedMemory.h b/slsDetectorSoftware/src/SharedMemory.h index 74b9a1e3a..e50662487 100644 --- a/slsDetectorSoftware/src/SharedMemory.h +++ b/slsDetectorSoftware/src/SharedMemory.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once /************************************************ * @file SharedMemory.h @@ -24,7 +26,7 @@ #define SHM_DETECTOR_PREFIX "/slsDetectorPackage_detector_" #define SHM_MODULE_PREFIX "_module_" -#define SHM_ENV_NAME "SLSDETNAME" +#define SHM_ENV_NAME "SLSDETNAME" #include #include diff --git a/slsDetectorSoftware/tests/CMakeLists.txt b/slsDetectorSoftware/tests/CMakeLists.txt index a17ec4a02..bc65a73e9 100755 --- a/slsDetectorSoftware/tests/CMakeLists.txt +++ b/slsDetectorSoftware/tests/CMakeLists.txt @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package target_sources(tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/test-SharedMemory.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test-slsDetector.cpp diff --git a/slsDetectorSoftware/tests/test-CmdParser.cpp b/slsDetectorSoftware/tests/test-CmdParser.cpp index c7e2cb916..a95b7eeee 100644 --- a/slsDetectorSoftware/tests/test-CmdParser.cpp +++ b/slsDetectorSoftware/tests/test-CmdParser.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "CmdParser.h" #include "catch.hpp" #include @@ -147,18 +149,18 @@ SCENARIO("Parsing strings with -h or --help", "[support]") { } } -TEST_CASE("Parse string with --help"){ +TEST_CASE("Parse string with --help") { CmdParser p; p.Parse("list --help"); - REQUIRE(p.isHelp()==true); - REQUIRE(p.command()=="list"); + REQUIRE(p.isHelp() == true); + REQUIRE(p.command() == "list"); } -TEST_CASE("Parse string with -h"){ +TEST_CASE("Parse string with -h") { CmdParser p; p.Parse("list -h"); - REQUIRE(p.isHelp()==true); - REQUIRE(p.command()=="list"); + REQUIRE(p.isHelp() == true); + REQUIRE(p.command() == "list"); } TEST_CASE("Parsing consecutive strings resets not found det id") { @@ -270,9 +272,7 @@ TEST_CASE("Double digit id", "[support]") { REQUIRE(p.arguments().empty()); } - - -TEST_CASE("Allows space between mod id and command"){ +TEST_CASE("Allows space between mod id and command") { CmdParser p; p.Parse("7: exptime 0.5"); REQUIRE(p.detector_id() == 7); @@ -281,7 +281,7 @@ TEST_CASE("Allows space between mod id and command"){ REQUIRE(p.arguments()[0] == "0.5"); } -TEST_CASE("Allows space between mod id and command also without :"){ +TEST_CASE("Allows space between mod id and command also without :") { CmdParser p; p.Parse("1 exptime 0.5"); REQUIRE(p.detector_id() == 1); @@ -290,7 +290,7 @@ TEST_CASE("Allows space between mod id and command also without :"){ REQUIRE(p.arguments()[0] == "0.5"); } -TEST_CASE("Allows space between mod id and command when detector id is used"){ +TEST_CASE("Allows space between mod id and command when detector id is used") { CmdParser p; p.Parse("1-5 exptime 0.5"); REQUIRE(p.detector_id() == 5); @@ -300,7 +300,7 @@ TEST_CASE("Allows space between mod id and command when detector id is used"){ REQUIRE(p.arguments()[0] == "0.5"); } -TEST_CASE("Allows space between mod id and command with detector id and :"){ +TEST_CASE("Allows space between mod id and command with detector id and :") { CmdParser p; p.Parse("1-5: exptime 0.5"); REQUIRE(p.detector_id() == 5); @@ -310,7 +310,7 @@ TEST_CASE("Allows space between mod id and command with detector id and :"){ REQUIRE(p.arguments()[0] == "0.5"); } -TEST_CASE("Parse receiver ID"){ +TEST_CASE("Parse receiver ID") { CmdParser p; p.Parse("2-5:3 flowcontrol10g 1"); REQUIRE(p.detector_id() == 5); @@ -318,84 +318,81 @@ TEST_CASE("Parse receiver ID"){ REQUIRE(p.command() == "flowcontrol10g"); REQUIRE(p.arguments().size() == 1); REQUIRE(p.arguments()[0] == "1"); - REQUIRE(p.receiver_id()==3); + REQUIRE(p.receiver_id() == 3); } -TEST_CASE("Parse receiver ID no det id"){ +TEST_CASE("Parse receiver ID no det id") { CmdParser p; p.Parse("5:95 flowcontrol10g"); REQUIRE(p.detector_id() == 5); REQUIRE(p.multi_id() == 0); REQUIRE(p.command() == "flowcontrol10g"); REQUIRE(p.arguments().size() == 0); - REQUIRE(p.receiver_id()==95); + REQUIRE(p.receiver_id() == 95); } - - -TEST_CASE("Det id but no mod id"){ +TEST_CASE("Det id but no mod id") { CmdParser p; p.Parse("1-exptime"); - REQUIRE(p.detector_id() == -1); //not there + REQUIRE(p.detector_id() == -1); // not there REQUIRE(p.multi_id() == 1); REQUIRE(p.command() == "exptime"); } -TEST_CASE("Det id but no mod id but with space after -"){ +TEST_CASE("Det id but no mod id but with space after -") { CmdParser p; p.Parse("1- exptime"); - REQUIRE(p.detector_id() == -1); //not there + REQUIRE(p.detector_id() == -1); // not there REQUIRE(p.multi_id() == 1); REQUIRE(p.command() == "exptime"); } -TEST_CASE("Parse receiver ID no det id no mod"){ +TEST_CASE("Parse receiver ID no det id no mod") { CmdParser p; p.Parse(":95 flowcontrol10g"); - REQUIRE(p.detector_id() == -1); //not there + REQUIRE(p.detector_id() == -1); // not there REQUIRE(p.multi_id() == 0); REQUIRE(p.command() == "flowcontrol10g"); REQUIRE(p.arguments().size() == 0); - REQUIRE(p.receiver_id()==95); + REQUIRE(p.receiver_id() == 95); } -TEST_CASE("Parse mod and receiver id"){ +TEST_CASE("Parse mod and receiver id") { CmdParser p; p.Parse("1:3 exptime"); - REQUIRE(p.detector_id() == 1); - REQUIRE(p.receiver_id()==3); + REQUIRE(p.detector_id() == 1); + REQUIRE(p.receiver_id() == 3); REQUIRE(p.command() == "exptime"); } -TEST_CASE("Det id but no no mod"){ +TEST_CASE("Det id but no no mod") { CmdParser p; p.Parse("2-:35 exptime"); - REQUIRE(p.detector_id() == -1); - REQUIRE(p.receiver_id()==35); + REQUIRE(p.detector_id() == -1); + REQUIRE(p.receiver_id() == 35); REQUIRE(p.multi_id() == 2); REQUIRE(p.command() == "exptime"); } -TEST_CASE("All stuff"){ +TEST_CASE("All stuff") { CmdParser p; p.Parse("3-4:2 exptime"); - REQUIRE(p.detector_id() == 4); - REQUIRE(p.receiver_id()==2); + REQUIRE(p.detector_id() == 4); + REQUIRE(p.receiver_id() == 2); REQUIRE(p.multi_id() == 3); REQUIRE(p.command() == "exptime"); } -TEST_CASE("Parse a command that has -h in it"){ +TEST_CASE("Parse a command that has -h in it") { CmdParser p; p.Parse("1-hostname somepc"); REQUIRE(p.multi_id() == 1); REQUIRE(p.command() == "hostname"); REQUIRE(p.arguments().size() == 1); - REQUIRE(p.arguments()[0]== "somepc"); - + REQUIRE(p.arguments()[0] == "somepc"); } -TEST_CASE("Parse a command in the form 0-1 command"){ +TEST_CASE("Parse a command in the form 0-1 command") { CmdParser p; p.Parse("3-5 exptime"); REQUIRE(p.multi_id() == 3); @@ -403,7 +400,7 @@ TEST_CASE("Parse a command in the form 0-1 command"){ REQUIRE(p.command() == "exptime"); } -TEST_CASE("Parse a command in the form 0-1:command"){ +TEST_CASE("Parse a command in the form 0-1:command") { CmdParser p; p.Parse("3-5:exptime"); REQUIRE(p.multi_id() == 3); diff --git a/slsDetectorSoftware/tests/test-CmdProxy-chiptestboard.cpp b/slsDetectorSoftware/tests/test-CmdProxy-chiptestboard.cpp index d77471a0c..e750bc6a4 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy-chiptestboard.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy-chiptestboard.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "CmdProxy.h" #include "catch.hpp" #include "sls/Detector.h" diff --git a/slsDetectorSoftware/tests/test-CmdProxy-eiger.cpp b/slsDetectorSoftware/tests/test-CmdProxy-eiger.cpp index 7482c30d0..27b4b7129 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy-eiger.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy-eiger.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "CmdProxy.h" #include "catch.hpp" #include "sls/Detector.h" @@ -488,23 +490,13 @@ TEST_CASE("activate", "[.cmd]") { } { std::ostringstream oss; - proxy.Call("activate", {"1", "nopadding"}, -1, PUT, oss); - REQUIRE(oss.str() == "activate 1 nopadding\n"); + proxy.Call("activate", {}, -1, GET, oss); + REQUIRE(oss.str() == "activate 1\n"); } { std::ostringstream oss; - proxy.Call("activate", {"0", "padding"}, -1, PUT, oss); - REQUIRE(oss.str() == "activate 0 padding\n"); - } - { - std::ostringstream oss; - proxy.Call("activate", {"0", "nopadding"}, -1, PUT, oss); - REQUIRE(oss.str() == "activate 0 nopadding\n"); - } - { - std::ostringstream oss; - proxy.Call("activate", {"1", "padding"}, -1, PUT, oss); - REQUIRE(oss.str() == "activate 1 padding\n"); + proxy.Call("activate", {"0"}, -1, PUT, oss); + REQUIRE(oss.str() == "activate 0\n"); } for (int i = 0; i != det.size(); ++i) { det.setActive(prev_val[i], {i}); diff --git a/slsDetectorSoftware/tests/test-CmdProxy-global.cpp b/slsDetectorSoftware/tests/test-CmdProxy-global.cpp index 64289f722..b8a0ca624 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy-global.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy-global.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "test-CmdProxy-global.h" #include "CmdProxy.h" #include "catch.hpp" diff --git a/slsDetectorSoftware/tests/test-CmdProxy-global.h b/slsDetectorSoftware/tests/test-CmdProxy-global.h index 0a1777b7a..899462ad5 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy-global.h +++ b/slsDetectorSoftware/tests/test-CmdProxy-global.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/sls_detector_defs.h" diff --git a/slsDetectorSoftware/tests/test-CmdProxy-gotthard.cpp b/slsDetectorSoftware/tests/test-CmdProxy-gotthard.cpp index 84c084766..cbb737a1f 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy-gotthard.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy-gotthard.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "CmdProxy.h" #include "catch.hpp" #include "sls/Detector.h" diff --git a/slsDetectorSoftware/tests/test-CmdProxy-gotthard2.cpp b/slsDetectorSoftware/tests/test-CmdProxy-gotthard2.cpp index a69272d63..cdba5d406 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy-gotthard2.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy-gotthard2.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "CmdProxy.h" #include "catch.hpp" #include "sls/Detector.h" diff --git a/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp b/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp index b71d9678e..bd43f1784 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "CmdProxy.h" #include "catch.hpp" #include "sls/Detector.h" @@ -287,7 +289,8 @@ TEST_CASE("comp_disable_time", "[.cmd]") { Detector det; CmdProxy proxy(&det); auto det_type = det.getDetectorType().squash(); - if (det_type == defs::JUNGFRAU) { + if (det_type == defs::JUNGFRAU && + det.getChipVersion().squash() * 10 == 11) { auto prev_val = det.getComparatorDisableTime(); { std::ostringstream oss; @@ -319,7 +322,7 @@ TEST_CASE("storagecells", "[.cmd]") { auto det_type = det.getDetectorType().squash(); if (det_type == defs::JUNGFRAU) { // chip version 1.0 - if (det.getChipVersion().squash()*10 == 10) { + if (det.getChipVersion().squash() * 10 == 10) { auto prev_val = det.getNumberOfAdditionalStorageCells().tsquash( "inconsistent #additional storage cells to test"); { @@ -344,11 +347,11 @@ TEST_CASE("storagecells", "[.cmd]") { } REQUIRE_THROWS(proxy.Call("storagecells", {"16"}, -1, PUT)); det.setNumberOfAdditionalStorageCells(prev_val); - } + } // chip version 1.1 else { // cannot set number of addl. storage cells - REQUIRE_THROWS(proxy.Call("storagecells", {"1"}, -1, PUT)); + REQUIRE_THROWS(proxy.Call("storagecells", {"1"}, -1, PUT)); } } else { REQUIRE_THROWS(proxy.Call("storagecells", {}, -1, GET)); @@ -368,11 +371,11 @@ TEST_CASE("storagecell_start", "[.cmd]") { REQUIRE(oss.str() == "storagecell_start 1\n"); } // chip version 1.0 - if (det.getChipVersion().squash()*10 == 10) { + if (det.getChipVersion().squash() * 10 == 10) { std::ostringstream oss; proxy.Call("storagecell_start", {"15"}, -1, PUT, oss); REQUIRE(oss.str() == "storagecell_start 15\n"); - } + } // chip version 1.1 else { // max is 3 @@ -407,7 +410,7 @@ TEST_CASE("storagecell_delay", "[.cmd]") { auto det_type = det.getDetectorType().squash(); if (det_type == defs::JUNGFRAU) { // chip version 1.0 - if (det.getChipVersion().squash()*10 == 10) { + if (det.getChipVersion().squash() * 10 == 10) { auto prev_val = det.getStorageCellDelay(); { std::ostringstream oss; @@ -424,15 +427,17 @@ TEST_CASE("storagecell_delay", "[.cmd]") { proxy.Call("storagecell_delay", {"0"}, -1, PUT, oss); REQUIRE(oss.str() == "storagecell_delay 0\n"); } - REQUIRE_THROWS(proxy.Call("storagecell_delay", {"1638376ns"}, -1, PUT)); + REQUIRE_THROWS( + proxy.Call("storagecell_delay", {"1638376ns"}, -1, PUT)); for (int i = 0; i != det.size(); ++i) { det.setStorageCellDelay(prev_val[i], {i}); } - } + } // chip version 1.1 else { // cannot set storage cell delay - REQUIRE_THROWS(proxy.Call("storagecell_delay", {"1.62ms"}, -1, PUT)); + REQUIRE_THROWS( + proxy.Call("storagecell_delay", {"1.62ms"}, -1, PUT)); } } else { REQUIRE_THROWS(proxy.Call("storagecell_delay", {}, -1, GET)); diff --git a/slsDetectorSoftware/tests/test-CmdProxy-moench.cpp b/slsDetectorSoftware/tests/test-CmdProxy-moench.cpp index f8431f7a9..a3f8838e4 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy-moench.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy-moench.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "CmdProxy.h" #include "catch.hpp" #include "sls/Detector.h" diff --git a/slsDetectorSoftware/tests/test-CmdProxy-mythen3.cpp b/slsDetectorSoftware/tests/test-CmdProxy-mythen3.cpp index e6d0b63bc..a4f3e1d8a 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy-mythen3.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy-mythen3.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "CmdProxy.h" #include "catch.hpp" #include "sls/Detector.h" diff --git a/slsDetectorSoftware/tests/test-CmdProxy-pattern.cpp b/slsDetectorSoftware/tests/test-CmdProxy-pattern.cpp index 611cc9163..739ca10f9 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy-pattern.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy-pattern.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "CmdProxy.h" #include "catch.hpp" #include "sls/Detector.h" diff --git a/slsDetectorSoftware/tests/test-CmdProxy-rx.cpp b/slsDetectorSoftware/tests/test-CmdProxy-rx.cpp index ed4f1ce7b..ca7cecfe7 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy-rx.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy-rx.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "CmdProxy.h" #include "catch.hpp" #include "sls/Detector.h" @@ -308,12 +310,13 @@ TEST_CASE("rx_udpsocksize", "[.cmd][.rx]") { CmdProxy proxy(&det); int64_t prev_val = det.getRxUDPSocketBufferSize().tsquash( "Need same udp socket buffer size to test"); - std::string s_new_val = std::to_string(prev_val - 1000); - { + std::string s_new_val = std::to_string(prev_val); + /*std::string s_new_val = std::to_string(prev_val - 1000); + { Need permissions std::ostringstream oss; proxy.Call("rx_udpsocksize", {s_new_val}, -1, PUT, oss); REQUIRE(oss.str() >= "rx_udpsocksize " + s_new_val + "\n"); - } + }*/ { std::ostringstream oss; proxy.Call("rx_udpsocksize", {}, -1, GET, oss); diff --git a/slsDetectorSoftware/tests/test-CmdProxy.cpp b/slsDetectorSoftware/tests/test-CmdProxy.cpp index e72ae63ba..2278c096f 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "CmdProxy.h" #include "catch.hpp" #include "sls/Detector.h" @@ -345,7 +347,8 @@ TEST_CASE("thresholdnotb", "[.cmd]") { std::string senergy = std::to_string(prev_energies[0]); std::ostringstream oss1, oss2; proxy.Call("thresholdnotb", {senergy, "standard"}, -1, PUT, oss1); - REQUIRE(oss1.str() == "threshold [" + senergy + ", standard]\n"); + REQUIRE(oss1.str() == + "thresholdnotb [" + senergy + ", standard]\n"); proxy.Call("threshold", {}, -1, GET, oss2); REQUIRE(oss2.str() == "threshold " + senergy + "\n"); REQUIRE_THROWS(proxy.Call("thresholdnotb", @@ -889,54 +892,101 @@ TEST_CASE("timinglist", "[.cmd]") { REQUIRE_THROWS(proxy.Call("timinglist", {}, -1, PUT)); } -TEST_CASE("speed", "[.cmd]") { +TEST_CASE("readoutspeed", "[.cmd]") { Detector det; CmdProxy proxy(&det); auto det_type = det.getDetectorType().squash(); - if (det_type == defs::EIGER || det_type == defs::JUNGFRAU) { - auto prev_val = det.getSpeed(); - // full speed for jungfrau only works for new boards - /* - { + if (det_type == defs::EIGER || det_type == defs::JUNGFRAU || + det_type == defs::GOTTHARD2) { + auto prev_val = det.getReadoutSpeed(); + + // full speed for jungfrau only works for new boards (chipv1.1 is with + // new board [hw1.0 and chipv1.0 not tested here]) + if ((det_type == defs::JUNGFRAU && + det.getChipVersion().squash() * 10 == 11) || + (det_type == defs::EIGER)) { std::ostringstream oss1, oss2, oss3, oss4; - proxy.Call("speed", {"0"}, -1, PUT, oss1); - REQUIRE(oss1.str() == "speed full_speed\n"); - proxy.Call("speed", {}, -1, GET, oss2); - REQUIRE(oss2.str() == "speed full_speed\n"); - proxy.Call("speed", {"full_speed"}, -1, PUT, oss3); - REQUIRE(oss3.str() == "speed full_speed\n"); - proxy.Call("speed", {}, -1, GET, oss4); - REQUIRE(oss4.str() == "speed full_speed\n"); + proxy.Call("readoutspeed", {"0"}, -1, PUT, oss1); + REQUIRE(oss1.str() == "readoutspeed full_speed\n"); + proxy.Call("readoutspeed", {}, -1, GET, oss2); + REQUIRE(oss2.str() == "readoutspeed full_speed\n"); + proxy.Call("readoutspeed", {"full_speed"}, -1, PUT, oss3); + REQUIRE(oss3.str() == "readoutspeed full_speed\n"); + proxy.Call("readoutspeed", {}, -1, GET, oss4); + REQUIRE(oss4.str() == "readoutspeed full_speed\n"); } - */ - { - std::ostringstream oss1, oss2, oss3, oss4; - proxy.Call("speed", {"1"}, -1, PUT, oss1); - REQUIRE(oss1.str() == "speed half_speed\n"); - proxy.Call("speed", {}, -1, GET, oss2); - REQUIRE(oss2.str() == "speed half_speed\n"); - proxy.Call("speed", {"half_speed"}, -1, PUT, oss3); - REQUIRE(oss3.str() == "speed half_speed\n"); - proxy.Call("speed", {}, -1, GET, oss4); - REQUIRE(oss4.str() == "speed half_speed\n"); + + if (det_type == defs::EIGER || det_type == defs::JUNGFRAU) { + { + std::ostringstream oss1, oss2, oss3, oss4; + proxy.Call("readoutspeed", {"1"}, -1, PUT, oss1); + REQUIRE(oss1.str() == "readoutspeed half_speed\n"); + proxy.Call("readoutspeed", {}, -1, GET, oss2); + REQUIRE(oss2.str() == "readoutspeed half_speed\n"); + proxy.Call("readoutspeed", {"half_speed"}, -1, PUT, oss3); + REQUIRE(oss3.str() == "readoutspeed half_speed\n"); + proxy.Call("readoutspeed", {}, -1, GET, oss4); + REQUIRE(oss4.str() == "readoutspeed half_speed\n"); + } + { + std::ostringstream oss1, oss2, oss3, oss4; + proxy.Call("readoutspeed", {"2"}, -1, PUT, oss1); + REQUIRE(oss1.str() == "readoutspeed quarter_speed\n"); + proxy.Call("readoutspeed", {}, -1, GET, oss2); + REQUIRE(oss2.str() == "readoutspeed quarter_speed\n"); + proxy.Call("readoutspeed", {"quarter_speed"}, -1, PUT, oss3); + REQUIRE(oss3.str() == "readoutspeed quarter_speed\n"); + proxy.Call("readoutspeed", {}, -1, GET, oss4); + REQUIRE(oss4.str() == "readoutspeed quarter_speed\n"); + } + REQUIRE_THROWS(proxy.Call("readoutspeed", {"108"}, -1, PUT)); + REQUIRE_THROWS(proxy.Call("readoutspeed", {"144"}, -1, PUT)); } - { - std::ostringstream oss1, oss2, oss3, oss4; - proxy.Call("speed", {"2"}, -1, PUT, oss1); - REQUIRE(oss1.str() == "speed quarter_speed\n"); - proxy.Call("speed", {}, -1, GET, oss2); - REQUIRE(oss2.str() == "speed quarter_speed\n"); - proxy.Call("speed", {"quarter_speed"}, -1, PUT, oss3); - REQUIRE(oss3.str() == "speed quarter_speed\n"); - proxy.Call("speed", {}, -1, GET, oss4); - REQUIRE(oss4.str() == "speed quarter_speed\n"); + + if (det_type == defs::GOTTHARD2) { + { + std::ostringstream oss1, oss2, oss3, oss4; + proxy.Call("readoutspeed", {"108"}, -1, PUT, oss1); + REQUIRE(oss1.str() == "readoutspeed 108\n"); + proxy.Call("readoutspeed", {}, -1, GET, oss2); + REQUIRE(oss2.str() == "readoutspeed 108\n"); + } + + { + std::ostringstream oss1, oss2, oss3, oss4; + proxy.Call("readoutspeed", {"144"}, -1, PUT, oss1); + REQUIRE(oss1.str() == "readoutspeed 144\n"); + proxy.Call("readoutspeed", {}, -1, GET, oss2); + REQUIRE(oss2.str() == "readoutspeed 144\n"); + } + REQUIRE_THROWS(proxy.Call("readoutspeed", {"full_speed"}, -1, PUT)); + REQUIRE_THROWS(proxy.Call("readoutspeed", {"half_speed"}, -1, PUT)); + REQUIRE_THROWS( + proxy.Call("readoutspeed", {"quarter_speed"}, -1, PUT)); + REQUIRE_THROWS(proxy.Call("readoutspeed", {"0"}, -1, PUT)); + REQUIRE_THROWS(proxy.Call("readoutspeed", {"1"}, -1, PUT)); + REQUIRE_THROWS(proxy.Call("readoutspeed", {"2"}, -1, PUT)); } + for (int i = 0; i != det.size(); ++i) { - det.setSpeed(prev_val[i], {i}); + det.setReadoutSpeed(prev_val[i], {i}); } } else { - REQUIRE_THROWS(proxy.Call("speed", {"0"}, -1, PUT)); - REQUIRE_THROWS(proxy.Call("speed", {}, -1, GET)); + REQUIRE_THROWS(proxy.Call("readoutspeed", {"0"}, -1, PUT)); + REQUIRE_THROWS(proxy.Call("readoutspeed", {}, -1, GET)); + } +} + +TEST_CASE("readoutspeedlist", "[.cmd]") { + Detector det; + CmdProxy proxy(&det); + auto det_type = det.getDetectorType().squash(); + if (det_type == defs::GOTTHARD2 || det_type == defs::JUNGFRAU || + det_type == defs::EIGER) { + REQUIRE_NOTHROW(proxy.Call("readoutspeedlist", {}, -1, GET)); + REQUIRE_THROWS(proxy.Call("readoutspeedlist", {}, -1, PUT)); + } else { + REQUIRE_THROWS(proxy.Call("readoutspeedlist", {}, -1, GET)); } } @@ -1538,17 +1588,17 @@ TEST_CASE("currentsource", "[.cmd]") { { std::ostringstream oss; proxy.Call("currentsource", {"1"}, -1, PUT, oss); - REQUIRE(oss.str() == "currentsource 1\n"); + REQUIRE(oss.str() == "currentsource [1]\n"); } { std::ostringstream oss; proxy.Call("currentsource", {"0"}, -1, PUT, oss); - REQUIRE(oss.str() == "currentsource 0\n"); + REQUIRE(oss.str() == "currentsource [0]\n"); } { std::ostringstream oss; proxy.Call("currentsource", {}, -1, GET, oss); - REQUIRE(oss.str() == "currentsource 0\n"); + REQUIRE(oss.str() == "currentsource [disabled]\n"); } REQUIRE_THROWS( proxy.Call("currentsource", {"1", "fix", "42"}, -1, PUT)); @@ -1735,6 +1785,9 @@ TEST_CASE("defaultdac", "[.cmd]") { REQUIRE_THROWS(proxy.Call("defaultdac", {"blabla"}, -1, PUT)); auto daclist = det.getDacList(); for (auto it : daclist) { + if (it == defs::VTHRESHOLD) { + continue; + } auto dacname = sls::ToString(it); auto prev_val = det.getDefaultDac(it); { @@ -1747,33 +1800,30 @@ TEST_CASE("defaultdac", "[.cmd]") { std::ostringstream oss; proxy.Call("defaultdac", {dacname}, -1, GET, oss); REQUIRE(oss.str() == std::string("defaultdac ") + dacname + - std::string(" 1000\n")); + std::string(" 1000\n")); } for (int i = 0; i != det.size(); ++i) { det.setDefaultDac(it, prev_val[i], {i}); } } if (det_type == defs::JUNGFRAU) { - std::vector daclist = {defs::VREF_PRECH, defs::VREF_DS, - defs::VREF_COMP}; + std::vector daclist = { + defs::VREF_PRECH, defs::VREF_DS, defs::VREF_COMP}; for (auto it : daclist) { auto dacname = sls::ToString(it); auto prev_val = det.getDefaultDac(it, defs::GAIN0); { std::ostringstream oss; proxy.Call("defaultdac", {dacname, "1000", "gain0"}, -1, - PUT, oss); - REQUIRE(oss.str() == - std::string("defaultdac ") + dacname + - std::string(" gain0 1000\n")); + PUT, oss); + REQUIRE(oss.str() == std::string("defaultdac ") + dacname + + std::string(" gain0 1000\n")); } { std::ostringstream oss; - proxy.Call("defaultdac", {dacname, "gain0"}, -1, GET, - oss); - REQUIRE(oss.str() == - std::string("defaultdac ") + dacname + - std::string(" gain0 1000\n")); + proxy.Call("defaultdac", {dacname, "gain0"}, -1, GET, oss); + REQUIRE(oss.str() == std::string("defaultdac ") + dacname + + std::string(" gain0 1000\n")); } for (int i = 0; i != det.size(); ++i) { det.setDefaultDac(it, prev_val[i], defs::GAIN0, {i}); @@ -1781,7 +1831,7 @@ TEST_CASE("defaultdac", "[.cmd]") { } } } else { - REQUIRE_THROWS(proxy.Call("defaultdac", {}, -1, GET)); + REQUIRE_THROWS(proxy.Call("defaultdac", {}, -1, GET)); } } @@ -1879,6 +1929,10 @@ TEST_CASE("blockingtrigger", "[.cmd]") { proxy.Call("blockingtrigger", {}, -1, PUT, oss); REQUIRE(oss.str() == "blockingtrigger successful\n"); } + if (det.isVirtualDetectorServer().tsquash( + "inconsistent virtual detectors")) { + std::this_thread::sleep_for(std::chrono::seconds(2)); + } auto currentfnum = det.getNextFrameNumber().tsquash("inconsistent frame nr in test"); REQUIRE(nextframenumber + 1 == currentfnum); @@ -2235,7 +2289,6 @@ TEST_CASE("udp_numdst", "[.cmd]") { } } - TEST_CASE("udp_cleardst", "[.cmd]") { Detector det; CmdProxy proxy(&det); @@ -2273,7 +2326,7 @@ TEST_CASE("udp_firstdst", "[.cmd]") { det.setFirstUDPDestination(prev_val[i], {i}); } } else { - REQUIRE_THROWS(proxy.Call("udp_numdst", {}, -1, GET)); + REQUIRE_THROWS(proxy.Call("udp_firstdst", {}, -1, GET)); } } diff --git a/slsDetectorSoftware/tests/test-Module.cpp b/slsDetectorSoftware/tests/test-Module.cpp index e80a1a449..667aea4e9 100644 --- a/slsDetectorSoftware/tests/test-Module.cpp +++ b/slsDetectorSoftware/tests/test-Module.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "Module.h" #include "SharedMemory.h" #include "catch.hpp" diff --git a/slsDetectorSoftware/tests/test-Pattern.cpp b/slsDetectorSoftware/tests/test-Pattern.cpp index 28fb21056..6128fe0b8 100644 --- a/slsDetectorSoftware/tests/test-Pattern.cpp +++ b/slsDetectorSoftware/tests/test-Pattern.cpp @@ -1,23 +1,25 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "catch.hpp" #include "sls/Pattern.h" using sls::Pattern; -TEST_CASE("Pattern is default constructable and has zeroed fields"){ +TEST_CASE("Pattern is default constructable and has zeroed fields") { Pattern p; - for (int i = 0; i!=MAX_PATTERN_LENGTH; ++i) + for (int i = 0; i != MAX_PATTERN_LENGTH; ++i) REQUIRE(p.data()->word[i] == 0); REQUIRE(p.data()->ioctrl == 0); } -TEST_CASE("Copy construct pattern"){ +TEST_CASE("Copy construct pattern") { Pattern p; p.data()->loop[0] = 7; Pattern p1(p); REQUIRE(p1.data()->loop[0] == 7); } -TEST_CASE("Compare patterns"){ +TEST_CASE("Compare patterns") { Pattern p; Pattern p1; REQUIRE(p == p1); @@ -25,7 +27,3 @@ TEST_CASE("Compare patterns"){ p1.data()->word[500] = 1; REQUIRE_FALSE(p == p1); } - - - - diff --git a/slsDetectorSoftware/tests/test-Result.cpp b/slsDetectorSoftware/tests/test-Result.cpp index bb113c93e..72e1993f0 100644 --- a/slsDetectorSoftware/tests/test-Result.cpp +++ b/slsDetectorSoftware/tests/test-Result.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "catch.hpp" #include "sls/Result.h" #include "sls/ToString.h" diff --git a/slsDetectorSoftware/tests/test-SharedMemory.cpp b/slsDetectorSoftware/tests/test-SharedMemory.cpp index 2d5c99785..fb1248653 100644 --- a/slsDetectorSoftware/tests/test-SharedMemory.cpp +++ b/slsDetectorSoftware/tests/test-SharedMemory.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "SharedMemory.h" #include "catch.hpp" @@ -19,8 +21,8 @@ TEST_CASE("Create SharedMemory read and write", "[detector]") { SharedMemory shm(shm_id, -1); shm.CreateSharedMemory(); - CHECK(shm.GetName() == - std::string("/slsDetectorPackage_multi_") + std::to_string(shm_id)); + CHECK(shm.GetName() == std::string("/slsDetectorPackage_detector_") + + std::to_string(shm_id)); shm()->x = 3; shm()->y = 5.7; @@ -90,8 +92,8 @@ TEST_CASE("Open two shared memories to the same place", "[detector]") { TEST_CASE("Move SharedMemory", "[detector]") { SharedMemory shm(shm_id, -1); - CHECK(shm.GetName() == - std::string("/slsDetectorPackage_multi_") + std::to_string(shm_id)); + CHECK(shm.GetName() == std::string("/slsDetectorPackage_detector_") + + std::to_string(shm_id)); shm.CreateSharedMemory(); shm()->x = 9; @@ -104,8 +106,8 @@ TEST_CASE("Move SharedMemory", "[detector]") { CHECK(shm() == nullptr); CHECK(shm.size() == 0); - CHECK(shm2.GetName() == - std::string("/slsDetectorPackage_multi_") + std::to_string(shm_id)); + CHECK(shm2.GetName() == std::string("/slsDetectorPackage_detector_") + + std::to_string(shm_id)); shm2.RemoveSharedMemory(); } @@ -123,7 +125,7 @@ TEST_CASE("Create several shared memories", "[detector]") { for (int i = 0; i != N; ++i) { CHECK(*v[i]() == i); - CHECK(v[i].GetName() == std::string("/slsDetectorPackage_multi_") + + CHECK(v[i].GetName() == std::string("/slsDetectorPackage_detector_") + std::to_string(i + shm_id)); } diff --git a/slsDetectorSoftware/tests/test-slsDetector.cpp b/slsDetectorSoftware/tests/test-slsDetector.cpp index cd939fb0b..f68c68b9e 100644 --- a/slsDetectorSoftware/tests/test-slsDetector.cpp +++ b/slsDetectorSoftware/tests/test-slsDetector.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package // #include "catch.hpp" // #include "sls/container_utils.h" diff --git a/slsReceiverSoftware/CMakeLists.txt b/slsReceiverSoftware/CMakeLists.txt index 8ed871ab5..e138d8fa5 100755 --- a/slsReceiverSoftware/CMakeLists.txt +++ b/slsReceiverSoftware/CMakeLists.txt @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package set(SOURCES src/Implementation.cpp src/ClientInterface.cpp @@ -66,6 +68,8 @@ if(SLS_BUILD_SHARED_LIBRARIES) add_library(slsReceiverShared SHARED $) target_link_libraries(slsReceiverShared PUBLIC slsReceiverObject) set_target_properties(slsReceiverShared PROPERTIES + VERSION ${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH} + SOVERSION ${PACKAGE_VERSION_MAJOR} LIBRARY_OUTPUT_NAME SlsReceiver LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin PUBLIC_HEADER "${PUBLICHEADERS}" diff --git a/slsReceiverSoftware/include/sls/CircularFifo.h b/slsReceiverSoftware/include/sls/CircularFifo.h index b3f81233d..03f867882 100644 --- a/slsReceiverSoftware/include/sls/CircularFifo.h +++ b/slsReceiverSoftware/include/sls/CircularFifo.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once /* CircularFifo.h * Code & platform dependent issues with it was originally diff --git a/slsReceiverSoftware/include/sls/Receiver.h b/slsReceiverSoftware/include/sls/Receiver.h index dabc05a48..0cae1327c 100644 --- a/slsReceiverSoftware/include/sls/Receiver.h +++ b/slsReceiverSoftware/include/sls/Receiver.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/sls_detector_defs.h" #include diff --git a/slsReceiverSoftware/src/BinaryDataFile.cpp b/slsReceiverSoftware/src/BinaryDataFile.cpp index 731adae3d..d93fbc46c 100644 --- a/slsReceiverSoftware/src/BinaryDataFile.cpp +++ b/slsReceiverSoftware/src/BinaryDataFile.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "BinaryDataFile.h" BinaryDataFile::BinaryDataFile(const int index) : File(BINARY), index_(index) {} diff --git a/slsReceiverSoftware/src/BinaryDataFile.h b/slsReceiverSoftware/src/BinaryDataFile.h index a76a5003b..f129050a6 100644 --- a/slsReceiverSoftware/src/BinaryDataFile.h +++ b/slsReceiverSoftware/src/BinaryDataFile.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "File.h" diff --git a/slsReceiverSoftware/src/BinaryMasterFile.cpp b/slsReceiverSoftware/src/BinaryMasterFile.cpp index 2c03309af..eedf88879 100644 --- a/slsReceiverSoftware/src/BinaryMasterFile.cpp +++ b/slsReceiverSoftware/src/BinaryMasterFile.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "BinaryMasterFile.h" #include "MasterAttributes.h" diff --git a/slsReceiverSoftware/src/BinaryMasterFile.h b/slsReceiverSoftware/src/BinaryMasterFile.h index a779328f1..909634c71 100644 --- a/slsReceiverSoftware/src/BinaryMasterFile.h +++ b/slsReceiverSoftware/src/BinaryMasterFile.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "File.h" diff --git a/slsReceiverSoftware/src/ClientInterface.cpp b/slsReceiverSoftware/src/ClientInterface.cpp index b6cb23af2..541c14757 100644 --- a/slsReceiverSoftware/src/ClientInterface.cpp +++ b/slsReceiverSoftware/src/ClientInterface.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "ClientInterface.h" #include "sls/ServerSocket.h" #include "sls/StaticVector.h" @@ -1025,14 +1027,14 @@ int ClientInterface::set_flip_rows(Interface &socket) { throw RuntimeError("Could not set flip rows. Invalid argument: " + std::to_string(arg)); } - verifyIdle(socket); - LOG(logDEBUG1) << "Setting flip rows:" << arg; - impl()->setFlipRows(static_cast(arg)); + verifyIdle(socket); + LOG(logDEBUG1) << "Setting flip rows:" << arg; + impl()->setFlipRows(static_cast(arg)); - int retval = impl()->getFlipRows(); - validate(arg, retval, std::string("set flip rows"), DEC); - LOG(logDEBUG1) << "Flip rows:" << retval; - return socket.sendResult(retval); + int retval = impl()->getFlipRows(); + validate(arg, retval, std::string("set flip rows"), DEC); + LOG(logDEBUG1) << "Flip rows:" << retval; + return socket.sendResult(retval); } int ClientInterface::set_file_format(Interface &socket) { @@ -1370,7 +1372,8 @@ int ClientInterface::set_read_n_rows(Interface &socket) { if (arg >= 0) { verifyIdle(socket); if (detType != EIGER && detType != JUNGFRAU) { - throw RuntimeError("Could not set number of rows. Not implemented for this detector"); + throw RuntimeError("Could not set number of rows. Not implemented " + "for this detector"); } LOG(logDEBUG1) << "Setting number of rows:" << arg; impl()->setReadNRows(arg); @@ -1697,4 +1700,3 @@ int ClientInterface::set_detector_datastream(Interface &socket) { impl()->setDetectorDataStream(port, enable); return socket.Send(OK); } - diff --git a/slsReceiverSoftware/src/ClientInterface.h b/slsReceiverSoftware/src/ClientInterface.h index d362edabd..6fd30cb98 100644 --- a/slsReceiverSoftware/src/ClientInterface.h +++ b/slsReceiverSoftware/src/ClientInterface.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "Implementation.h" #include "receiver_defs.h" @@ -162,7 +164,6 @@ class ClientInterface : private virtual slsDetectorDefs { int set_all_threshold(sls::ServerInterface &socket); int set_detector_datastream(sls::ServerInterface &socket); - Implementation *impl() { if (receiver != nullptr) { return receiver.get(); diff --git a/slsReceiverSoftware/src/DataProcessor.cpp b/slsReceiverSoftware/src/DataProcessor.cpp index 2a420f924..cb0f84766 100644 --- a/slsReceiverSoftware/src/DataProcessor.cpp +++ b/slsReceiverSoftware/src/DataProcessor.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package /************************************************ * @file DataProcessor.cpp * @short creates data processor thread that diff --git a/slsReceiverSoftware/src/DataProcessor.h b/slsReceiverSoftware/src/DataProcessor.h index 0d51e6a14..a76029fe7 100644 --- a/slsReceiverSoftware/src/DataProcessor.h +++ b/slsReceiverSoftware/src/DataProcessor.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once /************************************************ * @file DataProcessor.h @@ -26,11 +28,11 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject { public: DataProcessor(int index, detectorType detectorType, Fifo *fifo, - bool *activated, bool *dataStreamEnable, uint32_t *streamingFrequency, - uint32_t *streamingTimerInMs, uint32_t *streamingStartFnum, - bool *framePadding, std::vector *ctbDbitList, - int *ctbDbitOffset, int *ctbAnalogDataBytes, - std::mutex *hdf5Lib); + bool *activated, bool *dataStreamEnable, + uint32_t *streamingFrequency, uint32_t *streamingTimerInMs, + uint32_t *streamingStartFnum, bool *framePadding, + std::vector *ctbDbitList, int *ctbDbitOffset, + int *ctbAnalogDataBytes, std::mutex *hdf5Lib); ~DataProcessor() override; @@ -59,10 +61,8 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject { const int numUnitsPerReadout, const uint32_t udpPortNumber, const uint32_t maxFramesPerFile, - const uint64_t numImages, - const uint32_t dynamicRange, - const bool detectorDataStream - ); + const uint64_t numImages, const uint32_t dynamicRange, + const bool detectorDataStream); #ifdef HDF5C uint32_t GetFilesInAcquisition() const; void CreateVirtualFile(const std::string filePath, diff --git a/slsReceiverSoftware/src/DataStreamer.cpp b/slsReceiverSoftware/src/DataStreamer.cpp index d5ad9763e..f3699a752 100644 --- a/slsReceiverSoftware/src/DataStreamer.cpp +++ b/slsReceiverSoftware/src/DataStreamer.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package /************************************************ * @file DataStreamer.cpp * @short streams data from receiver via ZMQ @@ -191,8 +193,8 @@ void DataStreamer::ProcessAnImage(char *buf) { } if (!zmqSocket->SendData( buf + FIFO_HEADER_NUMBYTES + sizeof(sls_receiver_header), - (uint32_t)( - *((uint32_t *)buf)))) { // new size possibly from callback + (uint32_t)(*( + (uint32_t *)buf)))) { // new size possibly from callback LOG(logERROR) << "Could not send zmq data for fnum " << fnum << " and streamer " << index; } diff --git a/slsReceiverSoftware/src/DataStreamer.h b/slsReceiverSoftware/src/DataStreamer.h index da598ebd3..ea4505c99 100644 --- a/slsReceiverSoftware/src/DataStreamer.h +++ b/slsReceiverSoftware/src/DataStreamer.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once /************************************************ * @file DataStreamer.h diff --git a/slsReceiverSoftware/src/Fifo.cpp b/slsReceiverSoftware/src/Fifo.cpp index f8b1460ef..8221831e5 100644 --- a/slsReceiverSoftware/src/Fifo.cpp +++ b/slsReceiverSoftware/src/Fifo.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package /************************************************ * @file Fifo.cpp * @short constructs the fifo structure diff --git a/slsReceiverSoftware/src/Fifo.h b/slsReceiverSoftware/src/Fifo.h index b777c3628..c8a98ca0c 100644 --- a/slsReceiverSoftware/src/Fifo.h +++ b/slsReceiverSoftware/src/Fifo.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once /************************************************ * @file Fifo.h diff --git a/slsReceiverSoftware/src/File.cpp b/slsReceiverSoftware/src/File.cpp index caa5ea93a..74b587515 100644 --- a/slsReceiverSoftware/src/File.cpp +++ b/slsReceiverSoftware/src/File.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "File.h" #include diff --git a/slsReceiverSoftware/src/File.h b/slsReceiverSoftware/src/File.h index 57bd31e93..da7af6ce9 100644 --- a/slsReceiverSoftware/src/File.h +++ b/slsReceiverSoftware/src/File.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/logger.h" diff --git a/slsReceiverSoftware/src/GeneralData.h b/slsReceiverSoftware/src/GeneralData.h index 4e577b08d..1120918f4 100644 --- a/slsReceiverSoftware/src/GeneralData.h +++ b/slsReceiverSoftware/src/GeneralData.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once /************************************************ * @file GeneralData.h diff --git a/slsReceiverSoftware/src/HDF5DataFile.cpp b/slsReceiverSoftware/src/HDF5DataFile.cpp index 270924fc1..758d70d7b 100644 --- a/slsReceiverSoftware/src/HDF5DataFile.cpp +++ b/slsReceiverSoftware/src/HDF5DataFile.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "HDF5DataFile.h" #include "receiver_defs.h" diff --git a/slsReceiverSoftware/src/HDF5DataFile.h b/slsReceiverSoftware/src/HDF5DataFile.h index fdc68e148..a2e2aa78a 100644 --- a/slsReceiverSoftware/src/HDF5DataFile.h +++ b/slsReceiverSoftware/src/HDF5DataFile.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "File.h" diff --git a/slsReceiverSoftware/src/HDF5MasterFile.cpp b/slsReceiverSoftware/src/HDF5MasterFile.cpp index eb9b69e73..2c3721501 100644 --- a/slsReceiverSoftware/src/HDF5MasterFile.cpp +++ b/slsReceiverSoftware/src/HDF5MasterFile.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "HDF5MasterFile.h" #include "MasterAttributes.h" diff --git a/slsReceiverSoftware/src/HDF5MasterFile.h b/slsReceiverSoftware/src/HDF5MasterFile.h index 01b5bfb45..5fb5dad26 100644 --- a/slsReceiverSoftware/src/HDF5MasterFile.h +++ b/slsReceiverSoftware/src/HDF5MasterFile.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "File.h" diff --git a/slsReceiverSoftware/src/HDF5VirtualFile.cpp b/slsReceiverSoftware/src/HDF5VirtualFile.cpp index 9a988e275..71ef51099 100644 --- a/slsReceiverSoftware/src/HDF5VirtualFile.cpp +++ b/slsReceiverSoftware/src/HDF5VirtualFile.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "HDF5VirtualFile.h" #include "receiver_defs.h" diff --git a/slsReceiverSoftware/src/HDF5VirtualFile.h b/slsReceiverSoftware/src/HDF5VirtualFile.h index 1ab64094e..a479bce2d 100644 --- a/slsReceiverSoftware/src/HDF5VirtualFile.h +++ b/slsReceiverSoftware/src/HDF5VirtualFile.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "File.h" diff --git a/slsReceiverSoftware/src/Implementation.cpp b/slsReceiverSoftware/src/Implementation.cpp index 8e4976d54..75d820c7f 100644 --- a/slsReceiverSoftware/src/Implementation.cpp +++ b/slsReceiverSoftware/src/Implementation.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "Implementation.h" #include "DataProcessor.h" #include "DataStreamer.h" @@ -169,10 +171,10 @@ void Implementation::setDetectorType(const detectorType d) { &actualUDPSocketBufferSize, &framesPerFile, &frameDiscardMode, &activated, &detectorDataStream[i], &silentMode)); dataProcessor.push_back(sls::make_unique( - i, detType, fifo_ptr, &activated, - &dataStreamEnable, &streamingFrequency, &streamingTimerInMs, - &streamingStartFnum, &framePadding, &ctbDbitList, - &ctbDbitOffset, &ctbAnalogDataBytes, &hdf5Lib)); + i, detType, fifo_ptr, &activated, &dataStreamEnable, + &streamingFrequency, &streamingTimerInMs, &streamingStartFnum, + &framePadding, &ctbDbitList, &ctbDbitOffset, + &ctbAnalogDataBytes, &hdf5Lib)); } catch (...) { listener.clear(); dataProcessor.clear(); @@ -619,10 +621,10 @@ void Implementation::stopReceiver() { } if (!detectorDataStream[0]) { LOG(logINFORED) << "Deactivated Left Port"; - } - if (!detectorDataStream[1]) { + } + if (!detectorDataStream[1]) { LOG(logINFORED) << "Deactivated Right Port"; - } + } // callback if (acquisitionFinishedCallBack) { try { @@ -808,8 +810,8 @@ void Implementation::SetupWriter() { dataProcessor[i]->CreateFirstFiles( masterAttributes.get(), filePath, fileName, fileIndex, overwriteEnable, silentMode, modulePos, numThreads, - udpPortNum[i], framesPerFile, numberOfTotalFrames, - dynamicRange, detectorDataStream[i]); + udpPortNum[i], framesPerFile, numberOfTotalFrames, dynamicRange, + detectorDataStream[i]); } } catch (const sls::RuntimeError &e) { shutDownUDPSockets(); @@ -880,12 +882,13 @@ void Implementation::setNumberofUDPInterfaces(const int n) { i, detType, fifo_ptr, &status, &udpPortNum[i], ð[i], &numberOfTotalFrames, &udpSocketBufferSize, &actualUDPSocketBufferSize, &framesPerFile, - &frameDiscardMode, &activated, &detectorDataStream[i], &silentMode)); + &frameDiscardMode, &activated, &detectorDataStream[i], + &silentMode)); listener[i]->SetGeneralData(generalData); dataProcessor.push_back(sls::make_unique( - i, detType, fifo_ptr, &activated, - &dataStreamEnable, &streamingFrequency, &streamingTimerInMs, + i, detType, fifo_ptr, &activated, &dataStreamEnable, + &streamingFrequency, &streamingTimerInMs, &streamingStartFnum, &framePadding, &ctbDbitList, &ctbDbitOffset, &ctbAnalogDataBytes, &hdf5Lib)); dataProcessor[i]->SetGeneralData(generalData); diff --git a/slsReceiverSoftware/src/Implementation.h b/slsReceiverSoftware/src/Implementation.h index 99708fb86..5e5baf863 100644 --- a/slsReceiverSoftware/src/Implementation.h +++ b/slsReceiverSoftware/src/Implementation.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "receiver_defs.h" #include "sls/container_utils.h" @@ -212,8 +214,10 @@ class Implementation : private virtual slsDetectorDefs { * padding is enabled (as it will receive nothing from detector) */ void setActivate(const bool enable); bool getDetectorDataStream(const portPosition port) const; - /** [Eiger] If datastream is disabled, receiver will create dummy data if deactivated - * padding for that port is enabled (as it will receive nothing from detector) */ + /** [Eiger] If datastream is disabled, receiver will create dummy data if + * deactivated + * padding for that port is enabled (as it will receive nothing from + * detector) */ void setDetectorDataStream(const portPosition port, const bool enable); int getReadNRows() const; /* [Eiger][Jungfrau] */ diff --git a/slsReceiverSoftware/src/Listener.cpp b/slsReceiverSoftware/src/Listener.cpp index 0a907f786..2e744bd8a 100644 --- a/slsReceiverSoftware/src/Listener.cpp +++ b/slsReceiverSoftware/src/Listener.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package /************************************************ * @file Listener.cpp * @short creates the listener thread that @@ -22,7 +24,7 @@ const std::string Listener::TypeName = "Listener"; Listener::Listener(int ind, detectorType dtype, Fifo *f, std::atomic *s, uint32_t *portno, std::string *e, uint64_t *nf, int *us, int *as, uint32_t *fpf, - frameDiscardPolicy *fdp, bool *act, bool* detds, bool *sm) + frameDiscardPolicy *fdp, bool *act, bool *detds, bool *sm) : ThreadObject(ind, TypeName), fifo(f), myDetectorType(dtype), status(s), udpPortNumber(portno), eth(e), numImages(nf), udpSocketBufferSize(us), actualUDPSocketBufferSize(as), framesPerFile(fpf), frameDiscardMode(fdp), @@ -201,7 +203,8 @@ void Listener::ThreadExecution() { << std::hex << (void *)(buffer) << std::dec << ":" << buffer; // udpsocket doesnt exist - if (*activated && *detectorDataStream && !udpSocketAlive && !carryOverFlag) { + if (*activated && *detectorDataStream && !udpSocketAlive && + !carryOverFlag) { // LOG(logERROR) << "Listening_Thread " << index << ": UDP Socket not // created or shut down earlier"; (*((uint32_t *)buffer)) = 0; @@ -210,7 +213,8 @@ void Listener::ThreadExecution() { } // get data - if ((*status != TRANSMITTING && (!(*activated) || !(*detectorDataStream) || udpSocketAlive)) || + if ((*status != TRANSMITTING && + (!(*activated) || !(*detectorDataStream) || udpSocketAlive)) || carryOverFlag) { rc = ListenToAnImage(buffer); } diff --git a/slsReceiverSoftware/src/Listener.h b/slsReceiverSoftware/src/Listener.h index a7e432aa6..7afafcf91 100644 --- a/slsReceiverSoftware/src/Listener.h +++ b/slsReceiverSoftware/src/Listener.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once /************************************************ * @file Listener.h @@ -42,7 +44,8 @@ class Listener : private virtual slsDetectorDefs, public ThreadObject { */ Listener(int ind, detectorType dtype, Fifo *f, std::atomic *s, uint32_t *portno, std::string *e, uint64_t *nf, int *us, int *as, - uint32_t *fpf, frameDiscardPolicy *fdp, bool *act, bool* detds, bool *sm); + uint32_t *fpf, frameDiscardPolicy *fdp, bool *act, bool *detds, + bool *sm); /** * Destructor @@ -187,7 +190,7 @@ class Listener : private virtual slsDetectorDefs, public ThreadObject { bool *activated; /** detector data stream */ - bool* detectorDataStream; + bool *detectorDataStream; /** Silent Mode */ bool *silentMode; diff --git a/slsReceiverSoftware/src/MasterAttributes.h b/slsReceiverSoftware/src/MasterAttributes.h index dff142f09..992a73381 100644 --- a/slsReceiverSoftware/src/MasterAttributes.h +++ b/slsReceiverSoftware/src/MasterAttributes.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "receiver_defs.h" @@ -434,7 +436,7 @@ class EigerMasterAttributes : public MasterAttributes { DataSpace dataspaceAttr = DataSpace(H5S_SCALAR); StrType strdatatype(PredType::C_S1, 256); Attribute attribute = - dataset.createAttribute("Unit", strdatatype, dataspaceAttr); + dataset.createAttribute("Unit", strdatatype, dataspaceAttr); sls::strcpy_safe(c, "eV"); attribute.write(strdatatype, c); } @@ -452,7 +454,7 @@ class EigerMasterAttributes : public MasterAttributes { DataSpace dataspace = DataSpace(H5S_SCALAR); StrType strdatatype(PredType::C_S1, 256); DataSet dataset = - group->createDataSet("Sub Period", strdatatype, dataspace); + group->createDataSet("Sub Period", strdatatype, dataspace); sls::strcpy_safe(c, sls::ToString(subPeriod)); dataset.write(c, strdatatype); } @@ -460,7 +462,7 @@ class EigerMasterAttributes : public MasterAttributes { { DataSpace dataspace = DataSpace(H5S_SCALAR); DataSet dataset = - group->createDataSet("Quad", PredType::NATIVE_INT, dataspace); + group->createDataSet("Quad", PredType::NATIVE_INT, dataspace); dataset.write(&quad, PredType::NATIVE_INT); } // readNRows diff --git a/slsReceiverSoftware/src/MultiReceiverApp.cpp b/slsReceiverSoftware/src/MultiReceiverApp.cpp index ff95b669c..991555ffc 100644 --- a/slsReceiverSoftware/src/MultiReceiverApp.cpp +++ b/slsReceiverSoftware/src/MultiReceiverApp.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package /* Creates the slsMultiReceiver for running multiple receivers form a single * binary */ #include "sls/Receiver.h" diff --git a/slsReceiverSoftware/src/Receiver.cpp b/slsReceiverSoftware/src/Receiver.cpp index 4c2c5f178..ea140981d 100644 --- a/slsReceiverSoftware/src/Receiver.cpp +++ b/slsReceiverSoftware/src/Receiver.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "sls/Receiver.h" #include "ClientInterface.h" #include "sls/container_utils.h" diff --git a/slsReceiverSoftware/src/ReceiverApp.cpp b/slsReceiverSoftware/src/ReceiverApp.cpp index fd4aa6116..3980b01a1 100644 --- a/slsReceiverSoftware/src/ReceiverApp.cpp +++ b/slsReceiverSoftware/src/ReceiverApp.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package /* slsReceiver */ #include "sls/Receiver.h" #include "sls/container_utils.h" diff --git a/slsReceiverSoftware/src/ThreadObject.cpp b/slsReceiverSoftware/src/ThreadObject.cpp index 18477e912..16d17eaf9 100644 --- a/slsReceiverSoftware/src/ThreadObject.cpp +++ b/slsReceiverSoftware/src/ThreadObject.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package /************************************************ * @file ThreadObject.cpp * @short creates/destroys a thread diff --git a/slsReceiverSoftware/src/ThreadObject.h b/slsReceiverSoftware/src/ThreadObject.h index f057c5553..d57857548 100644 --- a/slsReceiverSoftware/src/ThreadObject.h +++ b/slsReceiverSoftware/src/ThreadObject.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once /************************************************ * @file ThreadObject.h diff --git a/slsReceiverSoftware/src/receiver_defs.h b/slsReceiverSoftware/src/receiver_defs.h old mode 100755 new mode 100644 index 13e78f232..7e1982d62 --- a/slsReceiverSoftware/src/receiver_defs.h +++ b/slsReceiverSoftware/src/receiver_defs.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/sls_detector_defs.h" @@ -42,7 +44,7 @@ #define MAX_CHUNKED_IMAGES (1) // parameters to calculate fifo depth -#define SAMPLE_TIME_IN_NS (100000000) // 100ms +#define SAMPLE_TIME_IN_NS (100000000) // 100ms // to differentiate between gotthard and short gotthard #define GOTTHARD_PACKET_SIZE (1286) diff --git a/slsReceiverSoftware/tests/CMakeLists.txt b/slsReceiverSoftware/tests/CMakeLists.txt index 37de24395..e1541a724 100755 --- a/slsReceiverSoftware/tests/CMakeLists.txt +++ b/slsReceiverSoftware/tests/CMakeLists.txt @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package target_sources(tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/test-GeneralData.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test-CircularFifo.cpp diff --git a/slsReceiverSoftware/tests/test-CircularFifo.cpp b/slsReceiverSoftware/tests/test-CircularFifo.cpp index f1614f55a..5da9bf39f 100644 --- a/slsReceiverSoftware/tests/test-CircularFifo.cpp +++ b/slsReceiverSoftware/tests/test-CircularFifo.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "catch.hpp" #include "sls/CircularFifo.h" #include diff --git a/slsReceiverSoftware/tests/test-GeneralData.cpp b/slsReceiverSoftware/tests/test-GeneralData.cpp index 131748072..7a3466eca 100644 --- a/slsReceiverSoftware/tests/test-GeneralData.cpp +++ b/slsReceiverSoftware/tests/test-GeneralData.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "GeneralData.h" #include "catch.hpp" diff --git a/slsSupportLib/CMakeLists.txt b/slsSupportLib/CMakeLists.txt index 78262d5a7..efa8010fc 100755 --- a/slsSupportLib/CMakeLists.txt +++ b/slsSupportLib/CMakeLists.txt @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package set(SOURCES src/string_utils.cpp src/file_utils.cpp @@ -98,6 +100,8 @@ if(SLS_BUILD_SHARED_LIBRARIES) target_link_libraries(slsSupportShared PUBLIC slsSupportObject) set_target_properties(slsSupportShared PROPERTIES + VERSION ${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH} + SOVERSION ${PACKAGE_VERSION_MAJOR} LIBRARY_OUTPUT_NAME SlsSupport LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin PUBLIC_HEADER "${PUBLICHEADERS}" diff --git a/slsSupportLib/include/sls/ClientSocket.h b/slsSupportLib/include/sls/ClientSocket.h index 3a6db7957..dcfc02b25 100644 --- a/slsSupportLib/include/sls/ClientSocket.h +++ b/slsSupportLib/include/sls/ClientSocket.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/DataSocket.h" #include diff --git a/slsSupportLib/include/sls/DataSocket.h b/slsSupportLib/include/sls/DataSocket.h index 79022cb17..01215c20e 100644 --- a/slsSupportLib/include/sls/DataSocket.h +++ b/slsSupportLib/include/sls/DataSocket.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/TypeTraits.h" @@ -51,7 +53,7 @@ class DataSocket { int Send(const std::string &s); // Variadic template to send all arguments - template int SendAll(Args &&... args) { + template int SendAll(Args &&...args) { auto l = std::initializer_list{Send(args)...}; auto sum = std::accumulate(begin(l), end(l), 0); return sum; @@ -84,7 +86,7 @@ class DataSocket { private: int sockfd_ = -1; - int fnum_ {0}; + int fnum_{0}; }; }; // namespace sls diff --git a/slsSupportLib/include/sls/ServerInterface.h b/slsSupportLib/include/sls/ServerInterface.h index 864cd56c1..475201983 100644 --- a/slsSupportLib/include/sls/ServerInterface.h +++ b/slsSupportLib/include/sls/ServerInterface.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/DataSocket.h" diff --git a/slsSupportLib/include/sls/ServerSocket.h b/slsSupportLib/include/sls/ServerSocket.h index 57418a586..a394c0430 100644 --- a/slsSupportLib/include/sls/ServerSocket.h +++ b/slsSupportLib/include/sls/ServerSocket.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/DataSocket.h" diff --git a/slsSupportLib/include/sls/StaticVector.h b/slsSupportLib/include/sls/StaticVector.h index 06b552e2b..22329fe6e 100644 --- a/slsSupportLib/include/sls/StaticVector.h +++ b/slsSupportLib/include/sls/StaticVector.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/ToString.h" #include "sls/TypeTraits.h" diff --git a/slsSupportLib/include/sls/TimeHelper.h b/slsSupportLib/include/sls/TimeHelper.h index 820e91508..8ad6ce103 100644 --- a/slsSupportLib/include/sls/TimeHelper.h +++ b/slsSupportLib/include/sls/TimeHelper.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include diff --git a/slsSupportLib/include/sls/Timer.h b/slsSupportLib/include/sls/Timer.h index 9d4dc59f1..b22909b33 100644 --- a/slsSupportLib/include/sls/Timer.h +++ b/slsSupportLib/include/sls/Timer.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef TIMER_H #define TIMER_H #include diff --git a/slsSupportLib/include/sls/ToString.h b/slsSupportLib/include/sls/ToString.h index bbcd4a6c9..8f8553e44 100644 --- a/slsSupportLib/include/sls/ToString.h +++ b/slsSupportLib/include/sls/ToString.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once /** diff --git a/slsSupportLib/include/sls/TypeTraits.h b/slsSupportLib/include/sls/TypeTraits.h index bd32049e1..cbbeb7bea 100644 --- a/slsSupportLib/include/sls/TypeTraits.h +++ b/slsSupportLib/include/sls/TypeTraits.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include #include diff --git a/slsSupportLib/include/sls/UdpRxSocket.h b/slsSupportLib/include/sls/UdpRxSocket.h index 55acf51e9..646309ef6 100644 --- a/slsSupportLib/include/sls/UdpRxSocket.h +++ b/slsSupportLib/include/sls/UdpRxSocket.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once /* diff --git a/slsSupportLib/include/sls/ZmqSocket.h b/slsSupportLib/include/sls/ZmqSocket.h index e6914f5b5..65523c227 100644 --- a/slsSupportLib/include/sls/ZmqSocket.h +++ b/slsSupportLib/include/sls/ZmqSocket.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once /************************************************ * @file zmqSocket.h diff --git a/slsSupportLib/include/sls/ansi.h b/slsSupportLib/include/sls/ansi.h index d129aa259..b038d598a 100644 --- a/slsSupportLib/include/sls/ansi.h +++ b/slsSupportLib/include/sls/ansi.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #define RED "\x1b[31m" #define GREEN "\x1b[32m" #define YELLOW "\x1b[33m" diff --git a/slsSupportLib/include/sls/bit_utils.h b/slsSupportLib/include/sls/bit_utils.h index c3530ae11..164d1e3b8 100644 --- a/slsSupportLib/include/sls/bit_utils.h +++ b/slsSupportLib/include/sls/bit_utils.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include diff --git a/slsSupportLib/include/sls/container_utils.h b/slsSupportLib/include/sls/container_utils.h index 8e7829e48..08fa534d6 100644 --- a/slsSupportLib/include/sls/container_utils.h +++ b/slsSupportLib/include/sls/container_utils.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #ifndef CONTAINER_UTILS_H #define CONTAINER_UTILS_H @@ -17,7 +19,7 @@ namespace sls { // already available as std::make_unique in C++14 template typename std::enable_if::value, std::unique_ptr>::type -make_unique(Args &&... args) { +make_unique(Args &&...args) { return std::unique_ptr(new T(std::forward(args)...)); } diff --git a/slsSupportLib/include/sls/file_utils.h b/slsSupportLib/include/sls/file_utils.h index 3f330c3b6..cc427a88f 100644 --- a/slsSupportLib/include/sls/file_utils.h +++ b/slsSupportLib/include/sls/file_utils.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/sls_detector_defs.h" diff --git a/slsSupportLib/include/sls/logger.h b/slsSupportLib/include/sls/logger.h index d3b783295..3331fc94c 100644 --- a/slsSupportLib/include/sls/logger.h +++ b/slsSupportLib/include/sls/logger.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once /*Utility to log to console*/ diff --git a/slsSupportLib/include/sls/md5.h b/slsSupportLib/include/sls/md5.h index 08057dcaf..a4f0c8364 100644 --- a/slsSupportLib/include/sls/md5.h +++ b/slsSupportLib/include/sls/md5.h @@ -1,206 +1,4 @@ -/* - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ +// SPDX-License-Identifier: Apache-2.0 /* * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. * @@ -215,36 +13,34 @@ * Removed most of the code that is not relevant for our scope. * Snippets copied from md5_local.h or md32_common.h has been marked */ - #ifndef HEADER_MD5_H -# define HEADER_MD5_H +#define HEADER_MD5_H -# include +#include - -# ifdef __cplusplus +#ifdef __cplusplus /* * Modifications 2021 Paul Scherrer Institut * namespace sls added */ namespace sls { extern "C" { -# endif +#endif /* * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * ! MD5_LONG has to be at least 32 bits wide. ! * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ -# define MD5_LONG unsigned int -# define MD5_CBLOCK 64 -# define MD5_LBLOCK (MD5_CBLOCK/4) -# define MD5_DIGEST_LENGTH 16 +#define MD5_LONG unsigned int +#define MD5_CBLOCK 64 +#define MD5_LBLOCK (MD5_CBLOCK / 4) +#define MD5_DIGEST_LENGTH 16 -/** - * Modification 2021 Paul Scherrer Institut - * Comment from md32_common.h +/** + * Modification 2021 Paul Scherrer Institut + * Comment from md32_common.h */ /*- * This is a generic 32 bit "collector" for message digest algorithms. @@ -301,65 +97,68 @@ extern "C" { * #define HASH_FINAL MD5_Final_SLS * #define HASH_BLOCK_DATA_ORDER md5_block_data_order */ -# define MD32_REG_T int +#define MD32_REG_T int -/** - * Modification 2021 Paul Scherrer Institut - * Made default little endian if big endian not defined +/** + * Modification 2021 Paul Scherrer Institut + * Made default little endian if big endian not defined */ #ifndef DATA_ORDER_IS_BIG_ENDIAN #define DATA_ORDER_IS_LITTLE_ENDIAN #endif -/** - * Modification 2021 Paul Scherrer Institut +/** + * Modification 2021 Paul Scherrer Institut * Macros exported from md32_common.h */ -#define HASH_LONG MD5_LONG -#define HASH_CTX MD5_CTX -#define HASH_CBLOCK MD5_CBLOCK -#define HASH_UPDATE MD5_Update_SLS -#define HASH_TRANSFORM MD5_Transform -#define HASH_FINAL MD5_Final_SLS -#define HASH_BLOCK_DATA_ORDER md5_block_data_order -#define HASH_MAKE_STRING(c,s) do { \ - unsigned long ll; \ - ll=(c)->A; (void)HOST_l2c(ll,(s)); \ - ll=(c)->B; (void)HOST_l2c(ll,(s)); \ - ll=(c)->C; (void)HOST_l2c(ll,(s)); \ - ll=(c)->D; (void)HOST_l2c(ll,(s)); \ - } while (0) -#define ROTATE(a,n) (((a)<<(n))|(((a)&0xffffffff)>>(32-(n)))) +#define HASH_LONG MD5_LONG +#define HASH_CTX MD5_CTX +#define HASH_CBLOCK MD5_CBLOCK +#define HASH_UPDATE MD5_Update_SLS +#define HASH_TRANSFORM MD5_Transform +#define HASH_FINAL MD5_Final_SLS +#define HASH_BLOCK_DATA_ORDER md5_block_data_order +#define HASH_MAKE_STRING(c, s) \ + do { \ + unsigned long ll; \ + ll = (c)->A; \ + (void)HOST_l2c(ll, (s)); \ + ll = (c)->B; \ + (void)HOST_l2c(ll, (s)); \ + ll = (c)->C; \ + (void)HOST_l2c(ll, (s)); \ + ll = (c)->D; \ + (void)HOST_l2c(ll, (s)); \ + } while (0) +#define ROTATE(a, n) (((a) << (n)) | (((a)&0xffffffff) >> (32 - (n)))) #if defined(DATA_ORDER_IS_BIG_ENDIAN) -# define HOST_c2l(c,l) (l =(((unsigned long)(*((c)++)))<<24), \ - l|=(((unsigned long)(*((c)++)))<<16), \ - l|=(((unsigned long)(*((c)++)))<< 8), \ - l|=(((unsigned long)(*((c)++))) ) ) -# define HOST_l2c(l,c) (*((c)++)=(unsigned char)(((l)>>24)&0xff), \ - *((c)++)=(unsigned char)(((l)>>16)&0xff), \ - *((c)++)=(unsigned char)(((l)>> 8)&0xff), \ - *((c)++)=(unsigned char)(((l) )&0xff), \ - l) +#define HOST_c2l(c, l) \ + (l = (((unsigned long)(*((c)++))) << 24), \ + l |= (((unsigned long)(*((c)++))) << 16), \ + l |= (((unsigned long)(*((c)++))) << 8), \ + l |= (((unsigned long)(*((c)++))))) +#define HOST_l2c(l, c) \ + (*((c)++) = (unsigned char)(((l) >> 24) & 0xff), \ + *((c)++) = (unsigned char)(((l) >> 16) & 0xff), \ + *((c)++) = (unsigned char)(((l) >> 8) & 0xff), \ + *((c)++) = (unsigned char)(((l)) & 0xff), l) #elif defined(DATA_ORDER_IS_LITTLE_ENDIAN) -# define HOST_c2l(c,l) (l =(((unsigned long)(*((c)++))) ), \ - l|=(((unsigned long)(*((c)++)))<< 8), \ - l|=(((unsigned long)(*((c)++)))<<16), \ - l|=(((unsigned long)(*((c)++)))<<24) ) -# define HOST_l2c(l,c) (*((c)++)=(unsigned char)(((l) )&0xff), \ - *((c)++)=(unsigned char)(((l)>> 8)&0xff), \ - *((c)++)=(unsigned char)(((l)>>16)&0xff), \ - *((c)++)=(unsigned char)(((l)>>24)&0xff), \ - l) +#define HOST_c2l(c, l) \ + (l = (((unsigned long)(*((c)++)))), \ + l |= (((unsigned long)(*((c)++))) << 8), \ + l |= (((unsigned long)(*((c)++))) << 16), \ + l |= (((unsigned long)(*((c)++))) << 24)) +#define HOST_l2c(l, c) \ + (*((c)++) = (unsigned char)(((l)) & 0xff), \ + *((c)++) = (unsigned char)(((l) >> 8) & 0xff), \ + *((c)++) = (unsigned char)(((l) >> 16) & 0xff), \ + *((c)++) = (unsigned char)(((l) >> 24) & 0xff), l) #endif - - - - typedef struct MD5state_st { MD5_LONG A, B, C, D; MD5_LONG Nl, Nh; @@ -371,15 +170,14 @@ int MD5_Init_SLS(MD5_CTX *c); int MD5_Update_SLS(MD5_CTX *c, const void *data, size_t len); int MD5_Final_SLS(unsigned char *md, MD5_CTX *c); -/** - * Modification 2021 Paul Scherrer Institut - * from md32_common.h +/** + * Modification 2021 Paul Scherrer Institut + * from md32_common.h */ void md5_block_data_order(MD5_CTX *c, const void *p, size_t num); -# ifdef __cplusplus +#ifdef __cplusplus } } // namespace sls -# endif -# endif - +#endif +#endif diff --git a/slsSupportLib/include/sls/md5_helper.h b/slsSupportLib/include/sls/md5_helper.h index 07ef38d8b..54070e3d9 100644 --- a/slsSupportLib/include/sls/md5_helper.h +++ b/slsSupportLib/include/sls/md5_helper.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include diff --git a/slsSupportLib/include/sls/network_utils.h b/slsSupportLib/include/sls/network_utils.h index 68b090651..aeaed5aa9 100644 --- a/slsSupportLib/include/sls/network_utils.h +++ b/slsSupportLib/include/sls/network_utils.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include #include @@ -71,7 +73,7 @@ struct UdpDestination { constexpr bool operator==(const UdpDestination &other) const { return ((entry == other.entry) && (port == other.port) && - (port2 == other.port2) && (ip== other.ip) && + (port2 == other.port2) && (ip == other.ip) && (ip2 == other.ip2) && (mac == other.mac) && (mac2 == other.mac2)); } diff --git a/slsSupportLib/include/sls/sls_detector_defs.h b/slsSupportLib/include/sls/sls_detector_defs.h index e2f6cab32..0f65441b7 100644 --- a/slsSupportLib/include/sls/sls_detector_defs.h +++ b/slsSupportLib/include/sls/sls_detector_defs.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once /************************************************ * @file sls_detector_defs.h @@ -32,10 +34,10 @@ #define MAX_RX_DBIT 64 /** default ports */ -#define DEFAULT_PORTNO 1952 -#define DEFAULT_UDP_PORTNO 50001 -#define DEFAULT_ZMQ_CL_PORTNO 30001 -#define DEFAULT_ZMQ_RX_PORTNO 30001 +#define DEFAULT_PORTNO 1952 +#define DEFAULT_UDP_PORTNO 50001 +#define DEFAULT_ZMQ_CL_PORTNO 30001 +#define DEFAULT_ZMQ_RX_PORTNO 30001 #define DEFAULT_UDP_SRC_PORTNO 32410 #define DEFAULT_UDP_DST_PORTNO 50001 @@ -377,7 +379,13 @@ typedef struct { enum readoutMode { ANALOG_ONLY, DIGITAL_ONLY, ANALOG_AND_DIGITAL }; /** chip speed */ - enum speedLevel { FULL_SPEED, HALF_SPEED, QUARTER_SPEED }; + enum speedLevel { + FULL_SPEED, + HALF_SPEED, + QUARTER_SPEED, + G2_108MHZ, + G2_144MHZ + }; /** * burst mode for gotthard2 @@ -410,7 +418,7 @@ typedef struct { #ifdef __cplusplus enum class streamingInterface { #else - enum streamingInterface { +enum streamingInterface { #endif NONE = 0, LOW_LATENCY_LINK = 1 << 0, @@ -462,36 +470,36 @@ typedef struct { } __attribute__((packed)); struct currentSrcParameters { - int enable_; - int fix_; - int normal_; - uint64_t select_; + int enable; + int fix; + int normal; + uint64_t select; /** [Gotthard2][Jungfrau] disable */ - currentSrcParameters() - : enable_(0), fix_(-1), normal_(-1), select_(0) {} + currentSrcParameters() : enable(0), fix(-1), normal(-1), select(0) {} /** [Gotthard2] enable or disable */ - explicit currentSrcParameters(bool enable) - : enable_(static_cast(enable)), fix_(-1), normal_(-1), - select_(0) {} + explicit currentSrcParameters(bool srcEnable) + : enable(static_cast(srcEnable)), fix(-1), normal(-1), + select(0) {} /** [Jungfrau](chipv1.0) enable current src with fix or no fix, * select is 0 to 63 columns only */ - currentSrcParameters(bool fix, uint64_t select) - : enable_(1), fix_(static_cast(fix)), normal_(-1), - select_(select) {} + currentSrcParameters(bool fixCurrent, uint64_t selectCurrent) + : enable(1), fix(static_cast(fixCurrent)), normal(-1), + select(selectCurrent) {} /** [Jungfrau](chipv1.1) enable current src, fix[fix|no fix], * select is a mask of 63 bits (muliple columns can be selected * simultaneously, normal [normal|low] */ - currentSrcParameters(bool fix, uint64_t select, bool normal) - : enable_(1), fix_(static_cast(fix)), - normal_(static_cast(normal)), select_(select) {} + currentSrcParameters(bool fixCurrent, uint64_t selectCurrent, + bool normalCurrent) + : enable(1), fix(static_cast(fixCurrent)), + normal(static_cast(normalCurrent)), select(selectCurrent) {} bool operator==(const currentSrcParameters &other) const { - return ((enable_ == other.enable_) && (fix_ == other.fix_) && - (normal_ == other.normal_) && (select_ == other.select_)); + return ((enable == other.enable) && (fix == other.fix) && + (normal == other.normal) && (select == other.select)); } } __attribute__((packed)); @@ -560,14 +568,14 @@ inline slsDetectorDefs::streamingInterface operator|(const slsDetectorDefs::streamingInterface &a, const slsDetectorDefs::streamingInterface &b) { return slsDetectorDefs::streamingInterface(static_cast(a) | - static_cast(b)); + static_cast(b)); }; inline slsDetectorDefs::streamingInterface operator&(const slsDetectorDefs::streamingInterface &a, const slsDetectorDefs::streamingInterface &b) { return slsDetectorDefs::streamingInterface(static_cast(a) & - static_cast(b)); + static_cast(b)); }; #endif @@ -645,7 +653,7 @@ struct detParameters { #ifdef __cplusplus struct sls_detector_module { #else - typedef struct { +typedef struct { #endif int serialnumber; /**< is the module serial number */ int nchan; /**< is the number of channels on the module*/ @@ -716,4 +724,3 @@ using Positions = const std::vector &; using defs = slsDetectorDefs; } // namespace sls #endif - diff --git a/slsSupportLib/include/sls/sls_detector_exceptions.h b/slsSupportLib/include/sls/sls_detector_exceptions.h index 4f1407c13..927bb1e29 100644 --- a/slsSupportLib/include/sls/sls_detector_exceptions.h +++ b/slsSupportLib/include/sls/sls_detector_exceptions.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include diff --git a/slsSupportLib/include/sls/sls_detector_funcs.h b/slsSupportLib/include/sls/sls_detector_funcs.h index f6215dce6..300cfbfce 100755 --- a/slsSupportLib/include/sls/sls_detector_funcs.h +++ b/slsSupportLib/include/sls/sls_detector_funcs.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once /************************************************ @@ -249,6 +251,8 @@ enum detFuncs { F_CLEAR_ALL_UDP_DEST, F_GET_UDP_FIRST_DEST, F_SET_UDP_FIRST_DEST, + F_GET_READOUT_SPEED, + F_SET_READOUT_SPEED, NUM_DET_FUNCTIONS, RECEIVER_ENUM_START = 256, /**< detector function should not exceed this @@ -602,7 +606,8 @@ const char* getFunctionNameFromEnum(enum detFuncs func) { case F_CLEAR_ALL_UDP_DEST: return "F_CLEAR_ALL_UDP_DEST"; case F_GET_UDP_FIRST_DEST: return "F_GET_UDP_FIRST_DEST"; case F_SET_UDP_FIRST_DEST: return "F_SET_UDP_FIRST_DEST"; - + case F_GET_READOUT_SPEED: return "F_GET_READOUT_SPEED"; + case F_SET_READOUT_SPEED: return "F_SET_READOUT_SPEED"; case NUM_DET_FUNCTIONS: return "NUM_DET_FUNCTIONS"; case RECEIVER_ENUM_START: return "RECEIVER_ENUM_START"; diff --git a/slsSupportLib/include/sls/string_utils.h b/slsSupportLib/include/sls/string_utils.h index e9135ec05..762a8a3b5 100644 --- a/slsSupportLib/include/sls/string_utils.h +++ b/slsSupportLib/include/sls/string_utils.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include @@ -54,6 +56,7 @@ std::string RemoveUnit(std::string &str); bool is_int(const std::string &s); -bool replace_first(std::string *s, const std::string& substr, const std::string& repl); +bool replace_first(std::string *s, const std::string &substr, + const std::string &repl); } // namespace sls diff --git a/slsSupportLib/include/sls/versionAPI.h b/slsSupportLib/include/sls/versionAPI.h index 0bd059325..489510b31 100644 --- a/slsSupportLib/include/sls/versionAPI.h +++ b/slsSupportLib/include/sls/versionAPI.h @@ -1,13 +1,15 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package /** API versions */ -#define GITBRANCH "udp_numdst" +#define GITBRANCH "6.0.0-rc1" -#define APILIB 0x210917 -#define APIRECEIVER 0x210917 -#define APIGUI 0x210819 -#define APICTB 0x211005 -#define APIGOTTHARD 0x211005 -#define APIGOTTHARD2 0x211005 -#define APIMYTHEN3 0x211005 -#define APIMOENCH 0x210927 -#define APIEIGER 0x211005 -#define APIJUNGFRAU 0x211007 +#define APILIB 0x211008 +#define APIRECEIVER 0x211007 +#define APIGUI 0x210819 +#define APICTB 0x211019 +#define APIGOTTHARD 0x211019 +#define APIGOTTHARD2 0x211019 +#define APIJUNGFRAU 0x211019 +#define APIMYTHEN3 0x211019 +#define APIMOENCH 0x211019 +#define APIEIGER 0x211019 diff --git a/slsSupportLib/src/ClientSocket.cpp b/slsSupportLib/src/ClientSocket.cpp index 827e0f840..fdf41140f 100644 --- a/slsSupportLib/src/ClientSocket.cpp +++ b/slsSupportLib/src/ClientSocket.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "sls/ClientSocket.h" #include "sls/logger.h" #include "sls/sls_detector_defs.h" diff --git a/slsSupportLib/src/DataSocket.cpp b/slsSupportLib/src/DataSocket.cpp index 09c20ebda..02f1c3cdb 100644 --- a/slsSupportLib/src/DataSocket.cpp +++ b/slsSupportLib/src/DataSocket.cpp @@ -1,7 +1,9 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "sls/DataSocket.h" #include "sls/logger.h" -#include "sls/sls_detector_funcs.h" #include "sls/sls_detector_exceptions.h" +#include "sls/sls_detector_funcs.h" #include #include #include @@ -42,9 +44,7 @@ DataSocket &DataSocket::operator=(DataSocket &&move) noexcept { return *this; } -void DataSocket::setFnum(const int fnum) { - fnum_ = fnum; -} +void DataSocket::setFnum(const int fnum) { fnum_ = fnum; } int DataSocket::Receive(void *buffer, size_t size) { // TODO!(Erik) Add sleep? how many reties? @@ -63,7 +63,8 @@ int DataSocket::Receive(void *buffer, size_t size) { } else { std::ostringstream ss; ss << "TCP socket read " << bytes_read << " bytes instead of " - << bytes_expected << " bytes (" << getFunctionNameFromEnum(static_cast(fnum_)) << ')'; + << bytes_expected << " bytes (" + << getFunctionNameFromEnum(static_cast(fnum_)) << ')'; throw sls::SocketError(ss.str()); } } @@ -88,7 +89,8 @@ int DataSocket::Send(const void *buffer, size_t size) { if (bytes_sent != data_size) { std::ostringstream ss; ss << "TCP socket sent " << bytes_sent << " bytes instead of " - << data_size << " bytes (" << getFunctionNameFromEnum(static_cast(fnum_)) << ')'; + << data_size << " bytes (" + << getFunctionNameFromEnum(static_cast(fnum_)) << ')'; throw sls::SocketError(ss.str()); } return bytes_sent; diff --git a/slsSupportLib/src/ServerInterface.cpp b/slsSupportLib/src/ServerInterface.cpp index 7e912ab09..92e3d7a67 100644 --- a/slsSupportLib/src/ServerInterface.cpp +++ b/slsSupportLib/src/ServerInterface.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "sls/ServerInterface.h" #include "sls/logger.h" #include diff --git a/slsSupportLib/src/ServerSocket.cpp b/slsSupportLib/src/ServerSocket.cpp index a9fafa1da..5daf83dc3 100644 --- a/slsSupportLib/src/ServerSocket.cpp +++ b/slsSupportLib/src/ServerSocket.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "sls/ServerSocket.h" #include "sls/ServerInterface.h" diff --git a/slsSupportLib/src/ToString.cpp b/slsSupportLib/src/ToString.cpp index 5441f2e67..bbeea09d5 100644 --- a/slsSupportLib/src/ToString.cpp +++ b/slsSupportLib/src/ToString.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "sls/ToString.h" #include "sls/network_utils.h" @@ -116,25 +118,25 @@ std::ostream &operator<<(std::ostream &os, std::string ToString(const slsDetectorDefs::currentSrcParameters &r) { std::ostringstream oss; - if (r.fix_ < -1 || r.fix_ > 1 || r.normal_ < -1 || r.normal_ > 1) { + if (r.fix < -1 || r.fix > 1 || r.normal < -1 || r.normal > 1) { throw sls::RuntimeError( "Invalid current source parameters. Cannot print."); } oss << '['; - if (r.enable_) { + if (r.enable) { oss << "enabled"; // [jungfrau] - if (r.fix_ != -1) { - oss << (r.fix_ == 1 ? ", fix" : ", nofix"); + if (r.fix != -1) { + oss << (r.fix == 1 ? ", fix" : ", nofix"); } // [jungfrau chip v1.1] - if (r.normal_ != -1) { - oss << ", " << ToStringHex(r.select_, 16); - oss << (r.normal_ == 1 ? ", normal" : ", low"); + if (r.normal != -1) { + oss << ", " << ToStringHex(r.select, 16); + oss << (r.normal == 1 ? ", normal" : ", low"); } // [jungfrau chip v1.0] else { - oss << ", " << r.select_; + oss << ", " << r.select; } } else { oss << "disabled"; @@ -247,6 +249,10 @@ std::string ToString(const defs::speedLevel s) { return std::string("half_speed"); case defs::QUARTER_SPEED: return std::string("quarter_speed"); + case defs::G2_108MHZ: + return std::string("108"); + case defs::G2_144MHZ: + return std::string("144"); default: return std::string("Unknown"); } @@ -703,10 +709,20 @@ template <> defs::detectorSettings StringTo(const std::string &s) { template <> defs::speedLevel StringTo(const std::string &s) { if (s == "full_speed") return defs::FULL_SPEED; + if (s == "0") + return defs::FULL_SPEED; if (s == "half_speed") return defs::HALF_SPEED; + if (s == "1") + return defs::HALF_SPEED; if (s == "quarter_speed") return defs::QUARTER_SPEED; + if (s == "2") + return defs::QUARTER_SPEED; + if (s == "108") + return defs::G2_108MHZ; + if (s == "144") + return defs::G2_144MHZ; throw sls::RuntimeError("Unknown speed " + s); } diff --git a/slsSupportLib/src/UdpRxSocket.cpp b/slsSupportLib/src/UdpRxSocket.cpp index 90ebf284d..18eaf9372 100644 --- a/slsSupportLib/src/UdpRxSocket.cpp +++ b/slsSupportLib/src/UdpRxSocket.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "sls/UdpRxSocket.h" #include "sls/logger.h" #include "sls/network_utils.h" diff --git a/slsSupportLib/src/ZmqSocket.cpp b/slsSupportLib/src/ZmqSocket.cpp index 752934088..5289a1391 100644 --- a/slsSupportLib/src/ZmqSocket.cpp +++ b/slsSupportLib/src/ZmqSocket.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "sls/ZmqSocket.h" #include "sls/logger.h" #include "sls/network_utils.h" //ip diff --git a/slsSupportLib/src/file_utils.cpp b/slsSupportLib/src/file_utils.cpp index a560e6fe0..9c58c5dcf 100644 --- a/slsSupportLib/src/file_utils.cpp +++ b/slsSupportLib/src/file_utils.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "sls/file_utils.h" #include "sls/logger.h" #include "sls/sls_detector_exceptions.h" diff --git a/slsSupportLib/src/md5.c b/slsSupportLib/src/md5.c index b8508620e..55260b339 100644 --- a/slsSupportLib/src/md5.c +++ b/slsSupportLib/src/md5.c @@ -1,206 +1,4 @@ -/* - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ +// SPDX-License-Identifier: Apache-2.0 /* * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * diff --git a/slsSupportLib/src/md5_helper.cpp b/slsSupportLib/src/md5_helper.cpp index 9af895faa..800d7cedc 100644 --- a/slsSupportLib/src/md5_helper.cpp +++ b/slsSupportLib/src/md5_helper.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "sls/md5_helper.h" #include "sls/md5.h" diff --git a/slsSupportLib/src/network_utils.cpp b/slsSupportLib/src/network_utils.cpp index 56507e8f1..3a44b6fef 100644 --- a/slsSupportLib/src/network_utils.cpp +++ b/slsSupportLib/src/network_utils.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "sls/sls_detector_exceptions.h" #include "sls/network_utils.h" diff --git a/slsSupportLib/src/sls_detector_exceptions.cpp b/slsSupportLib/src/sls_detector_exceptions.cpp index c8753e5db..d5a6ca645 100644 --- a/slsSupportLib/src/sls_detector_exceptions.cpp +++ b/slsSupportLib/src/sls_detector_exceptions.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "sls/sls_detector_exceptions.h" #include "sls/logger.h" namespace sls { diff --git a/slsSupportLib/src/string_utils.cpp b/slsSupportLib/src/string_utils.cpp old mode 100755 new mode 100644 index 94b643363..a86003251 --- a/slsSupportLib/src/string_utils.cpp +++ b/slsSupportLib/src/string_utils.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "sls/string_utils.h" #include "sls/container_utils.h" @@ -36,14 +38,14 @@ bool is_int(const std::string &s) { }) == s.end(); } -bool replace_first(std::string *s, const std::string& substr, const std::string& repl){ +bool replace_first(std::string *s, const std::string &substr, + const std::string &repl) { auto pos = s->find(substr); - if (pos != std::string::npos){ + if (pos != std::string::npos) { s->replace(pos, substr.size(), repl); return true; } return false; } - }; // namespace sls \ No newline at end of file diff --git a/slsSupportLib/tests/CMakeLists.txt b/slsSupportLib/tests/CMakeLists.txt index 75d20250c..799847745 100755 --- a/slsSupportLib/tests/CMakeLists.txt +++ b/slsSupportLib/tests/CMakeLists.txt @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package target_sources(tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/test-bit_utils.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test-file_utils.cpp diff --git a/slsSupportLib/tests/test-Sockets.cpp b/slsSupportLib/tests/test-Sockets.cpp index 9b52ef50c..f8d7e80c5 100644 --- a/slsSupportLib/tests/test-Sockets.cpp +++ b/slsSupportLib/tests/test-Sockets.cpp @@ -1,8 +1,9 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "catch.hpp" #include "sls/ClientSocket.h" #include "sls/ServerSocket.h" #include -#include #include #include #include diff --git a/slsSupportLib/tests/test-StaticVector.cpp b/slsSupportLib/tests/test-StaticVector.cpp index 419ebd770..8b5fa7cca 100644 --- a/slsSupportLib/tests/test-StaticVector.cpp +++ b/slsSupportLib/tests/test-StaticVector.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "catch.hpp" #include "sls/StaticVector.h" #include "sls/TypeTraits.h" diff --git a/slsSupportLib/tests/test-Timer.cpp b/slsSupportLib/tests/test-Timer.cpp index d3c80c692..f5733a2de 100644 --- a/slsSupportLib/tests/test-Timer.cpp +++ b/slsSupportLib/tests/test-Timer.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "catch.hpp" #include "sls/Timer.h" diff --git a/slsSupportLib/tests/test-ToString.cpp b/slsSupportLib/tests/test-ToString.cpp index 1fcddb2da..cfc7e70d6 100644 --- a/slsSupportLib/tests/test-ToString.cpp +++ b/slsSupportLib/tests/test-ToString.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "catch.hpp" #include "sls/Pattern.h" #include "sls/TimeHelper.h" @@ -329,5 +331,28 @@ TEST_CASE("streamingInterface") { REQUIRE(ToString(sls::defs::streamingInterface::ETHERNET_10GB) == "10gbe"); REQUIRE(ToString(sls::defs::streamingInterface::LOW_LATENCY_LINK) == "lll"); REQUIRE(ToString(sls::defs::streamingInterface::LOW_LATENCY_LINK | - sls::defs::streamingInterface::ETHERNET_10GB) == "lll, 10gbe"); + sls::defs::streamingInterface::ETHERNET_10GB) == + "lll, 10gbe"); +} + +// Speed level +TEST_CASE("speedLevel to string") { + REQUIRE(ToString(sls::defs::speedLevel::FULL_SPEED) == "full_speed"); + REQUIRE(ToString(sls::defs::speedLevel::HALF_SPEED) == "half_speed"); + REQUIRE(ToString(sls::defs::speedLevel::QUARTER_SPEED) == "quarter_speed"); + REQUIRE(ToString(sls::defs::speedLevel::G2_108MHZ) == "108"); + REQUIRE(ToString(sls::defs::speedLevel::G2_144MHZ) == "144"); +} + +TEST_CASE("string to speedLevel") { + REQUIRE(StringTo("full_speed") == + sls::defs::speedLevel::FULL_SPEED); + REQUIRE(StringTo("half_speed") == + sls::defs::speedLevel::HALF_SPEED); + REQUIRE(StringTo("quarter_speed") == + sls::defs::speedLevel::QUARTER_SPEED); + REQUIRE(StringTo("108") == + sls::defs::speedLevel::G2_108MHZ); + REQUIRE(StringTo("144") == + sls::defs::speedLevel::G2_144MHZ); } \ No newline at end of file diff --git a/slsSupportLib/tests/test-TypeTraits.cpp b/slsSupportLib/tests/test-TypeTraits.cpp index e6cb3104d..7e8190f28 100644 --- a/slsSupportLib/tests/test-TypeTraits.cpp +++ b/slsSupportLib/tests/test-TypeTraits.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "catch.hpp" #include "sls/TypeTraits.h" #include diff --git a/slsSupportLib/tests/test-UdpRxSocket.cpp b/slsSupportLib/tests/test-UdpRxSocket.cpp index 05450d114..cca5373c7 100644 --- a/slsSupportLib/tests/test-UdpRxSocket.cpp +++ b/slsSupportLib/tests/test-UdpRxSocket.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "catch.hpp" #include "sls/UdpRxSocket.h" #include "sls/sls_detector_exceptions.h" diff --git a/slsSupportLib/tests/test-ZmqSocket.cpp b/slsSupportLib/tests/test-ZmqSocket.cpp index 92dc2c102..5dc51ddc0 100644 --- a/slsSupportLib/tests/test-ZmqSocket.cpp +++ b/slsSupportLib/tests/test-ZmqSocket.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "catch.hpp" #include "sls/ZmqSocket.h" diff --git a/slsSupportLib/tests/test-bit_utils.cpp b/slsSupportLib/tests/test-bit_utils.cpp index 9039e2aef..2205c46df 100644 --- a/slsSupportLib/tests/test-bit_utils.cpp +++ b/slsSupportLib/tests/test-bit_utils.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "catch.hpp" #include "sls/bit_utils.h" #include diff --git a/slsSupportLib/tests/test-container_utils.cpp b/slsSupportLib/tests/test-container_utils.cpp index 25ad3c331..f791223c9 100644 --- a/slsSupportLib/tests/test-container_utils.cpp +++ b/slsSupportLib/tests/test-container_utils.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "catch.hpp" #include "sls/container_utils.h" #include diff --git a/slsSupportLib/tests/test-file_utils.cpp b/slsSupportLib/tests/test-file_utils.cpp index b4f71cfb9..49544c83c 100644 --- a/slsSupportLib/tests/test-file_utils.cpp +++ b/slsSupportLib/tests/test-file_utils.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "catch.hpp" #include "sls/file_utils.h" #include diff --git a/slsSupportLib/tests/test-logger.cpp b/slsSupportLib/tests/test-logger.cpp index aa6814d89..c1997c1f6 100644 --- a/slsSupportLib/tests/test-logger.cpp +++ b/slsSupportLib/tests/test-logger.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "catch.hpp" #include "sls/logger.h" #include diff --git a/slsSupportLib/tests/test-network_utils.cpp b/slsSupportLib/tests/test-network_utils.cpp index a6464d2b4..0035a6cca 100644 --- a/slsSupportLib/tests/test-network_utils.cpp +++ b/slsSupportLib/tests/test-network_utils.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "catch.hpp" #include "sls/network_utils.h" @@ -112,19 +114,16 @@ TEST_CASE("Copy construct a MacAddr") { CHECK(addr == addr2); } - -TEST_CASE("udp dst struct basic properties"){ +TEST_CASE("udp dst struct basic properties") { static_assert(sizeof(UdpDestination) == 36); UdpDestination dst{}; - REQUIRE(dst.entry == 0); - REQUIRE(dst.port == 0); - REQUIRE(dst.port2 == 0); - REQUIRE(dst.ip == 0); - REQUIRE(dst.ip2 == 0); - REQUIRE(dst.mac == 0); - REQUIRE(dst.mac2 == 0); - + REQUIRE(dst.entry == 0); + REQUIRE(dst.port == 0); + REQUIRE(dst.port2 == 0); + REQUIRE(dst.ip == 0); + REQUIRE(dst.ip2 == 0); + REQUIRE(dst.mac == 0); + REQUIRE(dst.mac2 == 0); } - // TODO!(Erik) Look up a real hostname and verify the IP diff --git a/slsSupportLib/tests/test-sls_detector_defs.cpp b/slsSupportLib/tests/test-sls_detector_defs.cpp index fd5001808..077c9ecfa 100644 --- a/slsSupportLib/tests/test-sls_detector_defs.cpp +++ b/slsSupportLib/tests/test-sls_detector_defs.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "catch.hpp" #include "sls/sls_detector_defs.h" diff --git a/slsSupportLib/tests/test-string_utils.cpp b/slsSupportLib/tests/test-string_utils.cpp index 941167701..860f155bd 100644 --- a/slsSupportLib/tests/test-string_utils.cpp +++ b/slsSupportLib/tests/test-string_utils.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "catch.hpp" #include "sls/logger.h" #include @@ -76,29 +78,28 @@ TEST_CASE("Check is string is integer") { REQUIRE_FALSE(sls::is_int("")); } - -TEST_CASE("Replace substring in string"){ +TEST_CASE("Replace substring in string") { std::string s = "this string should be replaced"; auto r = sls::replace_first(&s, "string ", ""); REQUIRE(r == true); REQUIRE(s == "this should be replaced"); } -TEST_CASE("Replace --help in command"){ +TEST_CASE("Replace --help in command") { std::string s = "sls_detector_get --help exptime"; auto r = sls::replace_first(&s, " --help", ""); REQUIRE(r == true); REQUIRE(s == "sls_detector_get exptime"); } -TEST_CASE("Replace -h in command"){ +TEST_CASE("Replace -h in command") { std::string s = "sls_detector_get -h exptime"; auto r = sls::replace_first(&s, " -h", ""); REQUIRE(r == true); REQUIRE(s == "sls_detector_get exptime"); } -TEST_CASE("replace --help"){ +TEST_CASE("replace --help") { std::string s = "list --help"; auto r = sls::replace_first(&s, " --help", ""); REQUIRE(r == true); diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 28adb9855..9c4cc368a 100755 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package include_directories( ${PROJECT_SOURCE_DIR}/libs/catch include diff --git a/tests/include/tests/config.h b/tests/include/tests/config.h index e7192bd52..f6b541cbf 100644 --- a/tests/include/tests/config.h +++ b/tests/include/tests/config.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/sls_detector_defs.h" #include diff --git a/tests/include/tests/globals.h b/tests/include/tests/globals.h index 5eea9a84f..ff7b86a64 100644 --- a/tests/include/tests/globals.h +++ b/tests/include/tests/globals.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include "sls/sls_detector_defs.h" using dt = slsDetectorDefs::detectorType; diff --git a/tests/include/tests/testenum.h b/tests/include/tests/testenum.h index 94ae5c994..64405f12d 100644 --- a/tests/include/tests/testenum.h +++ b/tests/include/tests/testenum.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once #include enum class func_id { read_data, read_int, read_half_data, combined }; diff --git a/tests/src/testclient.cpp b/tests/src/testclient.cpp index c212bfb4a..6607b60d1 100644 --- a/tests/src/testclient.cpp +++ b/tests/src/testclient.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "clara.hpp" #include "sls/ClientSocket.h" #include "sls/sls_detector_exceptions.h" diff --git a/tests/src/testserver.cpp b/tests/src/testserver.cpp index 73262f335..81fcac66f 100644 --- a/tests/src/testserver.cpp +++ b/tests/src/testserver.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package #include "clara.hpp" #include "sls/ServerSocket.h" diff --git a/tests/test.cpp b/tests/test.cpp index 6ec78954e..076f489e7 100644 --- a/tests/test.cpp +++ b/tests/test.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-other +// Copyright (C) 2021 Contributors to the SLS Detector Package // tests-main.cpp // #define CATCH_CONFIG_MAIN // #include "catch.hpp" diff --git a/this_build_bin_path.sh b/this_build_bin_path.sh index 646f4175e..8d0528673 100755 --- a/this_build_bin_path.sh +++ b/this_build_bin_path.sh @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package #echo $# #if [ $# = 0 ]; then # f=$0 diff --git a/updateAPIVersion.sh b/updateAPIVersion.sh index 39b162a8d..499f9c3ed 100755 --- a/updateAPIVersion.sh +++ b/updateAPIVersion.sh @@ -1,7 +1,9 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package #require 2 arguments, API_NAME API_DIR (relative to package) if [ $# -lt 2 ]; then echo "Wrong usage of updateVersion.sh. Requires atleast 2 arguments [API_NAME, API_DIR]" - exit -1 + return [-1] fi API_NAME=$1 diff --git a/updateClientAPI.sh b/updateClientAPI.sh index 055d4233a..c0458574d 100755 --- a/updateClientAPI.sh +++ b/updateClientAPI.sh @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package API_FILE=$PWD/slsSupportLib/include/sls/versionAPI.h arraylength=3