Skip to content
Snippets Groups Projects
Commit 7240a286 authored by Nadeem Shehzad's avatar Nadeem Shehzad
Browse files

initial commit to make branch working.

parent fa0f996d
Branches wip-nshehzad
No related tags found
No related merge requests found
......@@ -39,57 +39,14 @@ include_directories(${HDF5_INCLUDE_DIRS})
message(HDF5_INCLUDE_DIRS=${HDF5_INCLUDE_DIRS})
message(HDF5_CXX_LIBRARIES=${HDF5_CXX_LIBRARIES})
#loop over offline data
option(LADYBUGDOOCSDAQLOOPER "Build ladybug, a daq looper for doocs and h5 files." OFF)
option(LADYBUGGUI "A QtGui in Ladybug" OFF)
option(LADYBUGCHIMERATK "Build ladybug with ChimeraTK" OFF)
#option(LADYBUGGUI "A QtGui in Ladybug" ON)
if(LADYBUGDOOCSDAQLOOPER)
add_definitions(-DLADYBUGDOOCSDAQLOOPER)
find_package(DOOCS 20.00.0 COMPONENTS daqreader eqdaqdatalib daqdatacache REQUIRED)
endif()
if(LADYBUGDOOCSDAQLOOPER AND LADYBUGGUI)
add_definitions(-DLADYBUGGUI)
# ENABLE_LANGUAGE(C)
find_package(Qt5 COMPONENTS Widgets LinguistTools PrintSupport REQUIRED)
set(TS_FILES ${CMAKE_SOURCE_DIR}/tests/ladybug/telViewer/telViewer_en_150.ts)
find_package(ChimeraTK-ApplicationCore 01.12 REQUIRED)
find_package(ChimeraTK-ControlSystemAdapter-DoocsAdapter REQUIRED)
find_package(ChimeraTK-DeviceAccess-DoocsBackend REQUIRED)
find_package(math-utils 02.00.00 REQUIRED)
# set(CMAKE_INCLUDE_CURRENT_DIR ON)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/tests/ladybug/telViewer)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/tests/ladybug/telViewer/qcustomplot-source)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
endif()
#include(${CMAKE_SOURCE_DIR}/cmake/add_dependency.cmake)
message("LADYBUGCHIMERATK set to ${LADYBUGCHIMERATK}.")
if(LADYBUGCHIMERATK)
find_package(ChimeraTK-ApplicationCore 01.12 REQUIRED)
find_package(ChimeraTK-ControlSystemAdapter-DoocsAdapter REQUIRED)
find_package(ChimeraTK-DeviceAccess-DoocsBackend REQUIRED)
find_package(math-utils 02.00.00 REQUIRED)
elseif(NOT LADYBUGCHIMERATK)
find_package(ChimeraTK-ApplicationCore 01.12 REQUIRED)
find_package(ChimeraTK-ControlSystemAdapter-DoocsAdapter REQUIRED)
find_package(ChimeraTK-DeviceAccess-DoocsBackend REQUIRED)
find_package(math-utils 02.00.00 REQUIRED)
message(No ChimeraTK.)
INCLUDE_DIRECTORIES(~/.local/include)
INCLUDE_DIRECTORIES(~/.local/usr/include)
set(CMAKE_INSTALL_RPATH "~/.local/lib")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
endif()
message("If you have a local installation of JSONCPP, you may try 'PKG_CONFIG_PATH=$PKG_CONFIG_PATH:~/.local/lib/pkgconfig'.")
find_package(PkgConfig REQUIRED)
pkg_check_modules(JSONCPP jsoncpp REQUIRED)
link_libraries(${JSONCPP_LIBRARIES})
#PKG_CONFIG_PATH=$PKG_CONFIG_PATH:~/.local/lib/pkgconfig
FIND_PACKAGE(Boost COMPONENTS unit_test_framework REQUIRED)
......@@ -109,7 +66,7 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include headers)
# library for code shared between server executable and tests
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
add_library(tripeventLib ${lib_sources})
add_library(faultAnalysesLib
${CMAKE_SOURCE_DIR}/src/nonlinearParitySpaceMethod.cc
)
......@@ -117,23 +74,25 @@ target_link_libraries(faultAnalysesLib
${HDF5_CXX_LIBRARIES}
${HDF5_LIBRARIES}
${ARMADILLO_LIBRARIES}
ChimeraTK::ChimeraTK-ApplicationCore
)
add_library(tripeventLib ${lib_sources})
target_link_libraries(tripeventLib
${HDF5_CXX_LIBRARIES}
${HDF5_LIBRARIES}
${ARMADILLO_LIBRARIES}
ChimeraTK::ChimeraTK-ApplicationCore
)
# main server executable
message(ChimeraTK-DeviceAccess-DoocsBackend_LIBRARIES=${ChimeraTK-DeviceAccess-DoocsBackend_LIBRARIES})
add_executable(${PROJECT_NAME} ${server_sources})
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS
"${ChimeraTK-ApplicationCore_CXX_FLAGS} ${DOOCS_CXX_FLAGS}")
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS
"${DOOCS_LINKER_FLAGS} ${ChimeraTK-ApplicationCore_LINK_FLAGS} ${ChimeraTK-ControlSystemAdapter-DoocsAdapter_LINK_FLAGS}")
target_link_libraries(${PROJECT_NAME}
tripeventLib
faultAnalysesLib
${ChimeraTK-ApplicationCore_LIBRARIES}
${ChimeraTK-ControlSystemAdapter-DoocsAdapter_LIBRARIES}
${ChimeraTK-DeviceAccess-DoocsBackend_LIBRARIES}
tripeventLib
ChimeraTK::ChimeraTK-ApplicationCore
ChimeraTK::ChimeraTK-ControlSystemAdapter-DoocsAdapter
ChimeraTK::ChimeraTK-DeviceAccess-DoocsBackend
${JSONCPP_LIBRARIES}
${DOOCS_LIBRARIES}
......@@ -144,205 +103,9 @@ target_link_libraries(${PROJECT_NAME}
stdc++
)
# Create the executables for automated unit testing (new modular tests).
# add one test executable per source file
# Split into two groups:
# 1. Tests of ApplicationModules
aux_source_directory(${CMAKE_SOURCE_DIR}/tests appTestExecutables)
foreach( testExecutableSrcFile ${appTestExecutables})
# NAME_WE means the base name without path and (longest) extension
get_filename_component(excutableName ${testExecutableSrcFile} NAME_WE)
add_executable(${excutableName} ${testExecutableSrcFile})
set_target_properties(${excutableName} PROPERTIES COMPILE_FLAGS "${ChimeraTK-ApplicationCore_CXX_FLAGS} ${DOOCS_CXX_FLAGS}")
set_target_properties(${excutableName} PROPERTIES LINK_FLAGS "${DOOCS_LINKER_FLAGS} ${ChimeraTK-ApplicationCore_LINK_FLAGS}")
target_link_libraries(${excutableName}
tripeventLib
faultAnalysesLib
${ChimeraTK-ApplicationCore_LIBRARIES}
${DOOCS_LIBRARIES}
${HDF5_CXX_LIBRARIES}
${HDF5_LIBRARIES}
${ARMADILLO_LIBRARIES}
${HDF5_LIBRARIES}
stdc++fs
)
add_test(${excutableName} ${excutableName})
FILE( COPY ${CMAKE_SOURCE_DIR}/tests/${excutableName}_configuration.xml DESTINATION ${PROJECT_BINARY_DIR})
FILE( COPY ${CMAKE_SOURCE_DIR}/tests/${excutableName}.dmap DESTINATION ${PROJECT_BINARY_DIR})
if(EXISTS ${CMAKE_SOURCE_DIR}/tests/${excutableName}.xlmap)
FILE(COPY ${CMAKE_SOURCE_DIR}/tests/${excutableName}.xlmap DESTINATION ${PROJECT_BINARY_DIR})
endif()
FILE(COPY ${CMAKE_SOURCE_DIR}/tests/empty.xlmap DESTINATION ${PROJECT_BINARY_DIR})
endforeach( testExecutableSrcFile )
#FILE( COPY ${CMAKE_SOURCE_DIR}/tests/test.xlmap DESTINATION ${PROJECT_BINARY_DIR})
# 2. Algorithm tests, do not require an Application
aux_source_directory(${CMAKE_SOURCE_DIR}/tests/algorithms algoTestExecutables)
foreach( testExecutableSrcFile ${algoTestExecutables})
# NAME_WE means the base name without path and (longest) extension
get_filename_component(excutableName ${testExecutableSrcFile} NAME_WE)
add_executable(${excutableName} ${testExecutableSrcFile})
set_target_properties(${excutableName} PROPERTIES COMPILE_FLAGS
"${ChimeraTK-ApplicationCore_CXX_FLAGS} ${DOOCS_CXX_FLAGS}")
set_target_properties(${excutableName} PROPERTIES LINK_FLAGS
"${DOOCS_LINKER_FLAGS} ${ChimeraTK-ApplicationCore_LINK_FLAGS}")
target_link_libraries(${excutableName}
tripeventLib
faultAnalysesLib
${ChimeraTK-ApplicationCore_LIBRARIES}
${DOOCS_LIBRARIES}
${HDF5_CXX_LIBRARIES}
${HDF5_LIBRARIES}
${ARMADILLO_LIBRARIES}
${HDF5_LIBRARIES}
stdc++fs
)
add_test(${excutableName} ${excutableName})
endforeach( testExecutableSrcFile )
# 2. examples tests, do not require an Application
aux_source_directory(${CMAKE_SOURCE_DIR}/tests/examples exampleExecutables)
foreach( testExecutableSrcFile ${exampleExecutables})
# NAME_WE means the base name without path and (longest) extension
get_filename_component(excutableName ${testExecutableSrcFile} NAME_WE)
add_executable(${excutableName} ${testExecutableSrcFile})
set_target_properties(${excutableName} PROPERTIES COMPILE_FLAGS
"${ChimeraTK-ApplicationCore_CXX_FLAGS} ${DOOCS_CXX_FLAGS}")
set_target_properties(${excutableName} PROPERTIES LINK_FLAGS
"${DOOCS_LINKER_FLAGS} ${ChimeraTK-ApplicationCore_LINK_FLAGS}")
target_link_libraries(${excutableName}
tripeventLib
faultAnalysesLib
${ChimeraTK-ApplicationCore_LIBRARIES}
${DOOCS_LIBRARIES}
${HDF5_CXX_LIBRARIES}
${HDF5_LIBRARIES}
${ARMADILLO_LIBRARIES}
${HDF5_LIBRARIES}
stdc++fs
)
add_test(${excutableName} ${excutableName})
endforeach( testExecutableSrcFile )
include_directories("~/.local/include/")
if(LADYBUGDOOCSDAQLOOPER AND LADYBUGGUI)
add_executable(ladybug
${CMAKE_SOURCE_DIR}/tests/ladybug/ladybug.cpp
${CMAKE_SOURCE_DIR}/tests/ladybug/ttf2Looper.cc
${CMAKE_SOURCE_DIR}/tests/ladybug/DataLooper.cpp
${CMAKE_SOURCE_DIR}/tests/ladybug/DataLooper.h
${CMAKE_SOURCE_DIR}/tests/ladybug/telViewer/mainwindow.cpp
${CMAKE_SOURCE_DIR}/tests/ladybug/telViewer/mainwindow.h
${CMAKE_SOURCE_DIR}/tests/ladybug/telViewer/mainwindow.ui
${CMAKE_SOURCE_DIR}/tests/ladybug/telViewer/CavityPlotter.cpp
${CMAKE_SOURCE_DIR}/tests/ladybug/telViewer/CavityPlotter.h
${CMAKE_SOURCE_DIR}/tests/ladybug/telViewer/qcustomplot-source/qcustomplot.cpp
${CMAKE_SOURCE_DIR}/tests/ladybug/telViewer/qcustomplot-source/qcustomplot.h
${TS_FILES}
)
set_target_properties(ladybug PROPERTIES COMPILE_FLAGS
"${DOOCS_CXX_FLAGS}"
# "${ChimeraTK-ApplicationCore_CXX_FLAGS} ${DOOCS_CXX_FLAGS}"
)
set_target_properties(ladybug PROPERTIES LINK_FLAGS
"${DOOCS_LINKER_FLAGS} ${JSONCPP_LINKER_FLAGS}"
# "${DOOCS_LINKER_FLAGS} ${ChimeraTK-ApplicationCore_LINK_FLAGS}"
)
# set_target_properties(ladybug
# PROPERTIES AUTOGEN_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/tests/ladybug/telViewer/)
target_link_libraries(ladybug
PRIVATE Qt5::Widgets Qt5::PrintSupport
PUBLIC
# tripeventLib
faultAnalysesLib
# ${ChimeraTK-ApplicationCore_LIBRARIES}
${JSONCPP_LIBRARIES}
${DOOCS_LIBRARIES}
${HDF5_CXX_LIBRARIES}
${HDF5_LIBRARIES}
${ARMADILLO_LIBRARIES}
stdc++fs
)
elseif(LADYBUGDOOCSDAQLOOPER AND NOT LADYBUGGUI)
add_executable(ladybug
${CMAKE_SOURCE_DIR}/tests/ladybug/ladybug.cpp
${CMAKE_SOURCE_DIR}/tests/ladybug/ttf2Looper.cc
${CMAKE_SOURCE_DIR}/tests/ladybug/DataLooper.cpp
${CMAKE_SOURCE_DIR}/tests/ladybug/DataLooper.h
)
set_target_properties(ladybug PROPERTIES COMPILE_FLAGS
"${DOOCS_CXX_FLAGS}"
# "${ChimeraTK-ApplicationCore_CXX_FLAGS} ${DOOCS_CXX_FLAGS}"
)
set_target_properties(ladybug PROPERTIES LINK_FLAGS
"${DOOCS_LINKER_FLAGS} ${JSONCPP_LINKER_FLAGS}"
# "${DOOCS_LINKER_FLAGS} ${ChimeraTK-ApplicationCore_LINK_FLAGS}"
)
target_link_libraries(ladybug
faultAnalysesLib
${JSONCPP_LIBRARIES}
# tripeventLib
# ${ChimeraTK-ApplicationCore_LIBRARIES}
${DOOCS_LIBRARIES}
${HDF5_CXX_LIBRARIES}
${HDF5_LIBRARIES}
${ARMADILLO_LIBRARIES}
stdc++fs
)
endif()
ENABLE_TESTING()
# copy example configuration to build directory - this is also needed for the tests
EXECUTE_PROCESS(COMMAND ln -snfr ${CMAKE_SOURCE_DIR}/sample_configs/RPC_LIBNO ${PROJECT_BINARY_DIR})
EXECUTE_PROCESS(COMMAND ln -snfr ${CMAKE_SOURCE_DIR}/sample_configs/${PROJECT_BASE_NAME}_server.conf ${PROJECT_BINARY_DIR})
EXECUTE_PROCESS(COMMAND ln -snfr ${CMAKE_SOURCE_DIR}/sample_configs/${PROJECT_BASE_NAME}_server_CONF.TEMPLATE ${PROJECT_BINARY_DIR})
EXECUTE_PROCESS(COMMAND ln -snfr ${CMAKE_SOURCE_DIR}/sample_configs/${PROJECT_BASE_NAME}-DoocsVariableConfig.xml ${PROJECT_BINARY_DIR})
EXECUTE_PROCESS(COMMAND ln -snfr ${CMAKE_SOURCE_DIR}/sample_configs/${PROJECT_BASE_NAME}_configuration.xml ${PROJECT_BINARY_DIR})
EXECUTE_PROCESS(COMMAND ln -snfr ${CMAKE_SOURCE_DIR}/sample_configs/${PROJECT_BASE_NAME}.dmap ${PROJECT_BINARY_DIR})
EXECUTE_PROCESS(COMMAND ln -snfr ${CMAKE_SOURCE_DIR}/sample_configs/${PROJECT_BASE_NAME}.xlmap ${PROJECT_BINARY_DIR})
EXECUTE_PROCESS(COMMAND ln -snfr ${CMAKE_SOURCE_DIR}/identificationCalibrationNominalParameter/Browne/A9.L3.M4.C7.json ${PROJECT_BINARY_DIR})
EXECUTE_PROCESS(COMMAND ln -snfr ${CMAKE_SOURCE_DIR}/identificationCalibrationNominalParameter/A9.csv ${PROJECT_BINARY_DIR})
EXECUTE_PROCESS(COMMAND ln -snfr ${CMAKE_SOURCE_DIR}/tests/ladybug/hdfSnapshots.csv ${PROJECT_BINARY_DIR})
FILE(COPY ${CMAKE_SOURCE_DIR}/sample_configs/llrf_controller.cache DESTINATION ${PROJECT_BINARY_DIR})
FILE(COPY ${CMAKE_SOURCE_DIR}/sample_configs/x2timer.cache DESTINATION ${PROJECT_BINARY_DIR})
# create workdirectories
#ADD_CUSTOM_TARGET( makeWorkdirs
ADD_CUSTOM_TARGET( makeWorkdirs ALL
BYPRODUCTS ${CMAKE_SOURCE_DIR}/workdir
DEPENDS ${PROJECT_NAME}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/sample_configs
COMMAND ${CMAKE_SOURCE_DIR}/sample_configs/generateWorkdirs.sh >/dev/null
COMMENT "Creates working dirs"
)
#
## Files needed for testing.
configure_file(identificationCalibrationNominalParameter/FLASH.RF.ACC67.M1.C1_nomPara.json
${CMAKE_BINARY_DIR}/FLASH.RF.ACC67.M1.C1_nomPara.json
COPYONLY)
configure_file(identificationCalibrationNominalParameter/XFEL.RF.A17.L3.M1.C1_nomPara.json
${CMAKE_BINARY_DIR}/XFEL.RF.A17.L3.M1.C1_nomPara.json
COPYONLY)
include(${CMAKE_SOURCE_DIR}/cmake/enable_code_coverage_report.cmake)
#include(${CMAKE_SOURCE_DIR}/cmake/enable_doxygen_documentation.cmake)
# Install the executable, the server_rpc file, the dmap file and the mapp file.
install(PROGRAMS ${PROJECT_BINARY_DIR}/ladybug DESTINATION bin)
if("${CMAKE_INSTALL_PREFIX}" STREQUAL "/export/doocs/server")
install(PROGRAMS ${PROJECT_BINARY_DIR}/${PROJECT_NAME} DESTINATION ${PROJECT_BASE_NAME}_server RENAME ${PROJECT_BASE_NAME}_server.dist)
install(FILES ${PROJECT_BINARY_DIR}/RPC_LIBNO DESTINATION ${PROJECT_BASE_NAME}_server)
install(FILES ${PROJECT_BINARY_DIR}/${PROJECT_BASE_NAME}_server_CONF.TEMPLATE DESTINATION ${PROJECT_BASE_NAME}_server)
install(FILES ${PROJECT_BINARY_DIR}/${PROJECT_BASE_NAME}_configuration.xml DESTINATION ${PROJECT_BASE_NAME}_server)
install(FILES ${PROJECT_BINARY_DIR}/${PROJECT_BASE_NAME}.dmap DESTINATION ${PROJECT_BASE_NAME}_server)
else()
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin)
install(FILES ${PROJECT_BINARY_DIR}/RPC_LIBNO DESTINATION bin)
install(FILES ${PROJECT_BINARY_DIR}/${PROJECT_BASE_NAME}_server_CONF.TEMPLATE DESTINATION bin)
install(FILES ${PROJECT_BINARY_DIR}/${PROJECT_BASE_NAME}_configuration.xml DESTINATION bin)
install(FILES ${PROJECT_BINARY_DIR}/${PROJECT_BASE_NAME}.dmap DESTINATION bin)
endif()
#add_executable(${PROJECT_NAME}-xmlGenerator ${server_sources})
#set_target_properties( ${PROJECT_NAME}-xmlGenerator PROPERTIES COMPILE_FLAGS "-DGENERATE_XML")
#target_link_libraries(${PROJECT_NAME}-xmlGenerator faultAnalysesLib tripeventLib
# ChimeraTK::ChimeraTK-ApplicationCore
# ChimeraTK::ChimeraTK-DeviceAccess-DoocsBackend
# )
......@@ -30,7 +30,7 @@ class FaultStateBaseModule : public ChimeraTK::ApplicationModule {
void mainLoop() override;
TripEventReportGroup tripReport{this, "tripReport", "", ChimeraTK::HierarchyModifier::hideThis, {"CS"}};
TripEventReportGroup tripReport{this, "tripReport", "", {"CS"}};
private:
TripEventReportGroup::FaultStates faultStateBevor;
......
......@@ -11,17 +11,14 @@
#include <string>
struct tripeventLoggerApp : public ChimeraTK::Application {
tripeventLoggerApp(const std::string& name = "tripeventLogger") : Application(name) {
std::cout << "name: " << name << std::endl;
//ChimeraTK::setDMapFilePath(name + ".dmap");
}
tripeventLoggerApp(const std::string& name);
using ChimeraTK::Application::Application;
~tripeventLoggerApp() {
shutdown();
}
ChimeraTK::SetDMapFilePath dmapPath{getName() + ".dmap"};
ChimeraTK::SetDMapFilePath dmap{getName() + ".dmap"};
std::vector<FlatTopFaultStates> flatTopFaultStates;
......@@ -32,11 +29,11 @@ struct tripeventLoggerApp : public ChimeraTK::Application {
ChimeraTK::ConfigReader config{this, "Configuration", getName() + "_configuration.xml"};
ChimeraTK::DeviceModule tripEventLoggerDevice{this, "TRIPEVENTLOG"};
ChimeraTK::DeviceModule tripEventLoggerDevice{this, "TRIPEVENTLOG","/C1_M1_A17_L3_PS/trigger"};
FaultStateCollector faultStateCollector; // need to instantiate after all fault states etc.
void defineConnections();
void defineConnections() ;
};
#endif // TRIPEVENTLOGGERAPP_H
......@@ -14,10 +14,10 @@ struct TripEventReportGroup : public ChimeraTK::VariableGroup {
ChimeraTK::ScalarPollInput<std::string> name{this, "name", "", "", {"CS"}};
ChimeraTK::ScalarPollInput<std::string> place{this, "place", "", "", {"CS"}};
ChimeraTK::ScalarOutput<int> tripeventState{this, "TRIPEVENT.STATE", "", "", {"CS", "TRIPEVENT"}};
ChimeraTK::ScalarOutput<std::string> tripeventStatus{this, "TRIPEVENT.STATUS", "", "", {"CS", "TRIPEVENT"}};
ChimeraTK::ScalarOutput<std::string> tripeventReport{this, "TRIPEVENT.REPORT", "", "", {"CS", "TRIPEVENT"}};
ChimeraTK::ScalarOutput<std::string> tripeventWarning{this, "TRIPEVENT.WARNING", "", "", {"CS", "TRIPEVENT"}};
ChimeraTK::ScalarOutput<int> tripeventState{this, "TRIPEVENT_STATE", "", "", {"CS", "TRIPEVENT"}};
ChimeraTK::ScalarOutput<std::string> tripeventStatus{this, "TRIPEVENT_STATUS", "", "", {"CS", "TRIPEVENT"}};
ChimeraTK::ScalarOutput<std::string> tripeventReport{this, "TRIPEVENT_REPORT", "", "", {"CS", "TRIPEVENT"}};
ChimeraTK::ScalarOutput<std::string> tripeventWarning{this, "TRIPEVENT_WARNING", "", "", {"CS", "TRIPEVENT"}};
void write(std::string filename);
......
<?xml version="1.0" encoding="UTF-8"?>
<device_server xmlns="https://github.com/ChimeraTK/ControlSystemAdapter-DoocsAdapter">
<location name="C1.M1.A17.L3">
<property source="/C1_M1_A17_L3_PS/TRIPEVENT.REPORT" name="TRIPEVENT.REPORT"></property>
<property source="/C1_M1_A17_L3_PS/TRIPEVENT.WARNING" name="TRIPEVENT.WARNING"></property>
<property source="/C1_M1_A17_L3_PS/TRIPEVENT.STATE" name="TRIPEVENT.STATE"></property>
</location>
<location name="unmapped">
<import>/</import>
</location>
......
......@@ -96,23 +96,4 @@
<module name="C1_M1_A17_L3">
<redirectedRegister name="amplitude">
<targetDevice>DOOCS</targetDevice>
<targetRegister>C1.M1.A17.L3/PROBE.AMPL</targetRegister>
<plugin name="forceReadOnly"/>
<!--<targetDevice>this</targetDevice>
<targetRegister>/C1.M1.A17.L3_PS/amplitude</targetRegister>-->
</redirectedRegister>
<redirectedRegister name="trigger">
<targetDevice>Timer</targetDevice>
<targetRegister>LLA17M/MACRO_PULSE_NUMBER</targetRegister>
<plugin name="forceReadOnly"/>
</redirectedRegister>
</module>
</logicalNameMap>
......@@ -22,6 +22,6 @@
<variable name="postTripLength" type="uint32" value="20"/>
</module>
<variable name="cavityLocations" type="string">
<value i="0" v="C1.M1.A17.L3"/>
<value i="0" v="C1_M1_A17_L3"/>
</variable>
</configuration>
#include "tripEventLoggerApp.h"
static tripeventLoggerApp tripevent_logger_App;
static tripeventLoggerApp tripevent_logger_App ("tripeventLogger");
......@@ -50,6 +50,7 @@ std::pair<TripEventReportGroup::FaultStates, std::string> ParitySpaceFaultStates
state = TripEventReportGroup::FaultStates::info;
userStringStream << " diffTime= " << diffTime;
}
std::cout<<"diffMacroPulseNumber:"<<diffMacroPulseNumber<<std::endl;
if(diffMacroPulseNumber != 1.) {
state = TripEventReportGroup::FaultStates::info;
userStringStream << " MPC= " << diffMacroPulseNumber;
......
#include "tripEventLoggerApp.h"
tripeventLoggerApp::tripeventLoggerApp(const std::string& name): Application(name) {
void tripeventLoggerApp::defineConnections() {
std::vector<std::string> cavityLocations = config.get<std::vector<std::string>>("cavityLocations");
if(config.get<int32_t>("enableFlatTopFaulStates") != 0) {
for(uint32_t index = 0; index < cavityLocations.size(); index++) {
flatTopFaultStates.emplace_back(this, cavityLocations[index], "");
std::cout<<"cavityLocations[index]:"<<cavityLocations[index]<<std::endl;
// This additional manual connection removes the instance name from the variables
// and connects them to the common calues in the "FlatTops" module of the configuration.
// Like this all cavitty threshold are coming from a single config parameter.
......@@ -13,9 +14,11 @@ void tripeventLoggerApp::defineConnections() {
// flatTopFaultStates.back().findTag("FLAT_TOP_CONFIG").connectTo(csModule["Configuration"]["FlatTops"]);
}
}
auto epsfs = config.get<int32_t>("enableParitySpaceFaultStates");
std::cout<<"enableParitySpaceFaultStates:"<<epsfs<<std::endl;
if(config.get<int32_t>("enableParitySpaceFaultStates") != 0) {
for(uint32_t index = 0; index < cavityLocations.size(); index++) {
std::cout<<"cavityLocations[index]:"<<cavityLocations[index]<<std::endl;
// paritySpaceFaultStates.emplace_back(this, cavityLocations[index], "");
paritySpaceFaultStates.emplace_back(this, cavityLocations[index] + "_PS", "");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment