Skip to content
Snippets Groups Projects
Commit 790ac5af authored by Martin Killenberg's avatar Martin Killenberg
Browse files

first version of the reference server with working xml mapping

parent a3ed479a
No related branches found
No related tags found
No related merge requests found
......@@ -67,7 +67,8 @@ if(TESTING_IS_ENABLED)
file(GLOB XML_FILES variable ${CMAKE_SOURCE_DIR}/tests/variableTreeXml/*.xml)
file(COPY ${XML_FILES} DESTINATION ${PROJECT_BINARY_DIR}/variableTreeXml)
file(COPY ${CMAKE_SOURCE_DIR}/tests/EqFctTest.xml DESTINATION ${PROJECT_BINARY_DIR})
file(GLOB TEST_XML_FILES variable ${CMAKE_SOURCE_DIR}/tests/variableTreeXml/*.xml)
file(COPY ${TEST_XML_FILES} DESTINATION ${PROJECT_BINARY_DIR})
#The make coverage command is only available in debug mode
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
......
#include <ChimeraTK/ControlSystemAdapter/ApplicationBase.h>
#include "DoocsAdapter.h"
#include "VariableMapper.h"
#include "getAllVariableNames.h"
#include <sys/stat.h>
char const *object_name;
static char const * DOOCS_VARIABLE_CONFIG_FILE = "DoocsVariableConfig.xml";
static ChimeraTK::DoocsAdapter doocsAdapter;
......@@ -16,6 +20,21 @@ void eq_init_prolog() {
ChimeraTK::ApplicationBase::getInstance().setPVManager(doocsAdapter.getDevicePVManager());
ChimeraTK::ApplicationBase::getInstance().initialise();
// the variable manager can only be filled after we have the CS manager
auto pvNames = ChimeraTK::getAllVariableNames( doocsAdapter.getControlSystemPVManager() );
struct stat buffer;
if (stat (DOOCS_VARIABLE_CONFIG_FILE, &buffer) == 0){
ChimeraTK::VariableMapper::getInstance().prepareOutput(DOOCS_VARIABLE_CONFIG_FILE, pvNames);
}else{
std::cerr << "WARNIUNG: No XML file for the Doocs variable config found. Trying direct import." << std::endl;
ChimeraTK::VariableMapper::getInstance().directImport(pvNames);
}
std::cout << "here is the mappging:" << std::endl;
for (auto &tmp : ChimeraTK::VariableMapper::getInstance().getAllProperties() ){
std::cout << tmp.first << " -> " << tmp.second.location << " / " << tmp.second.name << std::endl;
}
// activate the advanced archiver to have histories
set_arch_mode(1);
}
......
<?xml version="1.0" encoding="UTF-8"?>
<device_server xmlns="https://github.com/ChimeraTK/ControlSystemAdapter-DoocsAdapter">
<location name="MY_RENAMED_INTEGER_LOCATION">
<import>/INT</import>
</location>
<import>/</import>
</device_server>
......@@ -15,10 +15,10 @@ SVR.NAME: "REFERENCE_TEST._SVR"
SVR.RATE: 1 0 0 0
SVR.BPN: 6000
}
eq_fct_name: "INT"
eq_fct_name: "MY_RENAMED_INTEGER_LOCATION"
eq_fct_type: 10
{
NAME: "INT"
NAME: "MY_RENAMED_INTEGER_LOCATION"
}
eq_fct_name: "SHORT"
eq_fct_type: 10
......
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