Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
296e935
Allow different paths for CPPZMQ on windows, was previously assumed t…
Dec 17, 2019
f2276a3
Remove avoidable blocks
bourtemb Jan 15, 2020
567ad16
Remove obsolete TACO_PROTOCOL definition
bourtemb Jan 15, 2020
6f87741
appveyor.yml: Fail jobs faster
t-b Jan 24, 2020
9269595
appveyor.yml: Add inline deployment on tag push
t-b Nov 1, 2019
baf521c
Fix memory leak in Attribute::get_att_device_class() (#678)
bourtemb Feb 11, 2020
2d551d3
travis.yml: remove deprecated skip_cleanup (#682)
bourtemb Feb 13, 2020
7289e5c
Add switch to disable mmx (#676)
lorenzopivetta Feb 14, 2020
a81c158
CMakeLists.txt: Rework test suite handling
t-b Jan 23, 2020
59cda6e
Use CPPZMQ_BASE env variable to feed CMake
Feb 18, 2020
8d40c27
Merge pull request #669 from t-b/fail-appveyor-faster
t-b Feb 18, 2020
b15f129
Fix omniidl error checks
Feb 18, 2020
1ac5821
appveyor.yml: Add online deployment on tag push (#616)
bourtemb Feb 28, 2020
3fda811
Merge pull request #668 from t-b/add-switch-for-disabling-building-th…
t-b Mar 4, 2020
61139cb
Merge pull request #687 from softwareschneiderei/fix-omniidl-error-ch…
t-b Mar 4, 2020
abbf084
Change library SONAME to libtango.so.94 (#593)
bourtemb Mar 6, 2020
7261bd8
Add test for event recovery after restart (#496)
mliszcz Jul 19, 2019
c676897
Restore subscribed clients after dev restart (#496)
mliszcz Jul 21, 2019
1a07976
Use attribute name when restoring events state (#496)
mliszcz Jul 21, 2019
3eb67d6
Rename EventPar struct to EventSubscriptionState
mliszcz Mar 9, 2020
51359b2
Merge pull request #655 from bourtemb/cleanup-taco
t-b Mar 16, 2020
464f5b1
Merge pull request #573 from mliszcz/fix-496-blind-event-clients-afte…
mliszcz Mar 16, 2020
281c5f1
Merge branch 'tango-9-lts' into allow_different_path_for_cppzmq
ltjax Mar 18, 2020
07a0ce5
Merge pull request #642 from softwareschneiderei/allow_different_path…
bourtemb Mar 27, 2020
7c65021
Enforce non-interactive package installation in CI (#701)
mliszcz Mar 27, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ after_success:
deploy:
- provider: script
script: bash .travis/deploy.sh
skip_cleanup: true
on:
tags: true

Expand Down
2 changes: 2 additions & 0 deletions .travis/debian10/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ ARG APP_GID=2000

MAINTAINER TANGO Controls team <tango@esrf.fr>

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
apt-utils \
build-essential \
Expand Down
2 changes: 2 additions & 0 deletions .travis/debian8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ ARG APP_GID=2000

MAINTAINER TANGO Controls team <tango@esrf.fr>

ENV DEBIAN_FRONTEND=noninteractive

RUN sed -i '/jessie-updates/d' /etc/apt/sources.list # Now archived

RUN apt-get update && apt-get install -y \
Expand Down
2 changes: 2 additions & 0 deletions .travis/debian9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ ARG APP_GID=2000

MAINTAINER TANGO Controls team <tango@esrf.fr>

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
apt-utils \
build-essential \
Expand Down
2 changes: 2 additions & 0 deletions .travis/gcc-latest/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ ARG APP_GID=2000

MAINTAINER TANGO Controls team <tango@esrf.fr>

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
apt-utils \
build-essential \
Expand Down
2 changes: 2 additions & 0 deletions .travis/llvm-latest/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ ARG APP_GID=2000

MAINTAINER TANGO Controls team <tango@esrf.fr>

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
apt-utils \
build-essential \
Expand Down
2 changes: 2 additions & 0 deletions .travis/ubuntu-20.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ ARG APP_GID=2000

MAINTAINER TANGO Controls team <tango@esrf.fr>

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
apt-utils \
build-essential \
Expand Down
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ if (USE_PCH AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "GNU|MSVC|Clang"))
set(USE_PCH OFF)
endif()

enable_testing()
#need to define the version of the library
set(MAJOR_VERSION "9")
set(MINOR_VERSION "4")
Expand All @@ -29,7 +28,7 @@ endif()

#convenient versions
set(LIBRARY_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}")
set(SO_VERSION "${MAJOR_VERSION}")
set(SO_VERSION "${MAJOR_VERSION}${MINOR_VERSION}")

set(TANGO_HOST $ENV{TANGO_HOST})
include(configure/CMakeLists.txt)
Expand All @@ -46,9 +45,10 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/log4tango/include)
#source code
add_subdirectory("log4tango")
add_subdirectory("cppapi")
if(NOT WIN32)

if(BUILD_TESTING)
add_subdirectory("cpp_test_suite")
endif(NOT WIN32)
endif()

if(WIN32)
include(configure/cmake_win.cmake)
Expand Down
1 change: 1 addition & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
- `-DCMAKE_VERBOSE_MAKEFILE=true`
- `-DTANGO_USE_USING_NAMESPACE=<ON|OFF>` choose `OFF` for modern builds
- `-DUSE_PCH=<ON|OFF>`
- `-DBUILD_TESTING=<ON|OFF>` Build the test suite (`ON` by default)

Typical output:

Expand Down
24 changes: 21 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,17 @@ install:
- cmd: cd "C:\projects\cppTango"
- cmd: set BOOST_ROOT=%BOOST_ROOT%
- cmd: set ZMQ_BASE=C:/projects/zeromq/
- cmd: set CPPZMQ_BASE=C:/projects/zeromq/
- cmd: set IDL_BASE=%IDL_BIN%
- cmd: set OMNI_BASE=C:/projects/omniorb/
- cmd: set PTHREAD_WIN=C:/projects/pthreads-win32/
- cmd: if not defined USE_PCH set USE_PCH=OFF
#- cmd: cmake -G "%CMAKE_GENERATOR%" -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE -DBUILD_SHARED_LIBS=TRUE .
#- cmd: cmake -G "%CMAKE_GENERATOR%" -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE .
- cmd: cmake -G "%CMAKE_GENERATOR%" -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE -DIDL_BASE="%IDL_BASE%" -DOMNI_BASE="%OMNI_BASE%" -DZMQ_BASE="%ZMQ_BASE%" -DPTHREAD_WIN=%PTHREAD_WIN% -DUSE_PCH=%USE_PCH% .
- cmd: cmake -G "%CMAKE_GENERATOR%" -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE -DIDL_BASE="%IDL_BASE%" -DOMNI_BASE="%OMNI_BASE%" -DZMQ_BASE="%ZMQ_BASE%" -DCPPZMQ_BASE="%CPPZMQ_BASE%" -DPTHREAD_WIN=%PTHREAD_WIN% -DUSE_PCH=%USE_PCH% -DBUILD_TESTING=OFF .
- cmd: cd c:/projects/debug_build
#- cmd: cmake -G "%CMAKE_GENERATOR%" -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE -DBUILD_SHARED_LIBS=TRUE -DCMAKE_BUILD_TYPE=Debug .
- cmd: cmake -G "%CMAKE_GENERATOR%" -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE -DCMAKE_BUILD_TYPE=Debug -DIDL_BASE="%IDL_BASE%" -DOMNI_BASE="%OMNI_BASE%" -DZMQ_BASE="%ZMQ_BASE%" -DPTHREAD_WIN=%PTHREAD_WIN% -DUSE_PCH=%USE_PCH% .
- cmd: cmake -G "%CMAKE_GENERATOR%" -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE -DCMAKE_BUILD_TYPE=Debug -DIDL_BASE="%IDL_BASE%" -DOMNI_BASE="%OMNI_BASE%" -DZMQ_BASE="%ZMQ_BASE%" -DCPPZMQ_BASE="%CPPZMQ_BASE%" -DPTHREAD_WIN=%PTHREAD_WIN% -DUSE_PCH=%USE_PCH% -DBUILD_TESTING=OFF .

clone_folder: C:\projects\cppTango

Expand Down Expand Up @@ -189,9 +190,26 @@ on_finish:

on_failure:
#RDP for failure
- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

artifacts:
- path: ./*.exe
- path: ./*.zip
- path: ./*.msi

deploy:
- provider: GitHub
tag: $(APPVEYOR_REPO_TAG_NAME)
description: "Release $(APPVEYOR_REPO_TAG_NAME)"
auth_token:
# User: cppTango-bot
# Personal Access token with repo scope, encrypted via https://ci.appveyor.com/tools/encrypt
secure: KnvPAbdhmiTQxTLOGq7nyNs6d1JYbKVKspPgigzQ3fDrI+nkaxqWCw6UmRkS2Gqe
artifact: /.*/
repository: tango-controls/cppTango
draft: true
prerelease: true
force_update: true
# deploy on tag push only
on:
APPVEYOR_REPO_TAG: true
1 change: 1 addition & 0 deletions configure/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -239,3 +239,4 @@ include(GNUInstallDirs)
include(configure/coveralls.cmake)

option(TANGO_USE_USING_NAMESPACE "Use \"using namespace\" in header files (deprecated, but ON for backwards compatibility.)." ON)
option(TANGO_JPEG_MMX "Build MMX support" ON)
4 changes: 2 additions & 2 deletions configure/cmake_win.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ install(DIRECTORY $ENV{OMNI_BASE}/include/omniVms DESTINATION include COMPONENT
install(FILES $ENV{OMNI_BASE}/include/omniconfig.h DESTINATION include COMPONENT headers)
install(FILES $ENV{OMNI_BASE}/include/omnithread.h DESTINATION include COMPONENT headers)
install(FILES $ENV{ZMQ_BASE}/include/zmq.h DESTINATION include COMPONENT headers)
install(FILES $ENV{ZMQ_BASE}/include/zmq.hpp DESTINATION include COMPONENT headers)
install(FILES $ENV{ZMQ_BASE}/include/zmq_addon.hpp DESTINATION include COMPONENT headers)
install(FILES $ENV{CPPZMQ_BASE}/include/zmq.hpp DESTINATION include COMPONENT headers)
install(FILES $ENV{CPPZMQ_BASE}/include/zmq_addon.hpp DESTINATION include COMPONENT headers)
install(FILES $ENV{ZMQ_BASE}/include/zmq_utils.h DESTINATION include COMPONENT headers)

if (CMAKE_BUILD_TYPE STREQUAL "Debug")
Expand Down
52 changes: 52 additions & 0 deletions cpp_test_suite/new_tests/cxx_dserver_misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,26 @@
#undef SUITE_NAME
#define SUITE_NAME DServerMiscTestSuite

struct EventCallback : public Tango::CallBack
{
EventCallback()
: num_of_all_events(0)
, num_of_error_events(0)
{}

void push_event(Tango::EventData* event)
{
num_of_all_events++;
if (event->err)
{
num_of_error_events++;
}
}

int num_of_all_events;
int num_of_error_events;
};

class DServerMiscTestSuite: public CxxTest::TestSuite
{
protected:
Expand Down Expand Up @@ -203,6 +223,38 @@ cout << "str = " << str << endl;
TS_ASSERT(dserver->info().server_id == full_ds_name);
TS_ASSERT(dserver->info().server_version == server_version);
}

/* Tests that subscriber can receive events immediately after
* a device restart without a need to wait for re-subscription.
*/
void test_event_subscription_recovery_after_device_restart()
{
EventCallback callback{};

std::string attribute_name = "event_change_tst";

TS_ASSERT_THROWS_NOTHING(device1->subscribe_event(
attribute_name,
Tango::USER_EVENT,
&callback));

TS_ASSERT_THROWS_NOTHING(device1->command_inout("IOPushEvent"));
Tango_sleep(2);
TS_ASSERT_EQUALS(2, callback.num_of_all_events);
TS_ASSERT_EQUALS(0, callback.num_of_error_events);

{
Tango::DeviceData input{};
input << device1_name;
TS_ASSERT_THROWS_NOTHING(dserver->command_inout("DevRestart", input));
}

TS_ASSERT_THROWS_NOTHING(device1->command_inout("IOPushEvent"));
Tango_sleep(2);
TS_ASSERT_EQUALS(3, callback.num_of_all_events);
TS_ASSERT_EQUALS(0, callback.num_of_error_events);
}

};
#undef cout
#endif // DServerMiscTestSuite_h
8 changes: 0 additions & 8 deletions cppapi/client/attr_proxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,14 +412,6 @@ void AttributeProxy::parse_name(std::string &full_name)
{
name_wo_prot = full_name.substr(pos + 3);
}
else if (protocol == TACO_PROTOCOL)
{
TangoSys_OMemStream desc;
desc << "Taco protocol is not supported" << std::ends;
ApiWrongNameExcept::throw_exception((const char*)"API_UnsupportedProtocol",
desc.str(),
(const char*)"AttributeProxy::parse_name()");
}
else
{
TangoSys_OMemStream desc;
Expand Down
1 change: 0 additions & 1 deletion cppapi/client/devapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,6 @@ enum cb_sub_model
#define CONNECTION_NOTOK 0

#define PROT_SEP "://"
#define TACO_PROTOCOL "taco"
#define TANGO_PROTOCOL "tango"

#define MODIFIER '#'
Expand Down
8 changes: 0 additions & 8 deletions cppapi/client/devapi_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2059,14 +2059,6 @@ void DeviceProxy::parse_name(std::string &full_name)
{
name_wo_prot = full_name_low.substr(pos + 3);
}
else if (protocol == TACO_PROTOCOL)
{
TangoSys_OMemStream desc;
desc << "Taco protocol is not supported" << std::ends;
ApiWrongNameExcept::throw_exception((const char *) "API_UnsupportedProtocol",
desc.str(),
(const char *) "DeviceProxy::parse_name()");
}
else
{
TangoSys_OMemStream desc;
Expand Down
3 changes: 2 additions & 1 deletion cppapi/server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ set(HEADERS attrdesc.h
w_pipe.tpp
subdev_diag.h
encoded_attribute.h
encoded_format.h)
encoded_format.h
event_subscription_state.h)

add_subdirectory(idl)
add_subdirectory(jpeg)
Expand Down
23 changes: 10 additions & 13 deletions cppapi/server/attribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5313,7 +5313,7 @@ DeviceClass *Attribute::get_att_device_class(std::string &dev_name)
// Check whether our device is listed in this class
for (size_t i = 0; i < dev_list.size(); ++i)
{
if (dev_list[i]->name() == dev_name)
if (dev_list[i]->get_name() == dev_name)
{
// Our device is listed in this class, returns the corresponding DeviceClass pointer
return tmp_cl_list[loop];
Expand Down Expand Up @@ -5912,21 +5912,18 @@ bool Attribute::data_ready_event_subscribed()
//
//--------------------------------------------------------------------------------------------------------------------

void Attribute::set_client_lib(int _l,std::string &ev_name)
void Attribute::set_client_lib(int client_lib_version, EventType event_type)
{
cout4 << "Attribute::set_client_lib(" << _l << "," << ev_name << ")" << std::endl;
int i;
for (i = 0; i < numEventType; i++)
{
if (ev_name == EventName[i])
{
break;
}
}
cout4 << "Attribute::set_client_lib("
<< client_lib_version << ","
<< EventName[event_type] << ")" << std::endl;

if (count(client_lib[i].begin(), client_lib[i].end(), _l) == 0)
if (0 == count(
client_lib[event_type].begin(),
client_lib[event_type].end(),
client_lib_version))
{
client_lib[i].push_back(_l);
client_lib[event_type].push_back(client_lib_version);
}
}

Expand Down
4 changes: 2 additions & 2 deletions cppapi/server/attribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -2308,9 +2308,9 @@ class Attribute
bool is_mem_exception() {return att_mem_exception;}
virtual bool is_fwd_att() {return false;}

void set_client_lib(int,std::string &);
void set_client_lib(int, EventType);
std::vector<int> &get_client_lib(EventType _et) {return client_lib[_et];}
void remove_client_lib(int,const std::string &);
void remove_client_lib(int, const std::string &);

void add_config_5_specific(AttributeConfig_5 &);
void add_startup_exception(std::string,const DevFailed &);
Expand Down
10 changes: 5 additions & 5 deletions cppapi/server/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6106,17 +6106,17 @@ void DeviceImpl::remove_local_command(const std::string &cmd_name)
//
//------------------------------------------------------------------------------------------------------------------

void DeviceImpl::get_event_param(std::vector<EventPar> &eve)
void DeviceImpl::get_event_param(EventSubscriptionStates& eve)
{
ZmqEventSupplier *event_supplier_zmq = Util::instance()->get_zmq_event_supplier();

if (event_supplier_zmq->any_dev_intr_client(this) == true)
{
EventPar ep;
EventSubscriptionState ep;

ep.notifd = false;
ep.zmq = true;
ep.attr_id = -1;
ep.attribute_name = "";
ep.quality = false;
ep.data_ready = false;
ep.dev_intr_change = true;
Expand All @@ -6139,11 +6139,11 @@ void DeviceImpl::get_event_param(std::vector<EventPar> &eve)
//
//------------------------------------------------------------------------------------------------------------------

void DeviceImpl::set_event_param(std::vector<EventPar> &eve)
void DeviceImpl::set_event_param(const EventSubscriptionStates& eve)
{
for (size_t loop = 0; loop < eve.size(); loop++)
{
if (eve[loop].attr_id == -1)
if (eve[loop].attribute_name.empty())
{
if (eve[loop].dev_intr_change == true)
{
Expand Down
5 changes: 3 additions & 2 deletions cppapi/server/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include <deviceclass.h>
#include <devintr.h>
#include <dintrthread.h>
#include "event_subscription_state.h"

namespace Tango
{
Expand Down Expand Up @@ -3423,8 +3424,8 @@ class DeviceImpl : public virtual POA_Tango::Device
void disable_intr_change_ev() {intr_change_ev = false;}
bool is_intr_change_ev_enable() {return intr_change_ev;}

void get_event_param(std::vector<EventPar> &);
void set_event_param(std::vector<EventPar> &);
void get_event_param(EventSubscriptionStates&);
void set_event_param(const EventSubscriptionStates&);

void set_client_lib(int _l) {if (count(client_lib.begin(),client_lib.end(),_l)==0)client_lib.push_back(_l);}

Expand Down
Loading