Commit f4ecd497 authored by Alexander David Hellwig's avatar Alexander David Hellwig

Merge branch '26-feedback' into 'master'

Resolve "Feedback"

Closes #26

See merge request !9
parents 8bf76425 5288ef22
Pipeline #189137 passed with stage
in 43 seconds
......@@ -7,7 +7,7 @@
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc-math-emam2someip-generator</artifactId>
<version>1.2-SNAPSHOT</version>
<version>1.3-SNAPSHOT</version>
<name>emam2someip</name>
......
......@@ -2,7 +2,7 @@
<#import "SomeIPMacros.ftl" as m>
#include "<@m.mwIdent/>Adapter_${model.getEscapedCompName()}.h"
<@m.mwIdent/>Adapter_${model.getEscapedCompName()}::<@m.mwIdent/>Adapter_${model.getEscapedCompName()}() : public IAdapter_${model.getEscapedCompName()} {
<@m.mwIdent/>Adapter_${model.getEscapedCompName()}::<@m.mwIdent/>Adapter_${model.getEscapedCompName()}() {
}
......
......@@ -6,6 +6,9 @@ cmake_minimum_required (VERSION 2.8)
# Using C++ with flags
set (CMAKE_CXX_FLAGS "-g -std=c++0x")
# Setting project name and description
project(${model.getCompName()})
# Find vsomeip and boost packages
find_package (vsomeip 2.10.0 REQUIRED)
find_package( Boost 1.55 COMPONENTS system thread log REQUIRED )
......@@ -17,19 +20,19 @@ include_directories (
)
# Linking libraries to target
add_library(SomeIPAdapter_${model.getEscapedCompName()} SomeIPAdapter_${model.getEscapedCompName()}.cpp
add_library(SomeIPAdapter_${model.getEscapedCompName()}
SomeIPAdapter_${model.getEscapedCompName()}.cpp
SomeIPAdapter_${model.getEscapedCompName()}.h
${model.getEscapedCompName()}.cpp
${model.getEscapedCompName()}.h
)
list(APPEND LIBRARIES ${model.getEscapedCompName()})
list(APPEND LIBRARIES IAdapter_${model.getEscapedCompName()})
target_link_libraries(SomeIPAdapter_${model.getEscapedCompName()} vsomeip <#noparse>${Boost_LIBRARIES}</#noparse> <#noparse>${LIBRARIES}</#noparse>)
# Adding include directory to a target
target_include_directories(SomeIPAdapter_${model.getEscapedCompName()} PUBLIC <#noparse>${LIBRARIES}</#noparse> <#noparse>${INCLUDE_DIRS}</#noparse> <#noparse>${CMAKE_CURRENT_SOURCE_DIR}</#noparse>)
target_include_directories(SomeIPAdapter_${model.getEscapedCompName()} PUBLIC <#noparse>${INCLUDE_DIRS}</#noparse>)
# Linking libraries to target
target_link_libraries(SomeIPAdapter_${model.getEscapedCompName()} PUBLIC vsomeip <#noparse>${Boost_LIBRARIES}</#noparse> <#noparse>${LIBRARIES}</#noparse>)
# Export target to a cmake module file for outside usage
export(TARGETS SomeIPAdapter_${model.getEscapedCompName()} FILE SomeIPAdapter_${model.getEscapedCompName()}.cmake)
......@@ -36,8 +36,14 @@ public class AdapterGenerationTest extends AbstractSymtabTest {
// Connect component's ports to topics
componentInstanceSymbol.getPortInstance("in1").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(11,12,13/*,14,15*/));
componentInstanceSymbol.getPortInstance("in2").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(21,22,23/*,24,25*/));
componentInstanceSymbol.getPortInstance("in3").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(31,32,33/*,34,35*/));
componentInstanceSymbol.getPortInstance("in4").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(41,42,43/*,44,45*/));
componentInstanceSymbol.getPortInstance("in5").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(51,52,53/*,54,55*/));
componentInstanceSymbol.getPortInstance("out1").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(111,112,113/*,114,115*/));
componentInstanceSymbol.getPortInstance("out2").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(121,122,123/*,124,125*/));
componentInstanceSymbol.getPortInstance("out3").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(131,132,133/*,134,135*/));
componentInstanceSymbol.getPortInstance("out4").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(141,142,143/*,144,145*/));
componentInstanceSymbol.getPortInstance("out5").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(151,152,153/*,154,155*/));
List<File> files = generatorSomeIP.generateSomeIPAdapter(componentInstanceSymbol);
......
......@@ -34,7 +34,16 @@ public class PrettyPrintGenerationTest extends AbstractSymtabTest {
generatorSomeIP.setGenerationTargetPath("./target/generated-sources/");
// Connect component's ports to topics
componentInstanceSymbol.getPortInstance("in1").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(1,2,3));
componentInstanceSymbol.getPortInstance("in1").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(11,12,13/*,14,15*/));
componentInstanceSymbol.getPortInstance("in2").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(21,22,23/*,24,25*/));
componentInstanceSymbol.getPortInstance("in3").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(31,32,33/*,34,35*/));
componentInstanceSymbol.getPortInstance("in4").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(41,42,43/*,44,45*/));
componentInstanceSymbol.getPortInstance("in5").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(51,52,53/*,54,55*/));
componentInstanceSymbol.getPortInstance("out1").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(111,112,113/*,114,115*/));
componentInstanceSymbol.getPortInstance("out2").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(121,122,123/*,124,125*/));
componentInstanceSymbol.getPortInstance("out3").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(131,132,133/*,134,135*/));
componentInstanceSymbol.getPortInstance("out4").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(141,142,143/*,144,145*/));
componentInstanceSymbol.getPortInstance("out5").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(151,152,153/*,154,155*/));
List<File> files = generatorSomeIP.generatePrettyPrint(componentInstanceSymbol);
......
......@@ -3,7 +3,13 @@ Component name: tests.a.compA
Ports:
in1 : incoming (someip, serviceID: 1 instanceID: 2 eventgroupID: 3)
in2 : incoming (unknown symbol)
out1 : outgoing (unknown symbol)
out2 : outgoing (unknown symbol)
in1 : incoming (someip, serviceID: 11 instanceID: 12 eventgroupID: 13)
in2 : incoming (someip, serviceID: 21 instanceID: 22 eventgroupID: 23)
in3 : incoming (someip, serviceID: 31 instanceID: 32 eventgroupID: 33)
in4 : incoming (someip, serviceID: 41 instanceID: 42 eventgroupID: 43)
in5 : incoming (someip, serviceID: 51 instanceID: 52 eventgroupID: 53)
out1 : outgoing (someip, serviceID: 111 instanceID: 112 eventgroupID: 113)
out2 : outgoing (someip, serviceID: 121 instanceID: 122 eventgroupID: 123)
out3 : outgoing (someip, serviceID: 131 instanceID: 132 eventgroupID: 133)
out4 : outgoing (someip, serviceID: 141 instanceID: 142 eventgroupID: 143)
out5 : outgoing (someip, serviceID: 151 instanceID: 152 eventgroupID: 153)
......@@ -4,6 +4,9 @@ cmake_minimum_required (VERSION 2.8)
# Using C++ with flags
set (CMAKE_CXX_FLAGS "-g -std=c++0x")
# Setting project name and description
project(tests.a.compA)
# Find vsomeip and boost packages
find_package (vsomeip 2.10.0 REQUIRED)
find_package( Boost 1.55 COMPONENTS system thread log REQUIRED )
......@@ -15,19 +18,19 @@ include_directories (
)
# Linking libraries to target
add_library(SomeIPAdapter_tests_a_compA SomeIPAdapter_tests_a_compA.cpp
add_library(SomeIPAdapter_tests_a_compA
SomeIPAdapter_tests_a_compA.cpp
SomeIPAdapter_tests_a_compA.h
tests_a_compA.cpp
tests_a_compA.h
)
list(APPEND LIBRARIES tests_a_compA)
list(APPEND LIBRARIES IAdapter_tests_a_compA)
target_link_libraries(SomeIPAdapter_tests_a_compA vsomeip ${Boost_LIBRARIES} ${LIBRARIES})
# Adding include directory to a target
target_include_directories(SomeIPAdapter_tests_a_compA PUBLIC ${LIBRARIES} ${INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(SomeIPAdapter_tests_a_compA PUBLIC ${INCLUDE_DIRS})
# Linking libraries to target
target_link_libraries(SomeIPAdapter_tests_a_compA PUBLIC vsomeip ${Boost_LIBRARIES} ${LIBRARIES})
# Export target to a cmake module file for outside usage
export(TARGETS SomeIPAdapter_tests_a_compA FILE SomeIPAdapter_tests_a_compA.cmake)
......@@ -43,6 +43,27 @@ private:
void run_in2();
void on_message_in2(const std::shared_ptr<vsomeip::message> &_message);
void on_availability_in2(vsomeip::service_t _service, vsomeip::instance_t _instance, bool _is_available);
std::shared_ptr<vsomeip::application> in3_Subscriber;
std::mutex mutex_in3;
std::condition_variable condition_in3;
void run_in3();
void on_message_in3(const std::shared_ptr<vsomeip::message> &_message);
void on_availability_in3(vsomeip::service_t _service, vsomeip::instance_t _instance, bool _is_available);
std::shared_ptr<vsomeip::application> in4_Subscriber;
std::mutex mutex_in4;
std::condition_variable condition_in4;
void run_in4();
void on_message_in4(const std::shared_ptr<vsomeip::message> &_message);
void on_availability_in4(vsomeip::service_t _service, vsomeip::instance_t _instance, bool _is_available);
std::shared_ptr<vsomeip::application> in5_Subscriber;
std::mutex mutex_in5;
std::condition_variable condition_in5;
void run_in5();
void on_message_in5(const std::shared_ptr<vsomeip::message> &_message);
void on_availability_in5(vsomeip::service_t _service, vsomeip::instance_t _instance, bool _is_available);
std::shared_ptr<vsomeip::application> out1_Publisher;
......@@ -50,4 +71,13 @@ private:
std::shared_ptr<vsomeip::application> out2_Publisher;
void publishout2_Publisher();
std::shared_ptr<vsomeip::application> out3_Publisher;
void publishout3_Publisher();
std::shared_ptr<vsomeip::application> out4_Publisher;
void publishout4_Publisher();
std::shared_ptr<vsomeip::application> out5_Publisher;
void publishout5_Publisher();
};
......@@ -4,6 +4,9 @@ cmake_minimum_required (VERSION 2.8)
# Using C++ with flags
set (CMAKE_CXX_FLAGS "-g -std=c++0x")
# Setting project name and description
project(tests.a.compA)
# Find vsomeip and boost packages
find_package (vsomeip 2.10.0 REQUIRED)
find_package( Boost 1.55 COMPONENTS system thread log REQUIRED )
......@@ -15,19 +18,19 @@ include_directories (
)
# Linking libraries to target
add_library(SomeIPAdapter_tests_a_compA SomeIPAdapter_tests_a_compA.cpp
add_library(SomeIPAdapter_tests_a_compA
SomeIPAdapter_tests_a_compA.cpp
SomeIPAdapter_tests_a_compA.h
tests_a_compA.cpp
tests_a_compA.h
)
list(APPEND LIBRARIES tests_a_compA)
list(APPEND LIBRARIES IAdapter_tests_a_compA)
target_link_libraries(SomeIPAdapter_tests_a_compA vsomeip ${Boost_LIBRARIES} ${LIBRARIES})
# Adding include directory to a target
target_include_directories(SomeIPAdapter_tests_a_compA PUBLIC ${LIBRARIES} ${INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(SomeIPAdapter_tests_a_compA PUBLIC ${INCLUDE_DIRS})
# Linking libraries to target
target_link_libraries(SomeIPAdapter_tests_a_compA PUBLIC vsomeip ${Boost_LIBRARIES} ${LIBRARIES})
# Export target to a cmake module file for outside usage
export(TARGETS SomeIPAdapter_tests_a_compA FILE SomeIPAdapter_tests_a_compA.cmake)
......@@ -4,6 +4,12 @@ package tests.a;
component CompA{
port in Q in1;
port in Q in2;
port in N in3;
port in Z in4;
port in B in5;
port out Q out1;
port out Q out2;
port out N out3;
port out Z out4;
port out B out5;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment