use of org.osate.aadl2.contrib.communication.CommunicationProperties in project osate2 by osate.
the class GetProperties method getActualLatencyinMS.
public static double getActualLatencyinMS(final NamedElement ne) {
Property actualLatency = lookupPropertyDefinition(ne, CommunicationProperties._NAME, CommunicationProperties.ACTUAL_LATENCY);
UnitLiteral milliSecond = findUnitLiteral(actualLatency, AadlProject.MS_LITERAL);
return PropertyUtils.getScaledNumberValue(ne, actualLatency, milliSecond, 0.0);
}
use of org.osate.aadl2.contrib.communication.CommunicationProperties in project osate2 by osate.
the class GetProperties method getActualLatencyinMicroSec.
public static double getActualLatencyinMicroSec(final NamedElement ne) {
Property actualLatency = lookupPropertyDefinition(ne, CommunicationProperties._NAME, CommunicationProperties.ACTUAL_LATENCY);
UnitLiteral microSecond = findUnitLiteral(actualLatency, AadlProject.US_LITERAL);
return PropertyUtils.getScaledNumberValue(ne, actualLatency, microSecond, 0.0);
}
use of org.osate.aadl2.contrib.communication.CommunicationProperties in project osate2 by osate.
the class GetProperties method getLatencyinMicroSec.
public static double getLatencyinMicroSec(final NamedElement ne) {
Property Latency = lookupPropertyDefinition(ne, CommunicationProperties._NAME, CommunicationProperties.LATENCY);
UnitLiteral microSecond = PropertiesLinkingService.findUnitLiteral(Latency, AadlProject.US_LITERAL);
return PropertyUtils.getScaledRangeMaximum(ne, Latency, microSecond, 0.0);
}
use of org.osate.aadl2.contrib.communication.CommunicationProperties in project osate2 by osate.
the class GetProperties method getOutgoingMessageRatePerSecond.
/*
* Look for Message_Rate or SEI::Data_Rate first. Then pick up Output_Rate,
* whose default value is 1 per dispatch That rate is converted to persecond
* using Period. If Period is zero then the resulting data rate is zero as
* well.
*/
public static double getOutgoingMessageRatePerSecond(final NamedElement ne) {
double res = GetProperties.getMessageRatePerSecond(ne);
if (res > 0) {
return res;
}
Property outputRate = lookupPropertyDefinition(ne, CommunicationProperties._NAME, CommunicationProperties.OUTPUT_RATE);
RecordValue rec = GetProperties.getOutPutRate(ne);
if (rec != null) {
res = GetProperties.getMaxDataRate(rec);
EnumerationLiteral unit = GetProperties.getRateUnit(rec);
double period = 0;
if (unit == null || unit.getName().equalsIgnoreCase("PerDispatch")) {
if (ne instanceof InstanceObject) {
period = GetProperties.getPeriodInSeconds(((InstanceObject) ne).getContainingComponentInstance(), 0);
} else {
period = GetProperties.getPeriodInSeconds(ne.getContainingClassifier(), 0);
}
if (period == 0) {
return 0;
}
res = res / period;
}
if (res > 0) {
return res;
}
}
double period = GetProperties.getPeriodInSeconds(ne.getContainingClassifier(), 0);
if (period == 0) {
return 0;
}
res = 1 / period;
return res;
}
use of org.osate.aadl2.contrib.communication.CommunicationProperties in project osate2 by osate.
the class GetProperties method getMaximumLatencyinMilliSec.
public static double getMaximumLatencyinMilliSec(final NamedElement ne) {
Property Latency = lookupPropertyDefinition(ne, CommunicationProperties._NAME, CommunicationProperties.LATENCY);
UnitLiteral milliSecond = PropertiesLinkingService.findUnitLiteral(Latency, AadlProject.MS_LITERAL);
return PropertyUtils.getScaledRangeMaximum(ne, Latency, milliSecond, 0.0);
}
Aggregations