Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feature/config_cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Peguen committed Jul 15, 2024
2 parents 49e271c + a51ecec commit fcc6c8a
Show file tree
Hide file tree
Showing 13 changed files with 602 additions and 252 deletions.
12 changes: 6 additions & 6 deletions cpack/innosetup/ecal_setup.iss.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; ========================= eCAL LICENSE =================================
;
; Copyright (C) 2016 - 2019 Continental Corporation
; Copyright (C) 2016 - 2024 Continental Corporation
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -75,9 +75,9 @@ Source: "{#ComponentStagingDir}\runtime\*"; DestDir: "{app}"; Fla
Source: "{#ComponentStagingDir}\Unspecified\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: runtime
Source: "{#ComponentStagingDir}\libraries\bin\*"; DestDir: "{app}\bin\"; Flags: ignoreversion recursesubdirs; Components: runtime

Source: "{#ComponentStagingDir}\configuration\cfg\ecal.ini"; DestDir: "{commonappdata}\eCAL\"; Tasks: not replaceconf; Flags: ignoreversion confirmoverwrite; Components: runtime
Source: "{#ComponentStagingDir}\configuration\cfg\ecal.ini"; DestDir: "{commonappdata}\eCAL\"; Tasks: replaceconf; Flags: ignoreversion; Components: runtime
Source: "{#ComponentStagingDir}\configuration\cfg\ecaltime.ini"; DestDir: "{commonappdata}\eCAL\"; Flags: ignoreversion; Components: runtime
Source: "{#ComponentStagingDir}\_configuration\cfg\ecal.ini"; DestDir: "{commonappdata}\eCAL\"; Tasks: not replaceconf; Flags: ignoreversion confirmoverwrite; Components: runtime
Source: "{#ComponentStagingDir}\_configuration\cfg\ecal.ini"; DestDir: "{commonappdata}\eCAL\"; Tasks: replaceconf; Flags: ignoreversion; Components: runtime
Source: "{#ComponentStagingDir}\_configuration\cfg\ecaltime.ini"; DestDir: "{commonappdata}\eCAL\"; Flags: ignoreversion; Components: runtime

; applications
Source: "{#ComponentStagingDir}\app\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: applications
Expand Down Expand Up @@ -118,11 +118,11 @@ Source: "{#DebugSdkStagingDir}\protobuf-export\*"; DestDir: "{app}";
; Source: "{#DebugSdkStagingDir}\protoc\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: sdk\protobuf

; sdk\hdf5
Source: "{#ComponentStagingDir}\configinstall\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: sdk\hdf5
Source: "{#ComponentStagingDir}\_configinstall\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: sdk\hdf5
Source: "{#ComponentStagingDir}\headers\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: sdk\hdf5
Source: "{#ComponentStagingDir}\libraries\lib\*"; DestDir: "{app}\lib"; Flags: ignoreversion recursesubdirs; Components: sdk\hdf5

Source: "{#DebugSdkStagingDir}\configinstall\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: sdk\hdf5
Source: "{#DebugSdkStagingDir}\_configinstall\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: sdk\hdf5
Source: "{#DebugSdkStagingDir}\libraries\lib\*"; DestDir: "{app}\lib"; Flags: ignoreversion recursesubdirs; Components: sdk\hdf5
Source: "{#DebugSdkStagingDir}\libraries\bin\*"; DestDir: "{app}\bin\"; Flags: ignoreversion recursesubdirs; Components: sdk\hdf5

