Committed by
Gerrit Code Review
Remove redundancy by replacing values with Spectrum.CENTER_FREQUENCY
Change-Id: I42836ca3884bb17304cd05be2b163a906421b5a6
Showing
2 changed files
with
6 additions
and
7 deletions
| ... | @@ -124,7 +124,6 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr | ... | @@ -124,7 +124,6 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr |
| 124 | private static final long KBPS = 1_000; | 124 | private static final long KBPS = 1_000; |
| 125 | private static final long MBPS = 1_000 * 1_000; | 125 | private static final long MBPS = 1_000 * 1_000; |
| 126 | private static final Frequency FREQ100 = Frequency.ofGHz(100); | 126 | private static final Frequency FREQ100 = Frequency.ofGHz(100); |
| 127 | - private static final Frequency FREQ193_1 = Frequency.ofTHz(193.1); | ||
| 128 | private static final Frequency FREQ4_4 = Frequency.ofTHz(4.4); | 127 | private static final Frequency FREQ4_4 = Frequency.ofTHz(4.4); |
| 129 | 128 | ||
| 130 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 129 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
| ... | @@ -596,8 +595,8 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr | ... | @@ -596,8 +595,8 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr |
| 596 | DefaultPortDescription portDes = null; | 595 | DefaultPortDescription portDes = null; |
| 597 | switch (sigType) { | 596 | switch (sigType) { |
| 598 | case OMSN: | 597 | case OMSN: |
| 599 | - portDes = new OmsPortDescription(portNo, enabled, FREQ193_1, FREQ193_1.add(FREQ4_4), | 598 | + portDes = new OmsPortDescription(portNo, enabled, |
| 600 | - FREQ100, annotations); | 599 | + Spectrum.CENTER_FREQUENCY, Spectrum.CENTER_FREQUENCY.add(FREQ4_4), FREQ100, annotations); |
| 601 | break; | 600 | break; |
| 602 | case OCH: | 601 | case OCH: |
| 603 | OFExpPortOpticalTransportLayerEntry entry = firstProp.getFeatures().get(0).getValue().get(0); | 602 | OFExpPortOpticalTransportLayerEntry entry = firstProp.getFeatures().get(0).getValue().get(0); | ... | ... |
| ... | @@ -25,6 +25,7 @@ import org.onlab.packet.IpAddress; | ... | @@ -25,6 +25,7 @@ import org.onlab.packet.IpAddress; |
| 25 | import org.onlab.packet.MacAddress; | 25 | import org.onlab.packet.MacAddress; |
| 26 | import org.onlab.packet.VlanId; | 26 | import org.onlab.packet.VlanId; |
| 27 | import org.onlab.util.Frequency; | 27 | import org.onlab.util.Frequency; |
| 28 | +import org.onlab.util.Spectrum; | ||
| 28 | import org.onosproject.net.AnnotationKeys; | 29 | import org.onosproject.net.AnnotationKeys; |
| 29 | import org.onosproject.net.ChannelSpacing; | 30 | import org.onosproject.net.ChannelSpacing; |
| 30 | import org.onosproject.net.ConnectPoint; | 31 | import org.onosproject.net.ConnectPoint; |
| ... | @@ -100,7 +101,6 @@ class ConfigProvider implements DeviceProvider, LinkProvider, HostProvider { | ... | @@ -100,7 +101,6 @@ class ConfigProvider implements DeviceProvider, LinkProvider, HostProvider { |
| 100 | 101 | ||
| 101 | private static final String UNKNOWN = "unknown"; | 102 | private static final String UNKNOWN = "unknown"; |
| 102 | 103 | ||
| 103 | - private static final Frequency CENTER = Frequency.ofTHz(193.1); | ||
| 104 | // C-band has 4.4 THz (4,400 GHz) total bandwidth | 104 | // C-band has 4.4 THz (4,400 GHz) total bandwidth |
| 105 | private static final Frequency TOTAL = Frequency.ofTHz(4.4); | 105 | private static final Frequency TOTAL = Frequency.ofTHz(4.4); |
| 106 | 106 | ||
| ... | @@ -256,7 +256,7 @@ class ConfigProvider implements DeviceProvider, LinkProvider, HostProvider { | ... | @@ -256,7 +256,7 @@ class ConfigProvider implements DeviceProvider, LinkProvider, HostProvider { |
| 256 | // Currently, assume OMS when FIBER. Provide sane defaults. | 256 | // Currently, assume OMS when FIBER. Provide sane defaults. |
| 257 | annotations = annotations(node.get("annotations")); | 257 | annotations = annotations(node.get("annotations")); |
| 258 | return new OmsPortDescription(port, node.path("enabled").asBoolean(true), | 258 | return new OmsPortDescription(port, node.path("enabled").asBoolean(true), |
| 259 | - CENTER, CENTER.add(TOTAL), | 259 | + Spectrum.CENTER_FREQUENCY, Spectrum.CENTER_FREQUENCY.add(TOTAL), |
| 260 | Frequency.ofGHz(100), annotations); | 260 | Frequency.ofGHz(100), annotations); |
| 261 | case ODUCLT: | 261 | case ODUCLT: |
| 262 | annotations = annotations(node.get("annotations")); | 262 | annotations = annotations(node.get("annotations")); |
| ... | @@ -391,8 +391,8 @@ class ConfigProvider implements DeviceProvider, LinkProvider, HostProvider { | ... | @@ -391,8 +391,8 @@ class ConfigProvider implements DeviceProvider, LinkProvider, HostProvider { |
| 391 | // if true, there was less channels than can be tightly packed. | 391 | // if true, there was less channels than can be tightly packed. |
| 392 | Frequency grid = chl.frequency(); | 392 | Frequency grid = chl.frequency(); |
| 393 | // say Linc's 1st slot starts at CENTER and goes up from there. | 393 | // say Linc's 1st slot starts at CENTER and goes up from there. |
| 394 | - Frequency min = CENTER.add(grid); | 394 | + Frequency min = Spectrum.CENTER_FREQUENCY.add(grid); |
| 395 | - Frequency max = CENTER.add(grid.multiply(numChls)); | 395 | + Frequency max = Spectrum.CENTER_FREQUENCY.add(grid.multiply(numChls)); |
| 396 | 396 | ||
| 397 | PortDescription srcPortDesc = new OmsPortDescription(srcCp.port(), true, min, max, grid); | 397 | PortDescription srcPortDesc = new OmsPortDescription(srcCp.port(), true, min, max, grid); |
| 398 | PortDescription dstPortDesc = new OmsPortDescription(dstCp.port(), true, min, max, grid); | 398 | PortDescription dstPortDesc = new OmsPortDescription(dstCp.port(), true, min, max, grid); | ... | ... |
-
Please register or login to post a comment