mirror of
https://github.com/Telecominfraproject/oopt-gnpy-web-gui.git
synced 2025-11-02 11:07:47 +00:00
Highlight issues fixed
This commit is contained in:
Binary file not shown.
@@ -376,22 +376,24 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
$('#cbxLength_Based_Loss').change(function () {
|
$('#cbxLength_Based_Loss').change(function () {
|
||||||
if (this.checked) {
|
if (this.checked) {
|
||||||
var span_length = $("#txtSpan_Length").val();
|
var span_length = $("#txtSpan_Length").val().trim();
|
||||||
var spanlen = parseFloat(span_length);
|
var spanlen = parseFloat(span_length);
|
||||||
var loss_coeff = $("#txtLoss_Coefficient").val();
|
var loss_coeff = $("#txtLoss_Coefficient").val().trim();
|
||||||
var lossCoeff = parseFloat(loss_coeff);
|
var lossCoeff = parseFloat(loss_coeff);
|
||||||
if (isNaN(span_length) || spanlen <= 0 || span_length == "" || isNaN(loss_coeff) || lossCoeff <= 0 || loss_coeff == "") {
|
if (isNaN(span_length) || spanlen <= 0 || span_length == "" || isNaN(loss_coeff) || lossCoeff <= 0 || loss_coeff == "") {
|
||||||
|
$('#cbxLength_Based_Loss').prop('checked', false);
|
||||||
showMessage(alertType.Error, "Length based loss requires span length and loss coefficient to be entered");
|
showMessage(alertType.Error, "Length based loss requires span length and loss coefficient to be entered");
|
||||||
$("#txtLoss_Coefficient").addClass('input_error');
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fiberLengthCal('txtSpan_Length', 'txtLoss_Coefficient', 'txtSpan_Loss');
|
fiberLengthCal('txtSpan_Length', 'txtLoss_Coefficient', 'txtSpan_Loss');
|
||||||
$("#txtLoss_Coefficient").removeClass('input_error');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$("#txtLoss_Coefficient").removeClass('input_error');
|
$("#txtSpan_Loss").val('');
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
$('#cbx_FiberALBL').change(function () {
|
$('#cbx_FiberALBL').change(function () {
|
||||||
if (this.checked) {
|
if (this.checked) {
|
||||||
@@ -1364,6 +1366,7 @@ function draw(isImport) {
|
|||||||
showMessage(alertType.Error, 'Please select same type of node (' + type_name + ')');
|
showMessage(alertType.Error, 'Please select same type of node (' + type_name + ')');
|
||||||
network.body.nodes[clickedNode.id].selected = false;
|
network.body.nodes[clickedNode.id].selected = false;
|
||||||
network.redraw();
|
network.redraw();
|
||||||
|
nodeSelect = true;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1372,6 +1375,7 @@ function draw(isImport) {
|
|||||||
showMessage(alertType.Error, 'Please select same type of node (' + type_name + ')');
|
showMessage(alertType.Error, 'Please select same type of node (' + type_name + ')');
|
||||||
network.body.nodes[clickedNode.id].selected = false;
|
network.body.nodes[clickedNode.id].selected = false;
|
||||||
network.redraw();
|
network.redraw();
|
||||||
|
nodeSelect = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -5439,11 +5443,14 @@ function updateRoadm(nodeID) {
|
|||||||
|
|
||||||
if (nodeID.length > 1) {
|
if (nodeID.length > 1) {
|
||||||
for (var i = 0; i < nodeID.length; i++) {
|
for (var i = 0; i < nodeID.length; i++) {
|
||||||
|
|
||||||
|
if (network.body.data.nodes.get(nodeID[i]).image == DIR + roadmJSON.h_image) {
|
||||||
network.body.data.nodes.update({
|
network.body.data.nodes.update({
|
||||||
id: nodeID[i], roadm_type: $("#ddlRoadmType").val()
|
id: nodeID[i], roadm_type: $("#ddlRoadmType").val()
|
||||||
});
|
});
|
||||||
realUpdate_Roadm(nodeID[i], $("#ddlRoadmType").val());
|
realUpdate_Roadm(nodeID[i], $("#ddlRoadmType").val());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
network.body.data.nodes.update({
|
network.body.data.nodes.update({
|
||||||
id: id, label: label, roadm_type: $("#ddlRoadmType").val()
|
id: id, label: label, roadm_type: $("#ddlRoadmType").val()
|
||||||
@@ -5691,11 +5698,14 @@ function updateAmplifier(nodeID) {
|
|||||||
|
|
||||||
if (nodeID.length > 1) {
|
if (nodeID.length > 1) {
|
||||||
for (var i = 0; i < nodeID.length; i++) {
|
for (var i = 0; i < nodeID.length; i++) {
|
||||||
|
|
||||||
|
if (network.body.data.nodes.get(nodeID[i]).image == DIR + amplifierJSON.h_image) {
|
||||||
network.body.data.nodes.update({
|
network.body.data.nodes.update({
|
||||||
id: nodeID[i], amp_type: $("#ddlAmplifierType").val()
|
id: nodeID[i], amp_type: $("#ddlAmplifierType").val()
|
||||||
});
|
});
|
||||||
realUpdate_Amplifier(nodeID[i], $("#ddlAmplifierType").val());
|
realUpdate_Amplifier(nodeID[i], $("#ddlAmplifierType").val());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
network.body.data.nodes.update({
|
network.body.data.nodes.update({
|
||||||
id: id, label: label, amp_type: $("#ddlAmplifierType").val()
|
id: id, label: label, amp_type: $("#ddlAmplifierType").val()
|
||||||
@@ -5817,11 +5827,13 @@ function updateRamanAmp(nodeID) {
|
|||||||
if (amp_category == ramanampJSON.amp_category) {
|
if (amp_category == ramanampJSON.amp_category) {
|
||||||
if (nodeID.length > 1) {
|
if (nodeID.length > 1) {
|
||||||
for (var i = 0; i < nodeID.length; i++) {
|
for (var i = 0; i < nodeID.length; i++) {
|
||||||
|
if (network.body.data.nodes.get(nodeID[i]).image == DIR + ramanampJSON.h_image) {
|
||||||
network.body.data.nodes.update({
|
network.body.data.nodes.update({
|
||||||
id: nodeID[i], amp_type: $("#ddlRamanAmpType").val(), category: $("#ddlRamanAmpCategory").val()
|
id: nodeID[i], amp_type: $("#ddlRamanAmpType").val(), category: $("#ddlRamanAmpCategory").val()
|
||||||
});
|
});
|
||||||
realUpdate_RamanAmp(nodeID[i], $("#ddlRamanAmpType").val());
|
realUpdate_RamanAmp(nodeID[i], $("#ddlRamanAmpType").val());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
network.body.data.nodes.update({
|
network.body.data.nodes.update({
|
||||||
id: id, label: label, amp_type: $("#ddlRamanAmpType").val(), category: $("#ddlRamanAmpCategory").val()
|
id: id, label: label, amp_type: $("#ddlRamanAmpType").val(), category: $("#ddlRamanAmpCategory").val()
|
||||||
@@ -5916,7 +5928,9 @@ function updateTransceiver(nodeID) {
|
|||||||
|
|
||||||
if (nameLengthValidation("txtTransceiverName")) {
|
if (nameLengthValidation("txtTransceiverName")) {
|
||||||
|
|
||||||
|
if (nodeID.length > 1) {
|
||||||
for (var i = 0; i < nodeID.length; i++) {
|
for (var i = 0; i < nodeID.length; i++) {
|
||||||
|
if (network.body.data.nodes.get(nodeID[i]).image == DIR + transceiverJSON.h_image) {
|
||||||
var id = nodeID[i];
|
var id = nodeID[i];
|
||||||
var label = $("#txtTransceiverName").val().trim();
|
var label = $("#txtTransceiverName").val().trim();
|
||||||
var nodeDetails = network.body.data.nodes.get(id);
|
var nodeDetails = network.body.data.nodes.get(id);
|
||||||
@@ -5988,8 +6002,85 @@ function updateTransceiver(nodeID) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var id = nodeID[nodeID.length-1];
|
||||||
|
var label = $("#txtTransceiverName").val().trim();
|
||||||
|
var nodeDetails = network.body.data.nodes.get(id);
|
||||||
|
var transceiverType = $("#ddlTransceiverType").val();
|
||||||
|
if (transceiverType == null || transceiverType == "") {
|
||||||
|
showMessage(alertType.Error, 'Please select transceiver type');
|
||||||
|
$("#ddlTransceiverType").addClass('input_error');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$("#ddlTransceiverType").removeClass('input_error');
|
||||||
|
|
||||||
|
|
||||||
|
var connectedEdges = network.getConnectedEdges(id);
|
||||||
|
var fromTransType = "";
|
||||||
|
var toTransType = "";
|
||||||
|
var isOk = true;
|
||||||
|
$.each(connectedEdges, function (index, item) {
|
||||||
|
|
||||||
|
if (!isOk)
|
||||||
|
return;
|
||||||
|
var edgeDetails = network.body.data.edges.get(item);
|
||||||
|
if (edgeDetails.component_type == serviceJSON.component_type) {
|
||||||
|
if (edgeDetails.from == id) {
|
||||||
|
|
||||||
|
fromTransType = transceiverType;
|
||||||
|
toTransType = network.body.data.nodes.get(edgeDetails.to).transceiver_type;
|
||||||
|
}
|
||||||
|
else if (edgeDetails.to == id) {
|
||||||
|
toTransType = transceiverType;
|
||||||
|
fromTransType = network.body.data.nodes.get(edgeDetails.from).transceiver_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (toTransType != fromTransType) {
|
||||||
|
isOk = false;
|
||||||
|
showMessage(alertType.Error, serviceJSON.component_type + " can be created/updated only between " + transceiverJSON.node_type + " of same type");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
if (isOk) {
|
||||||
|
if (nodeDetails.node_type == transceiverJSON.node_type) {
|
||||||
|
|
||||||
|
if (nodeID.length > 1) {
|
||||||
|
|
||||||
|
network.body.data.nodes.update({
|
||||||
|
id: id, transceiver_type: transceiverType
|
||||||
|
});
|
||||||
|
realUpdate_Transceiver(id, "");
|
||||||
|
|
||||||
|
} else {
|
||||||
|
network.body.data.nodes.update({
|
||||||
|
id: id, label: label, transceiver_type: transceiverType
|
||||||
|
});
|
||||||
|
realUpdate_Transceiver(id, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
//if (tempEdge.length > 1) {
|
||||||
|
// removeSpanInError(id, true);
|
||||||
|
//}
|
||||||
|
//else {
|
||||||
|
|
||||||
|
// removeID = "#spanTF" + id.replace(/\s/g, '');
|
||||||
|
// $(removeID).remove();
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
clearTransceiver();
|
clearTransceiver();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6224,7 +6315,7 @@ function singleFiberEdit(fiberID, callback) {
|
|||||||
$("#txtConnector_OUT").val(edgeDetails.connector_out);
|
$("#txtConnector_OUT").val(edgeDetails.connector_out);
|
||||||
$("#txtSpan_Loss").val(edgeDetails.span_loss);
|
$("#txtSpan_Loss").val(edgeDetails.span_loss);
|
||||||
|
|
||||||
var span_length = $("#txtSpan_Length").val();
|
var span_length = $("#txtSpan_Length").val().trim();
|
||||||
var spanlen = parseFloat(span_length);
|
var spanlen = parseFloat(span_length);
|
||||||
if (isNaN(span_length) || spanlen <= 0 || span_length == "") {
|
if (isNaN(span_length) || spanlen <= 0 || span_length == "") {
|
||||||
$("#txtSpan_Length").addClass('input_error');
|
$("#txtSpan_Length").addClass('input_error');
|
||||||
@@ -6252,8 +6343,8 @@ function updateSingleFiber(fiberID) {
|
|||||||
var id = fiberID;
|
var id = fiberID;
|
||||||
var label = $("#txtSinlgeFiberName").val().trim();
|
var label = $("#txtSinlgeFiberName").val().trim();
|
||||||
var fiber_type = $("#ddlSingleFiberType").val();
|
var fiber_type = $("#ddlSingleFiberType").val();
|
||||||
var span_length = $("#txtSpan_Length").val();
|
var span_length = $("#txtSpan_Length").val().trim();
|
||||||
var loss_coefficient = $("#txtLoss_Coefficient").val();
|
var loss_coefficient = $("#txtLoss_Coefficient").val().trim();
|
||||||
var connector_in = $("#txtConnector_IN").val();
|
var connector_in = $("#txtConnector_IN").val();
|
||||||
var connector_out = $("#txtConnector_OUT").val();
|
var connector_out = $("#txtConnector_OUT").val();
|
||||||
var span_loss = $("#txtSpan_Loss").val();
|
var span_loss = $("#txtSpan_Loss").val();
|
||||||
@@ -6276,15 +6367,11 @@ function updateSingleFiber(fiberID) {
|
|||||||
$("#txtSpan_Length").removeClass('input_error');
|
$("#txtSpan_Length").removeClass('input_error');
|
||||||
|
|
||||||
if ($('#cbxLength_Based_Loss').is(":checked")) {
|
if ($('#cbxLength_Based_Loss').is(":checked")) {
|
||||||
var loss_coeff = $("#txtLoss_Coefficient").val();
|
var lossCoeff = parseFloat(loss_coefficient);
|
||||||
var lossCoeff = parseFloat(loss_coeff);
|
if (isNaN(loss_coefficient) || lossCoeff <= 0 || loss_coefficient == "") {
|
||||||
if (isNaN(loss_coeff) || lossCoeff <= 0 || loss_coeff == "") {
|
|
||||||
showMessage(alertType.Error, "Length based loss requires span length and loss coefficient to be entered");
|
showMessage(alertType.Error, "Length based loss requires span length and loss coefficient to be entered");
|
||||||
$("#txtLoss_Coefficient").addClass('input_error');
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
$("#txtLoss_Coefficient").removeClass('input_error');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var fiberDetails = network.body.data.edges.get(fiberID);
|
var fiberDetails = network.body.data.edges.get(fiberID);
|
||||||
@@ -6329,7 +6416,6 @@ function clearSingleFiber() {
|
|||||||
|
|
||||||
$("#ddlSingleFiberType").removeClass('input_error');
|
$("#ddlSingleFiberType").removeClass('input_error');
|
||||||
$("#txtSpan_Length").removeClass('input_error');
|
$("#txtSpan_Length").removeClass('input_error');
|
||||||
$("#txtLoss_Coefficient").removeClass('input_error');
|
|
||||||
|
|
||||||
$('#cbxLength_Based_Loss').prop('checked', false);
|
$('#cbxLength_Based_Loss').prop('checked', false);
|
||||||
closeDrawer('singlefiber');
|
closeDrawer('singlefiber');
|
||||||
@@ -7781,6 +7867,7 @@ function removeSpanInError(item, transUpdate) {
|
|||||||
id: nodeDetails.id, image: DIR + image, size: roadmJSON.size, is_error: false
|
id: nodeDetails.id, image: DIR + image, size: roadmJSON.size, is_error: false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log(nodeDetails.id, DIR + image);
|
||||||
data.nodes.on("*", change_history_back);
|
data.nodes.on("*", change_history_back);
|
||||||
data.edges.on("*", change_history_back);
|
data.edges.on("*", change_history_back);
|
||||||
|
|
||||||
@@ -8036,8 +8123,69 @@ function remove_NodeHighlight() {
|
|||||||
var nodeDetails = hNodes[i];
|
var nodeDetails = hNodes[i];
|
||||||
data.nodes.off("*", change_history_back);
|
data.nodes.off("*", change_history_back);
|
||||||
data.edges.off("*", change_history_back);
|
data.edges.off("*", change_history_back);
|
||||||
|
|
||||||
|
if (nodeDetails.node_type == roadmJSON.node_type) {
|
||||||
|
if (nodeDetails.image != DIR + roadmJSON.image) {
|
||||||
network.body.data.nodes.update({
|
network.body.data.nodes.update({
|
||||||
id: nodeDetails.id, image: nodeDetails.h_image, is_highlight: false
|
id: nodeDetails.id, image: nodeDetails.h_image, is_highlight: false
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
network.body.data.nodes.update({
|
||||||
|
id: nodeDetails.id, is_highlight: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (nodeDetails.node_type == fusedJSON.node_type) {
|
||||||
|
if (nodeDetails.image != DIR + fusedJSON.image) {
|
||||||
|
network.body.data.nodes.update({
|
||||||
|
id: nodeDetails.id, image: nodeDetails.h_image, is_highlight: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
network.body.data.nodes.update({
|
||||||
|
id: nodeDetails.id, is_highlight: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (nodeDetails.node_type == transceiverJSON.node_type) {
|
||||||
|
if (nodeDetails.image != DIR + transceiverJSON.image) {
|
||||||
|
network.body.data.nodes.update({
|
||||||
|
id: nodeDetails.id, image: nodeDetails.h_image, is_highlight: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
network.body.data.nodes.update({
|
||||||
|
id: nodeDetails.id, is_highlight: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (nodeDetails.node_type == amplifierJSON.node_type) {
|
||||||
|
if (nodeDetails.amp_category == amplifierJSON.amp_category) {
|
||||||
|
if (nodeDetails.image != DIR + amplifierJSON.image) {
|
||||||
|
network.body.data.nodes.update({
|
||||||
|
id: nodeDetails.id, image: nodeDetails.h_image, is_highlight: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
network.body.data.nodes.update({
|
||||||
|
id: nodeDetails.id, is_highlight: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (nodeDetails.amp_category == ramanampJSON.amp_category) {
|
||||||
|
if (nodeDetails.image != DIR + ramanampJSON.image) {
|
||||||
|
network.body.data.nodes.update({
|
||||||
|
id: nodeDetails.id, image: nodeDetails.h_image, is_highlight: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
network.body.data.nodes.update({
|
||||||
|
id: nodeDetails.id, is_highlight: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -19,24 +19,19 @@
|
|||||||
var span_length = $("#txtLoss_Coefficient").val().trim();
|
var span_length = $("#txtLoss_Coefficient").val().trim();
|
||||||
var spanlen = parseFloat(span_length);
|
var spanlen = parseFloat(span_length);
|
||||||
if (isNaN(span_length) || spanlen <= 0 || span_length == "") {
|
if (isNaN(span_length) || spanlen <= 0 || span_length == "") {
|
||||||
$("#txtLoss_Coefficient").addClass('input_error');
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
$("#txtLoss_Coefficient").removeClass('input_error');
|
|
||||||
|
|
||||||
fiberCalc();
|
fiberCalc();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
$("#txtLoss_Coefficient").removeClass('input_error');
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
function fiberCalc() {
|
function fiberCalc() {
|
||||||
var span_length = $("#txtSpan_Length").val();
|
var span_length = $("#txtSpan_Length").val().trim();
|
||||||
var spanlen = parseFloat(span_length);
|
var spanlen = parseFloat(span_length);
|
||||||
var loss_coeff = $("#txtLoss_Coefficient").val();
|
var loss_coeff = $("#txtLoss_Coefficient").val().trim();
|
||||||
var lossCoeff = parseFloat(loss_coeff);
|
var lossCoeff = parseFloat(loss_coeff);
|
||||||
if (!isNaN(span_length) || spanlen >= 0 || span_length != "" || !isNaN(loss_coeff) || lossCoeff >= 0 || loss_coeff != "")
|
if (!isNaN(span_length) || spanlen >= 0 || span_length != "" || !isNaN(loss_coeff) || lossCoeff >= 0 || loss_coeff != "")
|
||||||
fiberLengthCal('txtSpan_Length', 'txtLoss_Coefficient', 'txtSpan_Loss');
|
fiberLengthCal('txtSpan_Length', 'txtLoss_Coefficient', 'txtSpan_Loss');
|
||||||
|
|||||||
Binary file not shown.
@@ -376,22 +376,24 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
$('#cbxLength_Based_Loss').change(function () {
|
$('#cbxLength_Based_Loss').change(function () {
|
||||||
if (this.checked) {
|
if (this.checked) {
|
||||||
var span_length = $("#txtSpan_Length").val();
|
var span_length = $("#txtSpan_Length").val().trim();
|
||||||
var spanlen = parseFloat(span_length);
|
var spanlen = parseFloat(span_length);
|
||||||
var loss_coeff = $("#txtLoss_Coefficient").val();
|
var loss_coeff = $("#txtLoss_Coefficient").val().trim();
|
||||||
var lossCoeff = parseFloat(loss_coeff);
|
var lossCoeff = parseFloat(loss_coeff);
|
||||||
if (isNaN(span_length) || spanlen <= 0 || span_length == "" || isNaN(loss_coeff) || lossCoeff <= 0 || loss_coeff == "") {
|
if (isNaN(span_length) || spanlen <= 0 || span_length == "" || isNaN(loss_coeff) || lossCoeff <= 0 || loss_coeff == "") {
|
||||||
|
$('#cbxLength_Based_Loss').prop('checked', false);
|
||||||
showMessage(alertType.Error, "Length based loss requires span length and loss coefficient to be entered");
|
showMessage(alertType.Error, "Length based loss requires span length and loss coefficient to be entered");
|
||||||
$("#txtLoss_Coefficient").addClass('input_error');
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fiberLengthCal('txtSpan_Length', 'txtLoss_Coefficient', 'txtSpan_Loss');
|
fiberLengthCal('txtSpan_Length', 'txtLoss_Coefficient', 'txtSpan_Loss');
|
||||||
$("#txtLoss_Coefficient").removeClass('input_error');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$("#txtLoss_Coefficient").removeClass('input_error');
|
$("#txtSpan_Loss").val('');
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
$('#cbx_FiberALBL').change(function () {
|
$('#cbx_FiberALBL').change(function () {
|
||||||
if (this.checked) {
|
if (this.checked) {
|
||||||
@@ -1364,6 +1366,7 @@ function draw(isImport) {
|
|||||||
showMessage(alertType.Error, 'Please select same type of node (' + type_name + ')');
|
showMessage(alertType.Error, 'Please select same type of node (' + type_name + ')');
|
||||||
network.body.nodes[clickedNode.id].selected = false;
|
network.body.nodes[clickedNode.id].selected = false;
|
||||||
network.redraw();
|
network.redraw();
|
||||||
|
nodeSelect = true;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1372,6 +1375,7 @@ function draw(isImport) {
|
|||||||
showMessage(alertType.Error, 'Please select same type of node (' + type_name + ')');
|
showMessage(alertType.Error, 'Please select same type of node (' + type_name + ')');
|
||||||
network.body.nodes[clickedNode.id].selected = false;
|
network.body.nodes[clickedNode.id].selected = false;
|
||||||
network.redraw();
|
network.redraw();
|
||||||
|
nodeSelect = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -5439,11 +5443,14 @@ function updateRoadm(nodeID) {
|
|||||||
|
|
||||||
if (nodeID.length > 1) {
|
if (nodeID.length > 1) {
|
||||||
for (var i = 0; i < nodeID.length; i++) {
|
for (var i = 0; i < nodeID.length; i++) {
|
||||||
|
|
||||||
|
if (network.body.data.nodes.get(nodeID[i]).image == DIR + roadmJSON.h_image) {
|
||||||
network.body.data.nodes.update({
|
network.body.data.nodes.update({
|
||||||
id: nodeID[i], roadm_type: $("#ddlRoadmType").val()
|
id: nodeID[i], roadm_type: $("#ddlRoadmType").val()
|
||||||
});
|
});
|
||||||
realUpdate_Roadm(nodeID[i], $("#ddlRoadmType").val());
|
realUpdate_Roadm(nodeID[i], $("#ddlRoadmType").val());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
network.body.data.nodes.update({
|
network.body.data.nodes.update({
|
||||||
id: id, label: label, roadm_type: $("#ddlRoadmType").val()
|
id: id, label: label, roadm_type: $("#ddlRoadmType").val()
|
||||||
@@ -5691,11 +5698,14 @@ function updateAmplifier(nodeID) {
|
|||||||
|
|
||||||
if (nodeID.length > 1) {
|
if (nodeID.length > 1) {
|
||||||
for (var i = 0; i < nodeID.length; i++) {
|
for (var i = 0; i < nodeID.length; i++) {
|
||||||
|
|
||||||
|
if (network.body.data.nodes.get(nodeID[i]).image == DIR + amplifierJSON.h_image) {
|
||||||
network.body.data.nodes.update({
|
network.body.data.nodes.update({
|
||||||
id: nodeID[i], amp_type: $("#ddlAmplifierType").val()
|
id: nodeID[i], amp_type: $("#ddlAmplifierType").val()
|
||||||
});
|
});
|
||||||
realUpdate_Amplifier(nodeID[i], $("#ddlAmplifierType").val());
|
realUpdate_Amplifier(nodeID[i], $("#ddlAmplifierType").val());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
network.body.data.nodes.update({
|
network.body.data.nodes.update({
|
||||||
id: id, label: label, amp_type: $("#ddlAmplifierType").val()
|
id: id, label: label, amp_type: $("#ddlAmplifierType").val()
|
||||||
@@ -5817,11 +5827,13 @@ function updateRamanAmp(nodeID) {
|
|||||||
if (amp_category == ramanampJSON.amp_category) {
|
if (amp_category == ramanampJSON.amp_category) {
|
||||||
if (nodeID.length > 1) {
|
if (nodeID.length > 1) {
|
||||||
for (var i = 0; i < nodeID.length; i++) {
|
for (var i = 0; i < nodeID.length; i++) {
|
||||||
|
if (network.body.data.nodes.get(nodeID[i]).image == DIR + ramanampJSON.h_image) {
|
||||||
network.body.data.nodes.update({
|
network.body.data.nodes.update({
|
||||||
id: nodeID[i], amp_type: $("#ddlRamanAmpType").val(), category: $("#ddlRamanAmpCategory").val()
|
id: nodeID[i], amp_type: $("#ddlRamanAmpType").val(), category: $("#ddlRamanAmpCategory").val()
|
||||||
});
|
});
|
||||||
realUpdate_RamanAmp(nodeID[i], $("#ddlRamanAmpType").val());
|
realUpdate_RamanAmp(nodeID[i], $("#ddlRamanAmpType").val());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
network.body.data.nodes.update({
|
network.body.data.nodes.update({
|
||||||
id: id, label: label, amp_type: $("#ddlRamanAmpType").val(), category: $("#ddlRamanAmpCategory").val()
|
id: id, label: label, amp_type: $("#ddlRamanAmpType").val(), category: $("#ddlRamanAmpCategory").val()
|
||||||
@@ -5916,7 +5928,9 @@ function updateTransceiver(nodeID) {
|
|||||||
|
|
||||||
if (nameLengthValidation("txtTransceiverName")) {
|
if (nameLengthValidation("txtTransceiverName")) {
|
||||||
|
|
||||||
|
if (nodeID.length > 1) {
|
||||||
for (var i = 0; i < nodeID.length; i++) {
|
for (var i = 0; i < nodeID.length; i++) {
|
||||||
|
if (network.body.data.nodes.get(nodeID[i]).image == DIR + transceiverJSON.h_image) {
|
||||||
var id = nodeID[i];
|
var id = nodeID[i];
|
||||||
var label = $("#txtTransceiverName").val().trim();
|
var label = $("#txtTransceiverName").val().trim();
|
||||||
var nodeDetails = network.body.data.nodes.get(id);
|
var nodeDetails = network.body.data.nodes.get(id);
|
||||||
@@ -5988,8 +6002,85 @@ function updateTransceiver(nodeID) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var id = nodeID[nodeID.length-1];
|
||||||
|
var label = $("#txtTransceiverName").val().trim();
|
||||||
|
var nodeDetails = network.body.data.nodes.get(id);
|
||||||
|
var transceiverType = $("#ddlTransceiverType").val();
|
||||||
|
if (transceiverType == null || transceiverType == "") {
|
||||||
|
showMessage(alertType.Error, 'Please select transceiver type');
|
||||||
|
$("#ddlTransceiverType").addClass('input_error');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$("#ddlTransceiverType").removeClass('input_error');
|
||||||
|
|
||||||
|
|
||||||
|
var connectedEdges = network.getConnectedEdges(id);
|
||||||
|
var fromTransType = "";
|
||||||
|
var toTransType = "";
|
||||||
|
var isOk = true;
|
||||||
|
$.each(connectedEdges, function (index, item) {
|
||||||
|
|
||||||
|
if (!isOk)
|
||||||
|
return;
|
||||||
|
var edgeDetails = network.body.data.edges.get(item);
|
||||||
|
if (edgeDetails.component_type == serviceJSON.component_type) {
|
||||||
|
if (edgeDetails.from == id) {
|
||||||
|
|
||||||
|
fromTransType = transceiverType;
|
||||||
|
toTransType = network.body.data.nodes.get(edgeDetails.to).transceiver_type;
|
||||||
|
}
|
||||||
|
else if (edgeDetails.to == id) {
|
||||||
|
toTransType = transceiverType;
|
||||||
|
fromTransType = network.body.data.nodes.get(edgeDetails.from).transceiver_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (toTransType != fromTransType) {
|
||||||
|
isOk = false;
|
||||||
|
showMessage(alertType.Error, serviceJSON.component_type + " can be created/updated only between " + transceiverJSON.node_type + " of same type");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
if (isOk) {
|
||||||
|
if (nodeDetails.node_type == transceiverJSON.node_type) {
|
||||||
|
|
||||||
|
if (nodeID.length > 1) {
|
||||||
|
|
||||||
|
network.body.data.nodes.update({
|
||||||
|
id: id, transceiver_type: transceiverType
|
||||||
|
});
|
||||||
|
realUpdate_Transceiver(id, "");
|
||||||
|
|
||||||
|
} else {
|
||||||
|
network.body.data.nodes.update({
|
||||||
|
id: id, label: label, transceiver_type: transceiverType
|
||||||
|
});
|
||||||
|
realUpdate_Transceiver(id, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
//if (tempEdge.length > 1) {
|
||||||
|
// removeSpanInError(id, true);
|
||||||
|
//}
|
||||||
|
//else {
|
||||||
|
|
||||||
|
// removeID = "#spanTF" + id.replace(/\s/g, '');
|
||||||
|
// $(removeID).remove();
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
clearTransceiver();
|
clearTransceiver();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6224,7 +6315,7 @@ function singleFiberEdit(fiberID, callback) {
|
|||||||
$("#txtConnector_OUT").val(edgeDetails.connector_out);
|
$("#txtConnector_OUT").val(edgeDetails.connector_out);
|
||||||
$("#txtSpan_Loss").val(edgeDetails.span_loss);
|
$("#txtSpan_Loss").val(edgeDetails.span_loss);
|
||||||
|
|
||||||
var span_length = $("#txtSpan_Length").val();
|
var span_length = $("#txtSpan_Length").val().trim();
|
||||||
var spanlen = parseFloat(span_length);
|
var spanlen = parseFloat(span_length);
|
||||||
if (isNaN(span_length) || spanlen <= 0 || span_length == "") {
|
if (isNaN(span_length) || spanlen <= 0 || span_length == "") {
|
||||||
$("#txtSpan_Length").addClass('input_error');
|
$("#txtSpan_Length").addClass('input_error');
|
||||||
@@ -6252,8 +6343,8 @@ function updateSingleFiber(fiberID) {
|
|||||||
var id = fiberID;
|
var id = fiberID;
|
||||||
var label = $("#txtSinlgeFiberName").val().trim();
|
var label = $("#txtSinlgeFiberName").val().trim();
|
||||||
var fiber_type = $("#ddlSingleFiberType").val();
|
var fiber_type = $("#ddlSingleFiberType").val();
|
||||||
var span_length = $("#txtSpan_Length").val();
|
var span_length = $("#txtSpan_Length").val().trim();
|
||||||
var loss_coefficient = $("#txtLoss_Coefficient").val();
|
var loss_coefficient = $("#txtLoss_Coefficient").val().trim();
|
||||||
var connector_in = $("#txtConnector_IN").val();
|
var connector_in = $("#txtConnector_IN").val();
|
||||||
var connector_out = $("#txtConnector_OUT").val();
|
var connector_out = $("#txtConnector_OUT").val();
|
||||||
var span_loss = $("#txtSpan_Loss").val();
|
var span_loss = $("#txtSpan_Loss").val();
|
||||||
@@ -6276,15 +6367,11 @@ function updateSingleFiber(fiberID) {
|
|||||||
$("#txtSpan_Length").removeClass('input_error');
|
$("#txtSpan_Length").removeClass('input_error');
|
||||||
|
|
||||||
if ($('#cbxLength_Based_Loss').is(":checked")) {
|
if ($('#cbxLength_Based_Loss').is(":checked")) {
|
||||||
var loss_coeff = $("#txtLoss_Coefficient").val();
|
var lossCoeff = parseFloat(loss_coefficient);
|
||||||
var lossCoeff = parseFloat(loss_coeff);
|
if (isNaN(loss_coefficient) || lossCoeff <= 0 || loss_coefficient == "") {
|
||||||
if (isNaN(loss_coeff) || lossCoeff <= 0 || loss_coeff == "") {
|
|
||||||
showMessage(alertType.Error, "Length based loss requires span length and loss coefficient to be entered");
|
showMessage(alertType.Error, "Length based loss requires span length and loss coefficient to be entered");
|
||||||
$("#txtLoss_Coefficient").addClass('input_error');
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
$("#txtLoss_Coefficient").removeClass('input_error');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var fiberDetails = network.body.data.edges.get(fiberID);
|
var fiberDetails = network.body.data.edges.get(fiberID);
|
||||||
@@ -6329,7 +6416,6 @@ function clearSingleFiber() {
|
|||||||
|
|
||||||
$("#ddlSingleFiberType").removeClass('input_error');
|
$("#ddlSingleFiberType").removeClass('input_error');
|
||||||
$("#txtSpan_Length").removeClass('input_error');
|
$("#txtSpan_Length").removeClass('input_error');
|
||||||
$("#txtLoss_Coefficient").removeClass('input_error');
|
|
||||||
|
|
||||||
$('#cbxLength_Based_Loss').prop('checked', false);
|
$('#cbxLength_Based_Loss').prop('checked', false);
|
||||||
closeDrawer('singlefiber');
|
closeDrawer('singlefiber');
|
||||||
@@ -7781,6 +7867,7 @@ function removeSpanInError(item, transUpdate) {
|
|||||||
id: nodeDetails.id, image: DIR + image, size: roadmJSON.size, is_error: false
|
id: nodeDetails.id, image: DIR + image, size: roadmJSON.size, is_error: false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log(nodeDetails.id, DIR + image);
|
||||||
data.nodes.on("*", change_history_back);
|
data.nodes.on("*", change_history_back);
|
||||||
data.edges.on("*", change_history_back);
|
data.edges.on("*", change_history_back);
|
||||||
|
|
||||||
@@ -8036,8 +8123,69 @@ function remove_NodeHighlight() {
|
|||||||
var nodeDetails = hNodes[i];
|
var nodeDetails = hNodes[i];
|
||||||
data.nodes.off("*", change_history_back);
|
data.nodes.off("*", change_history_back);
|
||||||
data.edges.off("*", change_history_back);
|
data.edges.off("*", change_history_back);
|
||||||
|
|
||||||
|
if (nodeDetails.node_type == roadmJSON.node_type) {
|
||||||
|
if (nodeDetails.image != DIR + roadmJSON.image) {
|
||||||
network.body.data.nodes.update({
|
network.body.data.nodes.update({
|
||||||
id: nodeDetails.id, image: nodeDetails.h_image, is_highlight: false
|
id: nodeDetails.id, image: nodeDetails.h_image, is_highlight: false
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
network.body.data.nodes.update({
|
||||||
|
id: nodeDetails.id, is_highlight: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (nodeDetails.node_type == fusedJSON.node_type) {
|
||||||
|
if (nodeDetails.image != DIR + fusedJSON.image) {
|
||||||
|
network.body.data.nodes.update({
|
||||||
|
id: nodeDetails.id, image: nodeDetails.h_image, is_highlight: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
network.body.data.nodes.update({
|
||||||
|
id: nodeDetails.id, is_highlight: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (nodeDetails.node_type == transceiverJSON.node_type) {
|
||||||
|
if (nodeDetails.image != DIR + transceiverJSON.image) {
|
||||||
|
network.body.data.nodes.update({
|
||||||
|
id: nodeDetails.id, image: nodeDetails.h_image, is_highlight: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
network.body.data.nodes.update({
|
||||||
|
id: nodeDetails.id, is_highlight: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (nodeDetails.node_type == amplifierJSON.node_type) {
|
||||||
|
if (nodeDetails.amp_category == amplifierJSON.amp_category) {
|
||||||
|
if (nodeDetails.image != DIR + amplifierJSON.image) {
|
||||||
|
network.body.data.nodes.update({
|
||||||
|
id: nodeDetails.id, image: nodeDetails.h_image, is_highlight: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
network.body.data.nodes.update({
|
||||||
|
id: nodeDetails.id, is_highlight: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (nodeDetails.amp_category == ramanampJSON.amp_category) {
|
||||||
|
if (nodeDetails.image != DIR + ramanampJSON.image) {
|
||||||
|
network.body.data.nodes.update({
|
||||||
|
id: nodeDetails.id, image: nodeDetails.h_image, is_highlight: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
network.body.data.nodes.update({
|
||||||
|
id: nodeDetails.id, is_highlight: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -19,24 +19,19 @@
|
|||||||
var span_length = $("#txtLoss_Coefficient").val().trim();
|
var span_length = $("#txtLoss_Coefficient").val().trim();
|
||||||
var spanlen = parseFloat(span_length);
|
var spanlen = parseFloat(span_length);
|
||||||
if (isNaN(span_length) || spanlen <= 0 || span_length == "") {
|
if (isNaN(span_length) || spanlen <= 0 || span_length == "") {
|
||||||
$("#txtLoss_Coefficient").addClass('input_error');
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
$("#txtLoss_Coefficient").removeClass('input_error');
|
|
||||||
|
|
||||||
fiberCalc();
|
fiberCalc();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
$("#txtLoss_Coefficient").removeClass('input_error');
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
function fiberCalc() {
|
function fiberCalc() {
|
||||||
var span_length = $("#txtSpan_Length").val();
|
var span_length = $("#txtSpan_Length").val().trim();
|
||||||
var spanlen = parseFloat(span_length);
|
var spanlen = parseFloat(span_length);
|
||||||
var loss_coeff = $("#txtLoss_Coefficient").val();
|
var loss_coeff = $("#txtLoss_Coefficient").val().trim();
|
||||||
var lossCoeff = parseFloat(loss_coeff);
|
var lossCoeff = parseFloat(loss_coeff);
|
||||||
if (!isNaN(span_length) || spanlen >= 0 || span_length != "" || !isNaN(loss_coeff) || lossCoeff >= 0 || loss_coeff != "")
|
if (!isNaN(span_length) || spanlen >= 0 || span_length != "" || !isNaN(loss_coeff) || lossCoeff >= 0 || loss_coeff != "")
|
||||||
fiberLengthCal('txtSpan_Length', 'txtLoss_Coefficient', 'txtSpan_Loss');
|
fiberLengthCal('txtSpan_Length', 'txtLoss_Coefficient', 'txtSpan_Loss');
|
||||||
|
|||||||
Reference in New Issue
Block a user