* Get the spectrum width for rate and modulation format.
* @param rate Uint32
* @param modulationFormat ModulationFormat
- * @return spectrum width in GHz
+ * @return spectrum width in GHz compatible with models 10.1
*/
- public static FrequencyGHz getWidthFromRateAndModulationFormat(Uint32 rate, ModulationFormat modulationFormat) {
+ public static FrequencyGHz getWidthFromRateAndModulationFormatToModel101(Uint32 rate,
+ ModulationFormat modulationFormat) {
String width = GridConstant.FREQUENCY_WIDTH_TABLE.get(rate, modulationFormat);
if (width == null) {
LOG.warn("No width found for service rate {} and modulation format {}, set width to 40", rate,
return FrequencyGHz.getDefaultInstance(width);
}
+ /**
+ * Get the spectrum width for rate and modulation format.
+ * @param rate Uint32
+ * @param modulationFormat ModulationFormat
+ * @return spectrum width in GHz compatible with models 13.1
+ */
+ public static org.opendaylight.yang.gen.v1.http.org.openroadm.common.optical.channel.types.rev230526.FrequencyGHz
+ getWidthFromRateAndModulationFormatToModel131(Uint32 rate, ModulationFormat modulationFormat) {
+ String width = GridConstant.FREQUENCY_WIDTH_TABLE.get(rate, modulationFormat);
+ if (width == null) {
+ LOG.warn("No width found for service rate {} and modulation format {}, set width to 40", rate,
+ modulationFormat);
+ width = String.valueOf(GridConstant.WIDTH_40);
+ }
+ return org.opendaylight.yang.gen.v1.http.org.openroadm.common.optical.channel.types.rev230526.FrequencyGHz
+ .getDefaultInstance(width);
+ }
+
/**
* Get central frequency of spectrum.
* @param minFrequency BigDecimal
* @param maxFrequency BigDecimal
- * @return central frequency in THz
+ * @return central frequency in THz compatible with models 10.1
*/
- public static FrequencyTHz getCentralFrequency(BigDecimal minFrequency, BigDecimal maxFrequency) {
+ public static FrequencyTHz getCentralFrequencyToModel101(BigDecimal minFrequency, BigDecimal maxFrequency) {
return new FrequencyTHz(Decimal64.valueOf(computeCentralFrequency(minFrequency, maxFrequency)));
+ }
+ /**
+ * Get central frequency of spectrum.
+ * @param minFrequency BigDecimal
+ * @param maxFrequency BigDecimal
+ * @return central frequency in THz compatible with models 13.1
+ */
+ public static org.opendaylight.yang.gen.v1.http.org.openroadm.common.optical.channel.types.rev230526.FrequencyTHz
+ getCentralFrequencyToModel131(BigDecimal minFrequency, BigDecimal maxFrequency) {
+ return new org.opendaylight.yang.gen.v1.http.org.openroadm.common.optical.channel.types.rev230526.FrequencyTHz(
+ Decimal64.valueOf(computeCentralFrequency(minFrequency, maxFrequency)));
}
/**
if (input.getCenterFreq() != null) {
spectrumInformation.setCenterFrequency(input.getCenterFreq().getValue().decimalValue());
} else {
- spectrumInformation.setCenterFrequency(GridUtils.getCentralFrequency(spectrumInformation.getMinFrequency(),
- spectrumInformation.getMaxFrequency()).getValue().decimalValue());
+ spectrumInformation.setCenterFrequency(GridUtils.getCentralFrequencyToModel101(
+ spectrumInformation.getMinFrequency(),
+ spectrumInformation.getMaxFrequency()).getValue().decimalValue());
}
if (input.getNmcWidth() != null) {
spectrumInformation.setWidth(input.getNmcWidth().getValue().decimalValue()