Skip to content

Commit

Permalink
Merge pull request #2 from sergiosuarezsky/main
Browse files Browse the repository at this point in the history
changes on the columns order
  • Loading branch information
sergiosuarezsky authored Oct 2, 2023
2 parents ac20d5c + 921cdec commit 5424a4c
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 115 deletions.
Binary file not shown.
Binary file not shown.
Binary file modified .vs/EPM_GPON_GQI_GET_ALL_ONT_DATA/v17/.suo
Binary file not shown.
Binary file not shown.
Binary file not shown.
179 changes: 64 additions & 115 deletions EPM_GPON_GQI_GET_ALL_ONT_DATA_1/EPM_GPON_GQI_GET_ALL_ONT_DATA_1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ public GQIColumn[] GetColumns()
{
new GQIStringColumn("ONT ID"),
new GQIStringColumn("ONT Serial Number"),
new GQIStringColumn("Contract ID"),
new GQIStringColumn("Main Street"),
new GQIStringColumn("Street 1"),
new GQIStringColumn("Street 2"),
new GQIStringColumn("Neighborhood"),
new GQIStringColumn("Description"),
new GQIStringColumn("Hardware Version"),
new GQIStringColumn("Manufacturer"),
Expand All @@ -148,11 +153,7 @@ public GQIColumn[] GetColumns()
new GQIIntColumn("Tx Power State"),
new GQIIntColumn("Transceiver Temperature State"),
new GQIDateTimeColumn("Last Data Update"),
new GQIStringColumn("Contract ID"),
new GQIStringColumn("Main Street"),
new GQIStringColumn("Street 1"),
new GQIStringColumn("Street 2"),
new GQIStringColumn("Neighborhood"),

};
}

Expand Down Expand Up @@ -304,7 +305,6 @@ public string GetRelatedSerialFitler(int comparisonValue, List<HelperPartialSett

if (!String.IsNullOrEmpty(ontSerial))
{
//macFilter.Append("(4002==" + ontSerial + ") OR ");
macFilter.Append(string.Format("({0}=={1}) OR ", comparisonValue, ontSerial));
}
}
Expand Down Expand Up @@ -469,11 +469,13 @@ private Dictionary<string, SubscriberOverview> ExtractSubscriberData(List<Helper

return oltRows;
}

