Sho SHIMIZU
Committed by Gerrit Code Review

Remove redundancy by replacing values with Spectrum.CENTER_FREQUENCY

Change-Id: I42836ca3884bb17304cd05be2b163a906421b5a6
......@@ -124,7 +124,6 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
private static final long KBPS = 1_000;
private static final long MBPS = 1_000 * 1_000;
private static final Frequency FREQ100 = Frequency.ofGHz(100);
private static final Frequency FREQ193_1 = Frequency.ofTHz(193.1);
private static final Frequency FREQ4_4 = Frequency.ofTHz(4.4);
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
......@@ -596,8 +595,8 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
DefaultPortDescription portDes = null;
switch (sigType) {
case OMSN:
portDes = new OmsPortDescription(portNo, enabled, FREQ193_1, FREQ193_1.add(FREQ4_4),
FREQ100, annotations);
portDes = new OmsPortDescription(portNo, enabled,
Spectrum.CENTER_FREQUENCY, Spectrum.CENTER_FREQUENCY.add(FREQ4_4), FREQ100, annotations);
break;
case OCH:
OFExpPortOpticalTransportLayerEntry entry = firstProp.getFeatures().get(0).getValue().get(0);
......
......@@ -25,6 +25,7 @@ import org.onlab.packet.IpAddress;
import org.onlab.packet.MacAddress;
import org.onlab.packet.VlanId;
import org.onlab.util.Frequency;
import org.onlab.util.Spectrum;
import org.onosproject.net.AnnotationKeys;
import org.onosproject.net.ChannelSpacing;
import org.onosproject.net.ConnectPoint;
......@@ -100,7 +101,6 @@ class ConfigProvider implements DeviceProvider, LinkProvider, HostProvider {
private static final String UNKNOWN = "unknown";
private static final Frequency CENTER = Frequency.ofTHz(193.1);
// C-band has 4.4 THz (4,400 GHz) total bandwidth
private static final Frequency TOTAL = Frequency.ofTHz(4.4);
......@@ -256,7 +256,7 @@ class ConfigProvider implements DeviceProvider, LinkProvider, HostProvider {
// Currently, assume OMS when FIBER. Provide sane defaults.
annotations = annotations(node.get("annotations"));
return new OmsPortDescription(port, node.path("enabled").asBoolean(true),
CENTER, CENTER.add(TOTAL),
Spectrum.CENTER_FREQUENCY, Spectrum.CENTER_FREQUENCY.add(TOTAL),
Frequency.ofGHz(100), annotations);
case ODUCLT:
annotations = annotations(node.get("annotations"));
......@@ -391,8 +391,8 @@ class ConfigProvider implements DeviceProvider, LinkProvider, HostProvider {
// if true, there was less channels than can be tightly packed.
Frequency grid = chl.frequency();
// say Linc's 1st slot starts at CENTER and goes up from there.
Frequency min = CENTER.add(grid);
Frequency max = CENTER.add(grid.multiply(numChls));
Frequency min = Spectrum.CENTER_FREQUENCY.add(grid);
Frequency max = Spectrum.CENTER_FREQUENCY.add(grid.multiply(numChls));
PortDescription srcPortDesc = new OmsPortDescription(srcCp.port(), true, min, max, grid);
PortDescription dstPortDesc = new OmsPortDescription(dstCp.port(), true, min, max, grid);
......