mirror of
https://github.com/Telecominfraproject/oopt-gnpy-web-gui.git
synced 2025-11-02 19:17:50 +00:00
To apply rule for single fiber
This commit is contained in:
Binary file not shown.
@@ -269,6 +269,13 @@
|
||||
"fiber_category": "Single Fiber",
|
||||
"width": 2,
|
||||
"options": {
|
||||
"w_color": {
|
||||
"color": "gray",
|
||||
"highlight": "gray",
|
||||
"hover": "gray",
|
||||
"inherit": false,
|
||||
"opacity": 1
|
||||
},
|
||||
"color": {
|
||||
"color": "blue",
|
||||
"highlight": "blue",
|
||||
|
||||
@@ -1871,8 +1871,20 @@ function displayFiberHover(params) {
|
||||
if (fiberDetails.span_loss)
|
||||
span_loss = fiberDetails.span_loss;
|
||||
|
||||
//hoverData += "Fiber type : " + fiber_type + "\n";
|
||||
//hoverData += "Span length(in km) : " + span_length + "\n";
|
||||
if (fiber_type == "")
|
||||
hoverData += "<span style='color:red;'>Fiber type : " + fiber_type + "</span>\n";
|
||||
else
|
||||
hoverData += "Fiber type : " + fiber_type + "\n";
|
||||
|
||||
var spanlen = parseFloat(span_length);
|
||||
|
||||
if (spanlen <= 0)
|
||||
hoverData += "<span style='color:red;'>Span length(in km) : " + span_length + "</span>\n";
|
||||
else
|
||||
hoverData += "Span length(in km) : " + span_length + "\n";
|
||||
|
||||
//hoverData += "Loss Coefficient(dB/km) : " + loss_coefficient + "\n";
|
||||
//hoverData += "Connector IN(dB) : " + connector_in + "\n";
|
||||
//hoverData += "Connector OUT(dB) : " + connector_out + "\n";
|
||||
@@ -2751,13 +2763,21 @@ function importNetwork() {
|
||||
|
||||
var loss_Coefficient = fiber_config.Loss_coefficient;;
|
||||
span_Loss = parseFloat(span_Length * loss_Coefficient);
|
||||
|
||||
var tempColor;
|
||||
|
||||
if (fiber_Type == "" || parseFloat(span_Length) <= 0)
|
||||
tempColor = singleFiberJSON.options.w_color;
|
||||
else
|
||||
tempColor = singleFiberJSON.options.color;
|
||||
|
||||
importEdges.push({
|
||||
id: token(), from: item['source']['source-node'], to: item['destination']['dest-node'], label: labelvalue, text: labelvalue,
|
||||
view: topologyView.Functional_View, hidden: false,
|
||||
dashes: singleFiberJSON.dashes,
|
||||
fiber_category: singleFiberJSON.fiber_category,
|
||||
component_type: singleFiberJSON.component_type,
|
||||
color: singleFiberJSON.options.color,
|
||||
color: tempColor,
|
||||
width: singleFiberJSON.width,
|
||||
arrows: singleFiberJSON.options.arrows,
|
||||
//font: singleFiberJSON.options.font,
|
||||
@@ -3905,7 +3925,7 @@ function addFiberComponent(cmode, cfrom, cto, clabel, ctext, isImport) {
|
||||
view: topologyView.Functional_View, hidden: false,
|
||||
dashes: singleFiberJSON.dashes, fiber_category: singleFiberJSON.fiber_category,
|
||||
component_type: singleFiberJSON.component_type,
|
||||
color: singleFiberJSON.options.color,
|
||||
color: singleFiberJSON.options.w_color,
|
||||
width: singleFiberJSON.width,
|
||||
background: singleFiberJSON.options.background,
|
||||
arrows: singleFiberJSON.options.arrows,
|
||||
@@ -4698,9 +4718,16 @@ function singleFiberInsertNode(fiberID, node_type, callback) {
|
||||
var elabel = "";
|
||||
elabel = labelvalue;
|
||||
|
||||
var tempcolor;
|
||||
|
||||
if (fiberDetails.fiber_type != null && parseFloat(fiberDetails.span_length) > 0)
|
||||
tempcolor = singleFiberJSON.options.color;
|
||||
else
|
||||
tempcolor = singleFiberJSON.options.w_color;
|
||||
|
||||
network.body.data.edges.add({
|
||||
id: fiberID, from: fiberDetails.from, to: nodeID, label: elabel, text: labelvalue, dashes: singleFiberJSON.dashes, fiber_category: singleFiberJSON.fiber_category,
|
||||
component_type: singleFiberJSON.component_type, color: singleFiberJSON.options.color, background: singleFiberJSON.options.background,
|
||||
component_type: singleFiberJSON.component_type, color: tempcolor, background: singleFiberJSON.options.background,
|
||||
arrows: singleFiberJSON.options.arrows,
|
||||
//font: singleFiberJSON.options.font,
|
||||
smooth: smooth,
|
||||
@@ -4748,7 +4775,7 @@ function singleFiberInsertNode(fiberID, node_type, callback) {
|
||||
var fiber_config = configData[singleFiberJSON.fiber_category.replace(' ', '')].default;
|
||||
network.body.data.edges.add({
|
||||
id: newFiberID, from: nodeID, to: fiberDetails.to, label: elabel, text: labelvalue, dashes: singleFiberJSON.dashes, fiber_category: singleFiberJSON.fiber_category,
|
||||
component_type: singleFiberJSON.component_type, color: singleFiberJSON.options.color, background: singleFiberJSON.options.background,
|
||||
component_type: singleFiberJSON.component_type, color: singleFiberJSON.options.w_color, background: singleFiberJSON.options.background,
|
||||
arrows: singleFiberJSON.options.arrows,
|
||||
//font: singleFiberJSON.options.font,
|
||||
smooth: smooth,
|
||||
@@ -5474,7 +5501,7 @@ function updateSingleFiber(fiberID) {
|
||||
elabel = label;
|
||||
|
||||
network.body.data.edges.update({
|
||||
id: id, label: elabel, text: label, fiber_type: fiber_type, span_length: span_length,
|
||||
id: id, label: elabel, text: label, fiber_type: fiber_type, span_length: span_length, color: singleFiberJSON.options.color,
|
||||
loss_coefficient: loss_coefficient, connector_in: connector_in, connector_out: connector_out, span_loss: span_loss
|
||||
});
|
||||
data.nodes.off("*", change_history_back);
|
||||
|
||||
Reference in New Issue
Block a user