private void AddAllOnts(Dictionary<string, OltOverview> oltRows, Dictionary<string, SubscriberOverview> OltSubscriberRows)
{
foreach (var oltRow in oltRows.Values)
{
var subscriberInformation = OltSubscriberRows.ContainsKey(oltRow.OntId) ? OltSubscriberRows[oltRow.OntId]: new SubscriberOverview();

List<GQICell> listGqiCells = new List<GQICell>
{
new GQICell
Expand All @@ -485,6 +487,26 @@ private void AddAllOnts(Dictionary<string, OltOverview> oltRows, Dictionary<stri
Value = oltRow.SerialNumber,
},
new GQICell
{
Value = subscriberInformation.ContractId,
},
new GQICell
{
Value = subscriberInformation.MainStreet,
},
new GQICell
{
Value = subscriberInformation.Street1,
},
new GQICell
{
Value = subscriberInformation.Street2,
},
new GQICell
{
Value = subscriberInformation.Neighborhood,
},
new GQICell
{
Value = ParseStringValue(oltRow.Description),
},
Expand Down Expand Up @@ -576,60 +598,6 @@ private void AddAllOnts(Dictionary<string, OltOverview> oltRows, Dictionary<stri
DisplayValue = ParseDateTimeString(oltRow.LastDataUpdate),
},
};
List<GQICell> listGqiCellsCoparision;
if (OltSubscriberRows.ContainsKey(oltRow.OntId))
{
listGqiCellsCoparision = new List<GQICell>
{
new GQICell
{
Value = ParseStringValue(OltSubscriberRows[oltRow.OntId].ContractId),
},
new GQICell
{
Value = ParseStringValue(OltSubscriberRows[oltRow.OntId].MainStreet),
},
new GQICell
{
Value = ParseStringValue(OltSubscriberRows[oltRow.OntId].Street1),
},
new GQICell
{
Value = ParseStringValue(OltSubscriberRows[oltRow.OntId].Street2),
},
new GQICell
{
Value = ParseStringValue(OltSubscriberRows[oltRow.OntId].Neighborhood),
}
};
}
else
{
listGqiCellsCoparision = new List<GQICell>
{
new GQICell
{
Value = "N/A",
},
new GQICell
{
Value = "N/A",
},
new GQICell
{
Value = "N/A",
},
new GQICell
{
Value = "N/A",
},
new GQICell
{
Value = "N/A",
}
};
}
listGqiCells = listGqiCells.Concat(listGqiCellsCoparision).ToList();
var gqiRow = new GQIRow(listGqiCells.ToArray());

listGqiRows.Add(gqiRow);
Expand All @@ -644,6 +612,8 @@ private void AddOnlyOssOnt(Dictionary<string, OltOverview> oltRows, Dictionary<s
{
if (oltRow.BiasCurrentState == (int)OltState.Oos || oltRow.SupplyVoltageState == (int)OltState.Oos || oltRow.RxPowerState == (int)OltState.Oos || oltRow.TxPowerState == (int)OltState.Oos || oltRow.TransceiverTemperatureState == (int)OltState.Oos)
{
var subscriberInformation = OltSubscriberRows.ContainsKey(oltRow.OntId) ? OltSubscriberRows[oltRow.OntId] : new SubscriberOverview();

List<GQICell> listGqiCells = new List<GQICell>
{
new GQICell
Expand All @@ -655,6 +625,26 @@ private void AddOnlyOssOnt(Dictionary<string, OltOverview> oltRows, Dictionary<s
Value = oltRow.SerialNumber,
},
new GQICell
{
Value = subscriberInformation.ContractId,
},
new GQICell
{
Value = subscriberInformation.MainStreet,
},
new GQICell
{
Value = subscriberInformation.Street1,
},
new GQICell
{
Value = subscriberInformation.Street2,
},
new GQICell
{
Value = subscriberInformation.Neighborhood,
},
new GQICell
{
Value = ParseStringValue(oltRow.Description),
},
Expand Down Expand Up @@ -747,60 +737,7 @@ private void AddOnlyOssOnt(Dictionary<string, OltOverview> oltRows, Dictionary<s
},

};
List<GQICell> listGqiCellsCoparision;
if (OltSubscriberRows.ContainsKey(oltRow.OntId))
{
listGqiCellsCoparision = new List<GQICell>
{
new GQICell
{
Value = ParseStringValue(OltSubscriberRows[oltRow.OntId].ContractId),
},
new GQICell
{
Value = ParseStringValue(OltSubscriberRows[oltRow.OntId].MainStreet),
},
new GQICell
{
Value = ParseStringValue(OltSubscriberRows[oltRow.OntId].Street1),
},
new GQICell
{
Value = ParseStringValue(OltSubscriberRows[oltRow.OntId].Street2),
},
new GQICell
{
Value = ParseStringValue(OltSubscriberRows[oltRow.OntId].Neighborhood),
}
};
}
else
{
listGqiCellsCoparision = new List<GQICell>
{
new GQICell
{
Value = "N/A",
},
new GQICell
{
Value = "N/A",
},
new GQICell
{
Value = "N/A",
},
new GQICell
{
Value = "N/A",
},
new GQICell
{
Value = "N/A",
}
};
}
listGqiCells = listGqiCells.Concat(listGqiCellsCoparision).ToList();

var gqiRow = new GQIRow(listGqiCells.ToArray());

listGqiRows.Add(gqiRow);
Expand Down Expand Up @@ -892,4 +829,16 @@ public class SubscriberOverview
public string Street2 { get; set; }

public string Neighborhood { get; set; }


public SubscriberOverview()
{
OntId = "N/A";
SerialNumber = "N/A";
ContractId = "N/A";
MainStreet = "N/A";
Street1 = "N/A";
Street2 = "N/A";
Neighborhood = "N/A";
}
}

0 comments on commit 5424a4c

Please sign in to comment.