Commit 2e9978d0 authored by Florian Raeth's avatar Florian Raeth

add SomeIPConnectionSymbol helper function for service, instance, eventgroup...

add SomeIPConnectionSymbol helper function for service, instance, eventgroup and placeholder for event, method ids
parent 8ae1a80a
......@@ -49,6 +49,66 @@ public class SomeIPAdapterModel {
outgoing = outgoing.stream().filter(fc -> fc.isSomeIPPort()).filter(fc -> fc.isOutgoing()).collect(Collectors.toList());
}
public int getServiceId(EMAPortInstanceSymbol p)
{
Optional<MiddlewareSymbol> symbol = p.getMiddlewareSymbol();
if(symbol.isPresent() && symbol.get().isKindOf(SomeIPConnectionKind.INSTANCE))
{
SomeIPConnectionSymbol sym = (SomeIPConnectionSymbol) symbol.get();
int serviceID = sym.getserviceID().isPresent()?sym.getserviceID().get():-1;
return serviceID;
}
return -1;
}
public int getInstanceId(EMAPortInstanceSymbol p)
{
Optional<MiddlewareSymbol> symbol = p.getMiddlewareSymbol();
if(symbol.isPresent() && symbol.get().isKindOf(SomeIPConnectionKind.INSTANCE))
{
SomeIPConnectionSymbol sym = (SomeIPConnectionSymbol) symbol.get();
int instanceID = sym.getinstanceID().isPresent()?sym.getinstanceID().get():-1;
return instanceID;
}
return -1;
}
public int getEventGroupId(EMAPortInstanceSymbol p)
{
Optional<MiddlewareSymbol> symbol = p.getMiddlewareSymbol();
if(symbol.isPresent() && symbol.get().isKindOf(SomeIPConnectionKind.INSTANCE))
{
SomeIPConnectionSymbol sym = (SomeIPConnectionSymbol) symbol.get();
int eventgroupID = sym.geteventgroupID().isPresent()?sym.geteventgroupID().get():-1;
return eventgroupID;
}
return -1;
}
public int getEventId(EMAPortInstanceSymbol p)
{
Optional<MiddlewareSymbol> symbol = p.getMiddlewareSymbol();
if(symbol.isPresent() && symbol.get().isKindOf(SomeIPConnectionKind.INSTANCE))
{
SomeIPConnectionSymbol sym = (SomeIPConnectionSymbol) symbol.get();
int eventID = 0;//sym.geteventID().isPresent()?sym.geteventID().get():-1;
return eventID;
}
return -1;
}
public int getMethodId(EMAPortInstanceSymbol p)
{
Optional<MiddlewareSymbol> symbol = p.getMiddlewareSymbol();
if(symbol.isPresent() && symbol.get().isKindOf(SomeIPConnectionKind.INSTANCE))
{
SomeIPConnectionSymbol sym = (SomeIPConnectionSymbol) symbol.get();
int methodID = 0;//sym.getmethodID().isPresent()?sym.getmethodID().get():-1;
return methodID;
}
return -1;
}
// Parse through component to find information about its ports
public void addPortsDesc(Collection<EMAPortInstanceSymbol> ports)
{
......
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