Expand Down
7 changes: 7 additions & 0 deletions ecal/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -278,15 +278,22 @@ endif()
######################################
if (ECAL_CORE_REGISTRATION)
set(ecal_registration_src
src/registration/ecal_process_registration.cpp
src/registration/ecal_process_registration.h
src/registration/ecal_registration_provider.cpp
src/registration/ecal_registration_provider.h
src/registration/ecal_registration_receiver.cpp
src/registration/ecal_registration_receiver.h
src/registration/ecal_registration_sender.h
src/registration/ecal_registration_sender_udp.cpp
src/registration/ecal_registration_sender_udp.h
)
if(ECAL_CORE_REGISTRATION_SHM)
list(APPEND ecal_registration_src
src/registration/ecal_registration_receiver_shm.cpp
src/registration/ecal_registration_receiver_shm.h
src/registration/ecal_registration_sender_shm.cpp
src/registration/ecal_registration_sender_shm.h
src/registration/shm/ecal_memfile_broadcast.cpp
src/registration/shm/ecal_memfile_broadcast.h
src/registration/shm/ecal_memfile_broadcast_reader.cpp
Expand Down
104 changes: 104 additions & 0 deletions ecal/core/src/registration/ecal_process_registration.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
/* ========================= eCAL LICENSE =================================
*
* Copyright (C) 2016 - 2024 Continental Corporation
*
* 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.
*
* ========================= eCAL LICENSE =================================
*/

/**
* @brief Functions to generate Process Registration / Unregistration samples.
*
**/

#include "ecal_process_registration.h"

#include <ecal/ecal_init.h>
#include <ecal/ecal_process.h>
#include "ecal_global_accessors.h"
#include "ecal_globals.h"
#include "time/ecal_timegate.h"

eCAL::Registration::Sample eCAL::Registration::GetProcessRegisterSample()
{
Registration::Sample process_sample;
process_sample.cmd_type = bct_reg_process;
auto& process_sample_process = process_sample.process;
process_sample_process.hname = eCAL::Process::GetHostName();
process_sample_process.hgname = eCAL::Process::GetHostGroupName();
process_sample_process.pid = eCAL::Process::GetProcessID();
process_sample_process.pname = eCAL::Process::GetProcessName();
process_sample_process.uname = eCAL::Process::GetUnitName();
process_sample_process.pparam = eCAL::Process::GetProcessParameter();
process_sample_process.state.severity = static_cast<Registration::eProcessSeverity>(g_process_severity);
process_sample_process.state.severity_level = static_cast<Registration::eProcessSeverityLevel>(g_process_severity_level);
process_sample_process.state.info = g_process_info;
#if ECAL_CORE_TIMEPLUGIN
if (g_timegate() == nullptr)
{
process_sample_process.tsync_state = Registration::eTSyncState::tsync_none;
}
else
{
if (!g_timegate()->IsSynchronized())
{
process_sample_process.tsync_state = Registration::eTSyncState::tsync_none;
}
else
{
switch (g_timegate()->GetSyncMode())
{
case CTimeGate::eTimeSyncMode::realtime:
process_sample_process.tsync_state = Registration::eTSyncState::tsync_realtime;
break;
case CTimeGate::eTimeSyncMode::replay:
process_sample_process.tsync_state = Registration::eTSyncState::tsync_replay;
break;
default:
process_sample_process.tsync_state = Registration::eTSyncState::tsync_none;
break;
}
}
process_sample_process.tsync_mod_name = g_timegate()->GetName();
}
#endif

// eCAL initialization state
const unsigned int comp_state(g_globals()->GetComponents());
process_sample_process.component_init_state = static_cast<int32_t>(comp_state);
std::string component_info;
if ((comp_state & eCAL::Init::Publisher) != 0u) component_info += "|pub";
if ((comp_state & eCAL::Init::Subscriber) != 0u) component_info += "|sub";
if ((comp_state & eCAL::Init::Logging) != 0u) component_info += "|log";
if ((comp_state & eCAL::Init::TimeSync) != 0u) component_info += "|time";
if (!component_info.empty()) component_info = component_info.substr(1);
process_sample_process.component_init_info = component_info;

process_sample_process.ecal_runtime_version = eCAL::GetVersionString();

return process_sample;
}

eCAL::Registration::Sample eCAL::Registration::GetProcessUnregisterSample()
{
Registration::Sample process_sample;
process_sample.cmd_type = bct_unreg_process;
auto& process_sample_process = process_sample.process;
process_sample_process.hname = eCAL::Process::GetHostName();
process_sample_process.pid = eCAL::Process::GetProcessID();
process_sample_process.pname = eCAL::Process::GetProcessName();
process_sample_process.uname = eCAL::Process::GetUnitName();

return process_sample;
}
37 changes: 37 additions & 0 deletions ecal/core/src/registration/ecal_process_registration.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/* ========================= eCAL LICENSE =================================
*
* Copyright (C) 2016 - 2024 Continental Corporation
*
* 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.
*
* ========================= eCAL LICENSE =================================
*/

/**
* @brief Functions to generate Process Registration / Unregistration samples.
*
**/

#pragma once

#include "serialization/ecal_struct_sample_registration.h"

namespace eCAL
{
namespace Registration
{
Sample GetProcessRegisterSample();

Sample GetProcessUnregisterSample();
}
}
Loading

0 comments on commit fcc6c8a

Please sign in to comment.