private void WritePCISample(List <SRSObjectPCI> listPCI, int m_nNextID, List <PCIDistressObject> distressRows, bool bIsMetricData) { if (listPCI.Count == 0) { return; } m_nNextID++; double dArea = listPCI[0].Area; string strMethod = listPCI[0].Method; string strType = listPCI[0].Type; StringBuilder sbDeduct = new StringBuilder(); double dPCI = 100.0; foreach (SRSObjectPCI pci in listPCI) { string strDistress = pci.Distress; string strSeverity = pci.Severity; double dAmount = pci.Amount; double dExtent = dAmount / dArea; if (strDistress != "No Distress") { double dConvertArea = dArea; if (bIsMetricData) { dConvertArea = dArea * ((distressRows.Find(delegate(PCIDistressObject distressObject) { return(distressObject.Distress == strDistress); })).MetricRatio); } double dDeduct = CalculateCurrentRowDeducts(strMethod, strDistress, strSeverity, dAmount, dConvertArea); if (sbDeduct.Length != 0) { sbDeduct.Append(","); } sbDeduct.Append(dDeduct.ToString()); string strDetail = "\t" + m_nNextPCIID.ToString() + "\t" + strDistress + "\t" + strSeverity + "\t" + dAmount.ToString() + "\t" + dExtent.ToString("f8") + "\t" + dDeduct.ToString("f8"); m_twPCIDetail.WriteLine(strDetail); } } if (sbDeduct.Length > 0) { if (listPCI[0].Facility == "TL1") { } dPCI = PciDistress.ComputePCIValue(sbDeduct.ToString(), strMethod); } string strPCI = m_nNextPCIID.ToString() + "\t\t\t\t\t" + listPCI[0].Facility + "\t" + listPCI[0].Section + "\t" + listPCI[0].Sample + "\t" + listPCI[0].Date.ToString() + "\t\t" + listPCI[0].Method + "\t" + dArea.ToString() + "\t" + dPCI.ToString("f2") + "\t\t\t\t" + listPCI[0].Type + "\t"; m_twPCI.WriteLine(strPCI); }
public double ComputePCIValue(string sDeductValues, string sMethodology) => PciDistress.ComputePCIValue(sDeductValues, sMethodology);