Ejemplo n.º 1
0
        private void ListSheetPdfInfo(string[] td, string[] names, FilePath <FileNameSheetPdf> f)
        {
            int[] tabStops = new [] { 15, 25 };

            FileNameSheetPdf fo = f.FileNameObject;

            StringBuilder sb = new StringBuilder();

            sb.Append("test data| ".PadLeft(tabStops[0])).AppendLine(td[0]);

            sb.Append("sheet num| ".PadLeft(tabStops[0])).AppendLine(fo.SheetNumber);
            sb.Append("bldg| ".PadLeft(tabStops[0])).Append(fo.PhaseBldg).Append(" (").Append(td[1]).AppendLine(")");
            sb.Append("disc| ".PadLeft(tabStops[0])).Append(fo.PhaseBldgSep).Append(" (").Append(td[2]).AppendLine(")");



            for (var i = 0; i < td.Length; i++)
            {
            }
        }
Ejemplo n.º 2
0
        private void ListSheetPdfInfo(string[,] td, string[] names, FilePath <FileNameSheetPdf> f)
        {
            int[] tabStops = new [] { 20, 25, 7, 9 };

            fo = f.FileNameObject;

            StringBuilder sb = new StringBuilder();

            sb.AppendLine("");
            sb.Append("test data| ".PadLeft(tabStops[0])).AppendLine(td[0, 0]);

            sb.Append("file type| ".PadLeft(tabStops[0])).AppendLine(fo.FileType.ToString());
            sb.Append("sht num type| ".PadLeft(tabStops[0])).AppendLine(fo.ShtCompTypeName.ToString());
            sb.Append("sheet num| ".PadLeft(tabStops[0])).AppendLine(fo.SheetNumber);
            sb.Append("isPhBld| ".PadLeft(tabStops[0])).AppendLine(fo.IsPhaseBldg?.ToString() ?? "unknown");
            sb.Append("hasIdent| ".PadLeft(tabStops[0])).AppendLine(fo.HasIdentifier?.ToString() ?? "unknown");

            sb.Append("sht number| ".PadLeft(tabStops[0])).AppendLine(fo.SheetNumber);
            sb.Append("sht Title| ".PadLeft(tabStops[0])).AppendLine(fo.SheetTitle);

            sb.AppendLine();

            string test;
            string test2 = null;
            // string test3 = null;
            string compare;

            test  = fo.SheetID;
            test2 = fo.SheetId();

            sb.Append(("sht id's match" + "| ").PadLeft(tabStops[0]));

            sb.Append(test.PadRight(tabStops[2]));
            sb.Append(("(" + test2 + ")").PadRight(tabStops[3]));
            sb.Append("(match?| ").Append((test.Equals(test2)).ToString());
            sb.AppendLine(")");

            int idx = 0;

            test    = fo.SheetComponentType.ToString();
            compare = td[0, 1];

            sb.Append(("sht comp type" + "| ").PadLeft(tabStops[0]))
            .Append(test.PadRight(tabStops[2]));
            sb.Append(("(" + compare + ")").PadRight(tabStops[3]));
            sb.Append("(match?| ").Append((test.Equals(compare)).ToString());
            sb.AppendLine(")");

            if (fo.FileType == FileTypeSheetPdf.SHEET_PDF)
            {
                sb.AppendLine("Comparisons based on indexed values");

                if (fo.isPhaseBldg == true)
                {
                    sb.AppendLine("PB Info");

                    for (int i = 0; i < 2; i++)
                    {
                        idx = ShtIds.CompValueIdx2(ShtCompTypes.PHBLDG, i);

                        test = fo.SheetComps[idx] ?? "";

                        if (i % 2 == 0)
                        {
                            // idx = i / 2;
                            test2 = fo[idx];
                        }


                        compare = td[1, i];

                        if (compare.IsVoid() && test.IsVoid())
                        {
                            continue;
                        }

                        sb.Append((ShtIds.CompTitle2(ShtCompTypes.PHBLDG, i) + "| ").PadLeft(tabStops[0]))
                        .Append(test.PadRight(tabStops[2]));
                        sb.Append(("(" + compare + ")").PadRight(tabStops[3]));
                        sb.Append("(match?| ").Append((test.Equals(compare)).ToString()).Append(")");
                        sb.AppendLine();

                        if (i % 2 == 0)
                        {
                            sb.Append(("[" + idx + "] | ").PadLeft(tabStops[0]));
                            sb.Append(test2.PadRight(tabStops[2]));
                            sb.Append(("(" + compare + ")").PadRight(tabStops[3]));
                            sb.Append("(match?| ").Append((test2.Equals(compare)).ToString()).Append(")");
                            sb.AppendLine();
                        }
                    }
                }


                sb.AppendLine("TYPE Info");

                for (int i = 0; i < 9; i++)
                {
                    if (!ShtIds.CompIsUsed2(fo.shtCompType, i))
                    {
                        continue;
                    }

                    idx = ShtIds.CompValueIdx2(fo.shtCompType, i);

                    test = fo.SheetComps[idx] ?? "";

                    if (i % 2 == 0)
                    {
                        idx   = (idx) / 2;
                        test2 = fo[idx];
                    }

                    compare = td[2, i];

                    if (compare.IsVoid() && test.IsVoid())
                    {
                        continue;
                    }

                    sb.Append((ShtIds.CompTitle2(fo.shtCompType, i) + "| ").PadLeft(tabStops[0]))
                    .Append(test.PadRight(tabStops[2]));
                    sb.Append(("(" + compare + ")").PadRight(tabStops[3]));
                    sb.Append("(match?| ").Append((test.Equals(compare)).ToString()).Append(")");
                    sb.AppendLine();

                    if (i % 2 == 0)
                    {
                        sb.Append(("[" + idx + "] | ").PadLeft(tabStops[0]));
                        sb.Append(test2.PadRight(tabStops[2]));
                        sb.Append(("(" + compare + ")").PadRight(tabStops[3]));
                        sb.Append("(match?| ").Append((test2.Equals(compare)).ToString()).Append(")");
                        sb.AppendLine();
                    }
                }

                if (fo.hasIdentifier == true)
                {
                    sb.AppendLine("IDENT Info");

                    for (int i = 0; i < 5; i++)
                    {
                        idx = ShtIds.CompValueIdx2(ShtCompTypes.IDENT, i);

                        test = fo.SheetComps[idx] ?? "";

                        if (i % 2 == 1)
                        {
                            // idx = (i + 1) / 2 + 5;
                            idx   = idx / 2;
                            test2 = fo[idx];
                        }

                        compare = td[3, i];

                        if (compare.IsVoid() && test.IsVoid())
                        {
                            continue;
                        }


                        sb.Append((ShtIds.CompTitle2(ShtCompTypes.IDENT, i) + "| ").PadLeft(tabStops[0])).Append(test.PadRight(tabStops[2]));
                        sb.Append(("(" + compare + ")").PadRight(tabStops[3]));
                        sb.Append("(match?| ").Append((test.Equals(compare)).ToString()).Append(")");
                        sb.AppendLine();

                        if (i % 2 == 1)
                        {
                            sb.Append(("[" + idx + "] | ").PadLeft(tabStops[0]));
                            sb.Append(test2.PadRight(tabStops[2]));
                            sb.Append(("(" + compare + ")").PadRight(tabStops[3]));
                            sb.Append("(match?| ").Append((test2.Equals(compare)).ToString()).Append(")");
                            sb.AppendLine();
                        }
                    }
                }


                sb.AppendLine("Comparisons based on array values");

                if (!td[1, 0].IsVoid())
                {
                    sb.Append(formatValue("Ph/Bldg| ", fo.PhaseBldg, td[1, 0], tabStops));
                }
                if (!td[1, 0].IsVoid())
                {
                    sb.Append(formatValue("Ph/Bldg sep| ", fo.PhaseBldgSep, td[1, 1], tabStops));
                }
                if (!td[2, 0].IsVoid())
                {
                    sb.Append(formatValue("Discipline| ", fo.Discipline, td[2, 0], tabStops));
                }
                if (!td[2, 1].IsVoid())
                {
                    sb.Append(formatValue("sep| ", fo.Seperator0, td[2, 1], tabStops));
                }
                if (!td[2, 2].IsVoid())
                {
                    sb.Append(formatValue("Category| ", fo.Category, td[2, 2], tabStops));
                }
                if (!td[2, 3].IsVoid())
                {
                    sb.Append(formatValue("sep| ", fo.Seperator1, td[2, 3], tabStops));
                }
                if (!td[2, 4].IsVoid())
                {
                    sb.Append(formatValue("SubCategory| ", fo.Subcategory, td[2, 4], tabStops));
                }
                if (!td[2, 5].IsVoid())
                {
                    sb.Append(formatValue("sep| ", fo.Seperator2, td[2, 5], tabStops));
                }
                if (!td[2, 6].IsVoid())
                {
                    sb.Append(formatValue("Modifier| ", fo.Modifier, td[2, 6], tabStops));
                }
                if (!td[2, 7].IsVoid())
                {
                    sb.Append(formatValue("sep| ", fo.Seperator3, td[2, 7], tabStops));
                }
                if (!td[2, 8].IsVoid())
                {
                    sb.Append(formatValue("SubModifier| ", fo.Submodifier, td[2, 8], tabStops));
                }
                if (!td[3, 0].IsVoid())
                {
                    sb.Append(formatValue("sep| ", fo.Seperator4, td[3, 0], tabStops));
                }
                if (!td[3, 1].IsVoid())
                {
                    sb.Append(formatValue("Identifier| ", fo.Identifier, td[3, 1], tabStops));
                }
                if (!td[3, 2].IsVoid())
                {
                    sb.Append(formatValue("sep| ", fo.Seperator5, td[3, 2], tabStops));
                }
                if (!td[3, 3].IsVoid())
                {
                    sb.Append(formatValue("SubIdentifier| ", fo.Subidentifier, td[3, 3], tabStops));
                }
                if (!td[3, 4].IsVoid())
                {
                    sb.Append(formatValue("sep| ", fo.Seperator6, td[3, 4], tabStops));
                }
            }
            else
            {
                sb.Append("\n*** file type: ").Append(fo.FileType).AppendLine(" ***\n");
            }

            Console.WriteLine(sb.ToString());
        }