Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+47
@@ -0,0 +1,47 @@
|
||||
#
|
||||
# $Id$
|
||||
# $HeadURL$
|
||||
# $Author$
|
||||
#
|
||||
|
||||
INCLUDE(MacroRTIDDSGen)
|
||||
INCLUDE(MacroCodeGenIdl)
|
||||
|
||||
SET(xml_FILE srm_service.xml)
|
||||
|
||||
#
|
||||
# --- Library svcSrmCommon --------------------------------------------------------------------------------
|
||||
#
|
||||
SET(SRCS_common
|
||||
srm_export.h
|
||||
logger.cpp
|
||||
logger.h
|
||||
)
|
||||
|
||||
# Generate srm_enums.idl / srm.idl
|
||||
CODEGEN_IDL_SVC(SRCS_common ${xml_FILE})
|
||||
|
||||
# Generate *.cpp/*.hpp from idl
|
||||
RTIDDSGEN(SRCS_common srm_enums.idl)
|
||||
RTIDDSGEN(SRCS_common srm.idl)
|
||||
|
||||
# Generate srm_dt[s,c]_types.h, srm_ft[s,c]_types.h
|
||||
CODEGEN_TOPIC_TYPEDEFS(SRCS_common ${xml_FILE})
|
||||
# generate srm_[d|f]tc.h
|
||||
CODEGEN_CLIENT_TOPICS_IFC(SRCS_common ${xml_FILE})
|
||||
|
||||
NGL_ADD_LIBRARY(AAR SV WS svcSrmCommon SHARED ${SRCS_common})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcSrmCommon
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../
|
||||
)
|
||||
NGL_TARGET_LINK_LIBRARIES(svcSrmCommon
|
||||
PRIVATE
|
||||
RTI::nddscpp2
|
||||
PUBLIC
|
||||
Qt5::Core
|
||||
ddscore
|
||||
NGLLogger
|
||||
)
|
||||
NGL_INSTALL_TARGET(svcSrmCommon)
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Building Config - logging facility
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#include "logger.h"
|
||||
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
namespace SituationReplayManagement
|
||||
{
|
||||
|
||||
LOGGER_T getLogger(const char *name)
|
||||
{
|
||||
static const char ns[] = "SRM.";
|
||||
std::string loggerName;
|
||||
const size_t len = strlen(name);
|
||||
loggerName.reserve(sizeof(ns) + len);
|
||||
loggerName.append(ns, sizeof(ns) - 1);
|
||||
loggerName.append(name, len);
|
||||
|
||||
try
|
||||
{
|
||||
return NGL::NGLLoggerBootstrap::getNGLRootLogger().
|
||||
getNGLLogger(loggerName);
|
||||
}
|
||||
catch (const std::exception &ex)
|
||||
{
|
||||
fprintf(stderr, "Error retrieving logger: %s", ex.what());
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace SituationReplayManagement
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Logging for SituationReplayManagement
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <NGLLogger/INGLLogger.h>
|
||||
#include "srm_export.h"
|
||||
|
||||
namespace SituationReplayManagement
|
||||
{
|
||||
using LOGGER_T = NGL::INGLLogger &;
|
||||
|
||||
SRM_COMMON_EXPORT LOGGER_T getLogger(const char *name);
|
||||
inline LOGGER_T getLogger(const QString &loggerName)
|
||||
{
|
||||
return getLogger(loggerName.toUtf8().constData());
|
||||
}
|
||||
} // namespace SituationReplayManagement
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
/**
|
||||
* Export definitions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Hanna E. Rathje, SLSE, 2015-08-04
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#ifndef SRM_COMMON_EXPORT
|
||||
# ifdef BUILD_STATIC_LIBRARIES
|
||||
# define SRM_COMMON_EXPORT
|
||||
# else
|
||||
# if defined(MAKE_SVCSRMCOMMON_LIB)
|
||||
# define SRM_COMMON_EXPORT Q_DECL_EXPORT
|
||||
# ifndef WIN32
|
||||
# ifdef NDDSUSERDllExport
|
||||
# undef NDDSUSERDllExport
|
||||
# endif
|
||||
# define NDDSUSERDllExport Q_DECL_EXPORT
|
||||
# endif
|
||||
# else
|
||||
# define SRM_COMMON_EXPORT Q_DECL_IMPORT
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef SRM_CLIENT_EXPORT
|
||||
# ifdef BUILD_STATIC_LIBRARIES
|
||||
# define SRM_CLIENT_EXPORT
|
||||
# else
|
||||
# if defined(MAKE_SVCSRMCLIENT_LIB)
|
||||
# define SRM_CLIENT_EXPORT Q_DECL_EXPORT
|
||||
# else
|
||||
# define SRM_CLIENT_EXPORT Q_DECL_IMPORT
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef SRM_SERVER_EXPORT
|
||||
# ifdef BUILD_STATIC_LIBRARIES
|
||||
# define SRM_SERVER_EXPORT
|
||||
# else
|
||||
# if defined(MAKE_SVCSRMSERVER_LIB)
|
||||
# define SRM_SERVER_EXPORT Q_DECL_EXPORT
|
||||
# else
|
||||
# define SRM_SERVER_EXPORT Q_DECL_IMPORT
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<service namespace="SituationReplayManagement" abbreviation="SRM" procNames="SituationReplayManagement" exerciseDependency="Global">
|
||||
<rcs>
|
||||
<Id Id="$Id$"/>
|
||||
<HeadURL HeadURL="$HeadURL$"/>
|
||||
<Author Author="$Author$"/>
|
||||
</rcs>
|
||||
<operatorRights offset="37">
|
||||
<guiPlugin name="SituationReplayManagement" offset="1">
|
||||
<operatorRightGroup name="Replay Management" description="Manage Replays">
|
||||
<operatorRight right="ReplayManagement" value="1" description="Manage Replays"/>
|
||||
</operatorRightGroup>
|
||||
</guiPlugin>
|
||||
</operatorRights>
|
||||
<tables>
|
||||
<table name="replay_partition">
|
||||
<column name="id" datatype="integer" isPrimaryKey="1" comment="not serial, since partition_no &lt; 256"/>
|
||||
<column name="exercise_id" datatype="integer" isForeignKey="1"/>
|
||||
<column name="workstation_id" datatype="integer" isForeignKey="1"/>
|
||||
<column name="operator_id" datatype="integer" isForeignKey="1"/>
|
||||
<column name="replay_type_id" datatype="integer" isForeignKey="1"/>
|
||||
<column name="is_used" datatype="boolean" default="false"/>
|
||||
<column name="created" datatype="timestamp" default="now()"/>
|
||||
<foreignKey name="FK_replay_exercise">
|
||||
<source table="replay_partition" column="exercise_id"/>
|
||||
<destination service="ExerciseManagement" serviceAbbr="exm" schema="exm" table="exercise" column="id"/>
|
||||
</foreignKey>
|
||||
<foreignKey name="FK_replay_replay_type">
|
||||
<source table="replay_partition" column="replay_type_id"/>
|
||||
<destination service="Core" serviceAbbr="core" schema="core" table="replay_type" column="id"/>
|
||||
</foreignKey>
|
||||
<foreignKey name="FK_replay_partition_opm_operator">
|
||||
<source table="replay_partition" column="operator_id"/>
|
||||
<destination service="OperatorManagement" serviceAbbr="opm" schema="opm" table="opm_operator" column="id"/>
|
||||
</foreignKey>
|
||||
<foreignKey name="FK_replay_partition_asm_asset">
|
||||
<source table="replay_partition" column="workstation_id"/>
|
||||
<destination service="AssetManagement" serviceAbbr="asm" schema="asm" table="asm_asset" column="id"/>
|
||||
</foreignKey>
|
||||
</table>
|
||||
<table name="replay_partition_journal" comment="Information about past and currently used replay partitions (as a journal)">
|
||||
<column name="id" datatype="bigint" isPrimaryKey="1">
|
||||
<sequence start="1" increment="1"/>
|
||||
</column>
|
||||
<column name="replay_partition_id" datatype="integer" default="0"/>
|
||||
<column name="replay_type_id" datatype="integer" isForeignKey="1"/>
|
||||
<column name="exercise_id" datatype="integer" isForeignKey="1"/>
|
||||
<column name="workstation_id" datatype="integer" isForeignKey="1"/>
|
||||
<column name="operator_id" datatype="bigint" isForeignKey="1"/>
|
||||
<column name="created" datatype="timestamp" default="now()"/>
|
||||
<foreignKey name="FK_replay_journal_replay_type">
|
||||
<source table="replay_partition_journal" column="replay_type_id"/>
|
||||
<destination service="Core" serviceAbbr="core" schema="core" table="replay_type" column="id"/>
|
||||
</foreignKey>
|
||||
<foreignKey name="FK_replay_journal_exercise">
|
||||
<source table="replay_partition_journal" column="exercise_id"/>
|
||||
<destination service="ExerciseManagement" serviceAbbr="exm" schema="exm" table="exercise" column="id"/>
|
||||
</foreignKey>
|
||||
<foreignKey name="FK_replay_partition_journal_opm_operator">
|
||||
<source table="replay_partition_journal" column="operator_id"/>
|
||||
<destination service="OperatorManagement" serviceAbbr="opm" schema="opm" table="opm_operator" column="id"/>
|
||||
</foreignKey>
|
||||
<foreignKey name="FK_replay_partition_journal_asm_asset">
|
||||
<source table="replay_partition_journal" column="workstation_id"/>
|
||||
<destination service="AssetManagement" serviceAbbr="asm" schema="asm" table="asm_asset" column="id"/>
|
||||
</foreignKey>
|
||||
</table>
|
||||
</tables>
|
||||
<views/>
|
||||
<dbServiceStructs>
|
||||
<serviceStruct name="SrmReplayPartition" table="replay_partition"/>
|
||||
<serviceStruct name="SrmReplayPartitionJournal" table="replay_partition_journal"/>
|
||||
<table name="replay_partition"/>
|
||||
<table name="replay_partition_journal"/>
|
||||
</dbServiceStructs>
|
||||
<topicTypes>
|
||||
<topicType name="ReplayPartitionCreateRequest">
|
||||
<column name="workstationId" idlType="long"/>
|
||||
<column name="exerciseId" idlType="long"/>
|
||||
<column name="operatorId" idlType="long"/>
|
||||
<column name="replayType" idlType="Core::ReplayType"/>
|
||||
</topicType>
|
||||
<topicType name="ReplayPartitionRemoveRequest">
|
||||
<column name="id" idlType="long"/>
|
||||
<column name="workstationId" idlType="long"/>
|
||||
<column name="operatorId" idlType="long"/>
|
||||
</topicType>
|
||||
</topicTypes>
|
||||
<functionTopics>
|
||||
<functionTopic name="ReplayPartitionCreate" requestTopicType="ReplayPartitionCreateRequest" replyTopicType="Core::FunctionReply" requestTopicName="ReplayPartitionCreateRequest" replyTopicName="ReplayPartitionCreateReply" routeInReplay="0"/>
|
||||
<functionTopic name="ReplayPartitionRemove" requestTopicType="ReplayPartitionRemoveRequest" replyTopicType="Core::FunctionReply" requestTopicName="ReplayPartitionRemoveRequest" replyTopicName="ReplayPartitionRemoveReply" routeInReplay="0"/>
|
||||
</functionTopics>
|
||||
<enumerations>
|
||||
<enumeration name="DummyEnum">
|
||||
<attribute key="Dummy" value="0"/>
|
||||
</enumeration>
|
||||
</enumerations>
|
||||
</service>
|
||||
Reference in new issue
Block a user