Exemple #1
0
        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);
        }
Exemple #2
0
        private double CalculateCurrentRowDeducts(string strMethod, string strDistress, string strSeverity, double dAmount, double dArea)
        {
            PCIMethodObject method = Validation.PCIMethods.Find(delegate(PCIMethodObject pciMethod){ return(pciMethod.Method == strMethod); });

            if (method == null)
            {
                return(0.0);
            }

            double dPCIDeduct = 0.0;

            if (PciDistress.IsWASHCLKMethod(method.Method))
            {
                double dExtent   = dAmount / dArea;
                string extent    = string.Format("{0:F2}", dExtent);
                int    nDistress = method.GetDistress(strDistress);
                dPCIDeduct = PciDistress.pvt_ComputeNonPCIDeduct(method.Method, nDistress, strSeverity, dExtent);
            }
            else
            {
                dPCIDeduct = PciDistress.pvt_ComputePCIDeduct(method.GetDistress(strDistress), strSeverity, dAmount, dArea);
            }
            return(dPCIDeduct);
        }
Exemple #3
0
 public double pvt_ComputePCIDeduct(int nDistress, string sSeverity, double dAmount, double dSamsiz) => PciDistress.pvt_ComputePCIDeduct(nDistress, sSeverity, dAmount, dSamsiz);
Exemple #4
0
 public bool IsWASHCLKMethod(string s) => PciDistress.IsWASHCLKMethod(s);
Exemple #5
0
 public double ComputePCIValue(string sDeductValues, string sMethodology) => PciDistress.ComputePCIValue(sDeductValues, sMethodology);