Пример #1
0
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // m e t r i c s S a v e F i l e R p t                                //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Store current target report file metrics data.                     //
        //                                                                    //
        //--------------------------------------------------------------------//

        public static void metricsSaveFileRpt(
            ToolCommonData.eToolIds crntToolId,
            ReportCore.eRptFileFmt rptFileFmt,
            ReportCore.eRptChkMarks rptChkMarks,
            Boolean flagOptRptWrap)
        {
            Int32 tmpFmt      = (Int32)rptFileFmt;
            Int32 tmpChkMarks = (Int32)rptChkMarks;

            if (crntToolId == ToolCommonData.eToolIds.MakeOverlay)
            {
                ToolMakeOverlayPersist.saveDataRpt(tmpFmt);
            }
            else if (crntToolId == ToolCommonData.eToolIds.PrintLang)
            {
                ToolPrintLangPersist.saveDataRpt(tmpFmt, tmpChkMarks,
                                                 flagOptRptWrap);
            }
            else if (crntToolId == ToolCommonData.eToolIds.PrnAnalyse)
            {
                ToolPrnAnalysePersist.saveDataRpt(tmpFmt);
            }
            else if (crntToolId == ToolCommonData.eToolIds.SoftFontGenerate)
            {
                ToolSoftFontGenPersist.saveDataRpt(tmpFmt, tmpChkMarks);
            }
            else if (crntToolId == ToolCommonData.eToolIds.StatusReadback)
            {
                ToolStatusReadbackPersist.saveDataRpt(tmpFmt);
            }
            else if (crntToolId == ToolCommonData.eToolIds.SymbolSetGenerate)
            {
                ToolSymbolSetGenPersist.saveDataRpt(tmpFmt);
            }
        }
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // r e p o r t B o d y                                                //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Write details of response to report file.                          //
        //                                                                    //
        //--------------------------------------------------------------------//

        private static void reportBody(
            ReportCore.eRptFileFmt rptFileFmt,
            Object writer,
            TextBox txtReply)
        {
            const Int32 maxLineLen = 127;

            Int32 ct;

            ReportCore.lineBlockOpen(writer, rptFileFmt);

            ct = txtReply.LineCount;

            for (Int32 i = 0; i < ct; i++)
            {
                String line = txtReply.GetLineText(i);

                String removedCC = line.Replace("\r\n", "")     // not "<CR><LF>")
                                   .Replace("\n", "")           // not "<LF>")
                                   .Replace("\r", "")           // not "<CR>")
                                   .Replace("\f", "<FF>")
                                   .Replace("\x1b", "<Esc>");

                ReportCore.lineItem(writer, rptFileFmt, removedCC, maxLineLen,
                                    false);
            }

            ReportCore.lineBlockClose(writer, rptFileFmt);
        }
Пример #3
0
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // r e p o r t H e a d e r                                            //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Write report header.                                               //
        //                                                                    //
        //--------------------------------------------------------------------//

        private static void reportHeader(
            ReportCore.eRptFileFmt rptFileFmt,
            Object writer,
            String prnFilename,
            String ovlFilename)
        {
            Int32 maxLineLen = 0;

            String title = "";

            title = "*** Make Overlay report ***:";

            maxLineLen = PrnParseConstants.cRptA_colMax_Action +
                         PrnParseConstants.cRptA_colMax_Offset +
                         PrnParseConstants.cRptA_colMax_Type +
                         PrnParseConstants.cRptA_colMax_Seq +
                         PrnParseConstants.cRptA_colMax_Desc +
                         (PrnParseConstants.cColSeparatorLen * 4) - 15;

            //----------------------------------------------------------------//
            //                                                                //
            // Write out the title.                                           //
            //                                                                //
            //----------------------------------------------------------------//

            ReportCore.hddrTitle(writer, rptFileFmt, false, title);

            //----------------------------------------------------------------//
            //                                                                //
            // Write out the date, time, input file identity, and             //
            // count of report rows.                                          //
            //                                                                //
            //----------------------------------------------------------------//

            ReportCore.tableHddrPair(writer, rptFileFmt);

            ReportCore.tableRowPair(writer, rptFileFmt,
                                    "Date_time", DateTime.Now.ToString(),
                                    _colSpanNone, _colSpanNone,
                                    _maxSizeNameTag, maxLineLen,
                                    _flagNone, _flagNone, _flagNone);

            ReportCore.tableRowPair(writer, rptFileFmt,
                                    "Print_file", prnFilename,
                                    _colSpanNone, _colSpanNone,
                                    _maxSizeNameTag, maxLineLen,
                                    _flagNone, _flagNone, _flagNone);

            ReportCore.tableRowPair(writer, rptFileFmt,
                                    "Overlay_file", ovlFilename,
                                    _colSpanNone, _colSpanNone,
                                    _maxSizeNameTag, maxLineLen,
                                    _flagNone, _flagNone, _flagNone);

            ReportCore.tableClose(writer, rptFileFmt);
        }
Пример #4
0
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // b t n S a v e R e p o r t _ C l i c k                              //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Called when the 'Save Report' button is clicked.                   //
        //                                                                    //
        //--------------------------------------------------------------------//

        private void btnSaveReport_Click(object sender, RoutedEventArgs e)
        {
            Boolean flagOffsetHex,
                    flagOptRptWrap = false;

            ReportCore.eRptFileFmt  rptFileFmt  = ReportCore.eRptFileFmt.NA;
            ReportCore.eRptChkMarks rptChkMarks = ReportCore.eRptChkMarks.NA;

            if (_options.IndxGenOffsetFormat ==
                PrnParseConstants.eOptOffsetFormats.Decimal)
            {
                flagOffsetHex = false;
            }
            else
            {
                flagOffsetHex = true;
            }

            TargetCore.metricsReturnFileRpt(ToolCommonData.eToolIds.PrnAnalyse,
                                            ref rptFileFmt,
                                            ref rptChkMarks,
                                            ref flagOptRptWrap);

            if (tabCtrl.SelectedItem == tabStatistics)
            {
                ToolPrnAnalyseReport.generate(eInfoType.Statistics,
                                              rptFileFmt,
                                              _tableStatistics,
                                              _prnFilename,
                                              _fileSize,
                                              flagOffsetHex,
                                              _options);
            }
            else if (tabCtrl.SelectedItem == tabContent)
            {
                ToolPrnAnalyseReport.generate(eInfoType.Content,
                                              rptFileFmt,
                                              _tableContent,
                                              _prnFilename,
                                              _fileSize,
                                              flagOffsetHex,
                                              _options);
            }
            else
            {
                ToolPrnAnalyseReport.generate(eInfoType.Analysis,
                                              rptFileFmt,
                                              _tableAnalysis,
                                              _prnFilename,
                                              _fileSize,
                                              flagOffsetHex,
                                              _options);
            }
        }
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // r e p o r t H d d r                                                //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Write main report header.                                          //
        //                                                                    //
        //--------------------------------------------------------------------//

        private static void reportHddr(ReportCore.eRptFileFmt rptFileFmt,
                                       Object writer,
                                       String fontNameTTF,
                                       String fontFilenameTTF,
                                       String fontFilenamePCL)
        {
            Int32 maxLineLen = 80;

            String title = "*** Soft Font Generator ***";

            //----------------------------------------------------------------//
            //                                                                //
            // Write out the title.                                           //
            //                                                                //
            //----------------------------------------------------------------//

            ReportCore.hddrTitle(writer, rptFileFmt, false, title);

            //----------------------------------------------------------------//
            //                                                                //
            // Write out the date, time, input file identity and size, and    //
            // count of report rows.                                          //
            //                                                                //
            //----------------------------------------------------------------//

            ReportCore.tableHddrPair(writer, rptFileFmt);

            ReportCore.tableRowPair(writer, rptFileFmt,
                                    "Date_time", DateTime.Now.ToString(),
                                    _colSpanNone, _colSpanNone,
                                    _maxSizeNameTag, maxLineLen,
                                    _flagNone, _flagNone, _flagNone);

            ReportCore.tableRowPair(writer, rptFileFmt,
                                    "Target_PCL_font_file", fontFilenamePCL,
                                    _colSpanNone, _colSpanNone,
                                    _maxSizeNameTag, maxLineLen,
                                    _flagNone, _flagNone, _flagNone);

            ReportCore.tableRowPair(writer, rptFileFmt,
                                    "Donor_TTF_name", fontNameTTF,
                                    _colSpanNone, _colSpanNone,
                                    _maxSizeNameTag, maxLineLen,
                                    _flagNone, _flagNone, _flagNone);

            ReportCore.tableRowPair(writer, rptFileFmt,
                                    "Donor_TTF_file", fontFilenameTTF,
                                    _colSpanNone, _colSpanNone,
                                    _maxSizeNameTag, maxLineLen,
                                    _flagNone, _flagNone, _flagNone);

            ReportCore.tableClose(writer, rptFileFmt);
        }
Пример #6
0
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // m e t r i c s R e t u r n F i l e R p t                            //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Load and return current report file metrics data.                  //
        //                                                                    //
        //--------------------------------------------------------------------//

        public static void metricsReturnFileRpt(
            ToolCommonData.eToolIds crntToolId,
            ref ReportCore.eRptFileFmt rptFileFmt,
            ref ReportCore.eRptChkMarks rptChkMarks,
            ref Boolean flagOptWrap)
        {
            metricsLoadFileRpt(crntToolId);

            rptFileFmt  = _rptFileFmt;
            rptChkMarks = _rptChkMarks;
            flagOptWrap = _flagOptRptWrap;
        }
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // r e p o r t H d d r S u b                                          //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Write sub report header.                                           //
        //                                                                    //
        //--------------------------------------------------------------------//

        private static void reportHddrSub(ReportCore.eRptFileFmt rptFileFmt,
                                          Object writer,
                                          String subHead)
        {
            //----------------------------------------------------------------//
            //                                                                //
            // Write out the sub-header.                                      //
            //                                                                //
            //----------------------------------------------------------------//

            ReportCore.hddrTitle(writer, rptFileFmt, true, subHead);
        }
        //--------------------------------------------------------------------//
        //                                                        F i e l d s //
        // Class variables.                                                   //
        //                                                                    //
        //--------------------------------------------------------------------//

        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // g e n e r a t e                                                    //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Generate the PDL Data report.                                      //
        //                                                                    //
        //--------------------------------------------------------------------//

        public static void generate(ReportCore.eRptFileFmt rptFileFmt,
                                    TextBox txtReply,
                                    ref String saveFilename)
        {
            Object stream = null;
            Object writer = null;

            Boolean OK = false;

            String saveFolder = null,
                   fileExt;

            ToolCommonFunctions.getFolderName(saveFilename,
                                              ref saveFolder);

            if (rptFileFmt == ReportCore.eRptFileFmt.html)
            {
                fileExt = "html";
            }
            else if (rptFileFmt == ReportCore.eRptFileFmt.xml)
            {
                fileExt = "xml";
            }
            else
            {
                fileExt = "txt";
            }

            saveFilename = saveFolder + "\\SR_Resp." + fileExt;

            OK = ReportCore.docOpen(rptFileFmt,
                                    ref saveFilename,
                                    ref stream,
                                    ref writer);
            if (OK)
            {
                ReportCore.docInitialise(rptFileFmt, writer, false, true,
                                         0, null,
                                         null, null);

                ReportCore.hddrTitle(writer, rptFileFmt, false,
                                     "*** Status Readback response data ***");

                reportBody(rptFileFmt, writer, txtReply);

                ReportCore.docFinalise(rptFileFmt, writer);

                ReportCore.docClose(rptFileFmt, stream, writer);
            }
        }
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // b t n S a v e R e p o r t _ C l i c k                              //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Called when the 'Save report' button is clicked.                   //
        //                                                                    //
        //--------------------------------------------------------------------//

        private void btnSaveReport_Click(object sender, RoutedEventArgs e)
        {
            Boolean flagOffsetHex,
                    flagOptRptWrap = false;

            ReportCore.eRptFileFmt  rptFileFmt  = ReportCore.eRptFileFmt.NA;
            ReportCore.eRptChkMarks rptChkMarks = ReportCore.eRptChkMarks.NA;

            if (_options.IndxGenOffsetFormat ==
                PrnParseConstants.eOptOffsetFormats.Decimal)
            {
                flagOffsetHex = false;
            }
            else
            {
                flagOffsetHex = true;
            }

            TargetCore.metricsReturnFileRpt(ToolCommonData.eToolIds.MakeOverlay,
                                            ref rptFileFmt,
                                            ref rptChkMarks,
                                            ref flagOptRptWrap);

            if (_crntPDL == ToolCommonData.ePrintLang.PCL)
            {
                ToolMakeOverlayReport.generate(rptFileFmt,
                                               _tableProgress,
                                               _prnFilename,
                                               _ovlFilenamePCL,
                                               flagOffsetHex,
                                               _options);
            }
            else
            {
                ToolMakeOverlayReport.generate(rptFileFmt,
                                               _tableProgress,
                                               _prnFilename,
                                               _ovlFilenamePCLXL,
                                               flagOffsetHex,
                                               _options);
            }

            btnSaveReport.Visibility = Visibility.Visible;
        }
Пример #10
0
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // r e p o r t H d d r                                                //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Write main report header.                                          //
        //                                                                    //
        //--------------------------------------------------------------------//

        private static void reportHddr(ReportCore.eRptFileFmt rptFileFmt,
                                       Object writer,
                                       String symSetFilename)
        {
            Int32 maxLineLen = 80;

            String title = "*** Symbol Set Generator ***";

            //----------------------------------------------------------------//
            //                                                                //
            // Write out the title.                                           //
            //                                                                //
            //----------------------------------------------------------------//

            ReportCore.hddrTitle(writer, rptFileFmt, false, title);

            //----------------------------------------------------------------//
            //                                                                //
            // Open the table and Write Write out the date, time and input    //
            // file identity.                                                 //
            //                                                                //
            //----------------------------------------------------------------//

            ReportCore.tableHddrPair(writer, rptFileFmt);

            ReportCore.tableRowPair(writer, rptFileFmt,
                                    "Date_time", DateTime.Now.ToString(),
                                    _colSpanNone, _colSpanNone,
                                    _maxSizeNameTag, maxLineLen,
                                    _flagNone, _flagNone, _flagNone);

            ReportCore.tableRowPair(writer, rptFileFmt,
                                    "Symbol set file", symSetFilename,
                                    _colSpanNone, _colSpanNone,
                                    _maxSizeNameTag, maxLineLen,
                                    _flagNone, _flagNone, _flagNone);

            ReportCore.tableClose(writer, rptFileFmt);
        }
Пример #11
0
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // r b R p t F m t X m l _ C l i c k                                  //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Called when the report format 'xml' radio button is selected.      //
        //                                                                    //
        //--------------------------------------------------------------------//

        private void rbRptFmtXml_Click(object sender,
                                       RoutedEventArgs e)
        {
            _rptFileFmt = ReportCore.eRptFileFmt.xml;
        }
Пример #12
0
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // r b R p t F m t T e x t _ C l i c k                                //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Called when the report format 'text' radio button is selected.     //
        //                                                                    //
        //--------------------------------------------------------------------//

        private void rbRptFmtText_Click(object sender,
                                        RoutedEventArgs e)
        {
            _rptFileFmt = ReportCore.eRptFileFmt.text;
        }
Пример #13
0
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // r e p o r t B o d y S t a t i s t i c s                            //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Write details of Statistics to report file.                        //
        //                                                                    //
        //--------------------------------------------------------------------//

        private static void reportBodyStatistics(
            ReportCore.eRptFileFmt rptFileFmt,
            Object writer,
            DataTable table)
        {
            const Int32 colCt = 5;

            const String c0Name = PrnParseConstants.cRptS_colName_Seq;
            const String c1Name = PrnParseConstants.cRptS_colName_Desc;
            const String c2Name = PrnParseConstants.cRptS_colName_CtP;
            const String c3Name = PrnParseConstants.cRptS_colName_CtE;
            const String c4Name = PrnParseConstants.cRptS_colName_CtT;

            const Int32 lc0 = PrnParseConstants.cRptS_colMax_Seq;
            const Int32 lc1 = PrnParseConstants.cRptS_colMax_Desc;
            const Int32 lc2 = PrnParseConstants.cRptS_colMax_CtP;
            const Int32 lc3 = PrnParseConstants.cRptS_colMax_CtE;
            const Int32 lc4 = PrnParseConstants.cRptS_colMax_CtT;

            String[] colNames;
            Int32[]  colSizes;

            Int32 ctItems;

            ctItems = table.Rows.Count;

            colNames = new String[colCt] {
                c0Name, c1Name, c2Name, c3Name, c4Name
            };
            colSizes = new Int32[colCt] {
                lc0, lc1, lc2, lc3, lc4
            };

            //----------------------------------------------------------------//
            //                                                                //
            // Open the table and Write the column header text.               //
            //                                                                //
            //----------------------------------------------------------------//

            ReportCore.tableHddrData(writer, rptFileFmt, false,
                                     colCt, colNames, colSizes);

            //----------------------------------------------------------------//
            //                                                                //
            // Write the data rows.                                           //
            //                                                                //
            //----------------------------------------------------------------//

            for (Int32 i = 0; i < ctItems; i++)
            {
                DataRow row = table.Rows[i];

                ReportCore.tableRowData(
                    writer, rptFileFmt,
                    ReportCore.eRptChkMarks.text,   // not used by this tool //
                    colCt, null,
                    row, colNames, colSizes);
            }

            //----------------------------------------------------------------//
            //                                                                //
            // Write any required end tags.                                   //
            //                                                                //
            //----------------------------------------------------------------//

            ReportCore.tableClose(writer, rptFileFmt);
        }
Пример #14
0
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // r e p o r t H e a d e r                                            //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Write report header.                                               //
        //                                                                    //
        //--------------------------------------------------------------------//

        private static void reportHeader(
            ToolPrnAnalyse.eInfoType indxInfoType,
            ReportCore.eRptFileFmt rptFileFmt,
            Object writer,
            String prnFilename,
            Int64 fileSize,
            Int32 reportSize)
        {
            Int32 maxLineLen = 0;

            String title = "";

            if (indxInfoType == ToolPrnAnalyse.eInfoType.Analysis)
            {
                title = "*** Prn Analysis ***";

                maxLineLen = PrnParseConstants.cRptA_colMax_Offset +
                             PrnParseConstants.cRptA_colMax_Type +
                             PrnParseConstants.cRptA_colMax_Seq +
                             PrnParseConstants.cRptA_colMax_Desc +
                             (PrnParseConstants.cColSeparatorLen * 3) - 12;
            }
            else if (indxInfoType == ToolPrnAnalyse.eInfoType.Content)
            {
                title = "*** Prn Content ***";

                maxLineLen = PrnParseConstants.cRptC_colMax_Offset +
                             PrnParseConstants.cRptC_colMax_Hex +
                             PrnParseConstants.cRptC_colMax_Text +
                             (PrnParseConstants.cColSeparatorLen * 2) - 12;
            }
            else if (indxInfoType == ToolPrnAnalyse.eInfoType.Statistics)
            {
                title = "*** Prn Analysis Statistics ***";

                maxLineLen = PrnParseConstants.cRptS_colMax_Seq +
                             PrnParseConstants.cRptS_colMax_Desc +
                             PrnParseConstants.cRptS_colMax_CtP +
                             PrnParseConstants.cRptS_colMax_CtE +
                             PrnParseConstants.cRptS_colMax_CtT +
                             (PrnParseConstants.cColSeparatorLen * 4) - 12;
            }

            //----------------------------------------------------------------//
            //                                                                //
            // Write out the title.                                           //
            //                                                                //
            //----------------------------------------------------------------//

            ReportCore.hddrTitle(writer, rptFileFmt, false, title);

            //----------------------------------------------------------------//
            //                                                                //
            // Open the table and Write Write out the date, time, input file  //
            // identity and size, and count of report rows.                   //
            //                                                                //
            //----------------------------------------------------------------//

            ReportCore.tableHddrPair(writer, rptFileFmt);

            ReportCore.tableRowPair(writer, rptFileFmt,
                                    "Date_time", DateTime.Now.ToString(),
                                    _colSpanNone, _colSpanNone,
                                    _maxSizeNameTag, maxLineLen,
                                    _flagNone, _flagNone, _flagNone);

            ReportCore.tableRowPair(writer, rptFileFmt,
                                    "Filename", prnFilename,
                                    _colSpanNone, _colSpanNone,
                                    _maxSizeNameTag, maxLineLen,
                                    _flagNone, _flagNone, _flagNone);

            ReportCore.tableRowPair(writer, rptFileFmt,
                                    "Filesize", fileSize.ToString() + " bytes",
                                    _colSpanNone, _colSpanNone,
                                    _maxSizeNameTag, maxLineLen,
                                    _flagNone, _flagNone, _flagNone);

            ReportCore.tableRowPair(writer, rptFileFmt,
                                    "Report_size", reportSize +
                                    " rows (excluding header and trailer lines)",
                                    _colSpanNone, _colSpanNone,
                                    _maxSizeNameTag, maxLineLen,
                                    _flagNone, _flagNone, _flagNone);

            ReportCore.tableClose(writer, rptFileFmt);
        }
Пример #15
0
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // r e p o r t B o d y C o n t e n t                                  //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Write details of Content to report file.                           //
        //                                                                    //
        //--------------------------------------------------------------------//

        private static void reportBodyContent(
            ReportCore.eRptFileFmt rptFileFmt,
            Object writer,
            DataTable table,
            Boolean flagOffsetHex)
        {
            const Int32 colCt = 3;

            const String c0Name = PrnParseConstants.cRptC_colName_Offset;
            const String c1Name = PrnParseConstants.cRptC_colName_Hex;
            const String c2Name = PrnParseConstants.cRptC_colName_Text;

            const Int32 lc0 = PrnParseConstants.cRptC_colMax_Offset;
            const Int32 lc1 = PrnParseConstants.cRptC_colMax_Hex;
            const Int32 lc2 = PrnParseConstants.cRptC_colMax_Text;

            String c0Hddr;

            String[] colHddrs;
            String[] colNames;
            Int32[]  colSizes;

            Int32 ctItems;

            ctItems = table.Rows.Count;

            if (flagOffsetHex)
            {
                c0Hddr = c0Name + ": hex";
            }
            else
            {
                c0Hddr = c0Name + ": dec";
            }

            colHddrs = new String[colCt] {
                c0Hddr, c1Name, c2Name
            };
            colNames = new String[colCt] {
                c0Name, c1Name, c2Name
            };
            colSizes = new Int32[colCt] {
                lc0, lc1, lc2
            };

            ctItems = table.Rows.Count;

            if (flagOffsetHex)
            {
                c0Hddr = c0Name + ": hex";
            }
            else
            {
                c0Hddr = c0Name + ": dec";
            }

            //----------------------------------------------------------------//
            //                                                                //
            // Open the table and Write the column header text.               //
            //                                                                //
            //----------------------------------------------------------------//

            ReportCore.tableHddrData(writer, rptFileFmt, false,
                                     colCt, colHddrs, colSizes);

            //----------------------------------------------------------------//
            //                                                                //
            // Write the data rows.                                           //
            //                                                                //
            //----------------------------------------------------------------//

            for (Int32 i = 0; i < ctItems; i++)
            {
                DataRow row = table.Rows[i];

                ReportCore.tableRowData(
                    writer, rptFileFmt,
                    ReportCore.eRptChkMarks.text,   // not used by this tool //
                    colCt, null,
                    row, colNames, colSizes);
            }

            //----------------------------------------------------------------//
            //                                                                //
            // Write any required end tags.                                   //
            //                                                                //
            //----------------------------------------------------------------//

            ReportCore.tableClose(writer, rptFileFmt);
        }
Пример #16
0
        //--------------------------------------------------------------------//
        //                                                        F i e l d s //
        // Class variables.                                                   //
        //                                                                    //
        //--------------------------------------------------------------------//

        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // g e n e r a t e                                                    //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Generate the report.                                               //
        //                                                                    //
        //--------------------------------------------------------------------//

        public static void generate(
            ToolPrnAnalyse.eInfoType indxInfoType,
            ReportCore.eRptFileFmt rptFileFmt,
            DataTable table,
            String prnFilename,
            Int64 fileSize,
            Boolean flagOffsetHex,
            PrnParseOptions options)
        {
            Object stream = null;
            Object writer = null;

            Boolean OK = false;

            Int32 reportSize;

            String fileExt;
            String saveFilename = null;

            if (rptFileFmt == ReportCore.eRptFileFmt.html)
            {
                fileExt = "html";
            }
            else if (rptFileFmt == ReportCore.eRptFileFmt.xml)
            {
                fileExt = "xml";
            }
            else
            {
                fileExt = "txt";
            }

            if (indxInfoType == ToolPrnAnalyse.eInfoType.Analysis)
            {
                saveFilename = prnFilename + "_analysis." + fileExt;

                OK = ReportCore.docOpen(rptFileFmt,
                                        ref saveFilename,
                                        ref stream,
                                        ref writer);

                if (OK)
                {
                    Int32 ctClrMapRowTypes = PrnParseRowTypes.getCount();

                    Boolean useClr = options.FlagClrMapUseClr;

                    reportSize = table.Rows.Count;

                    if (useClr)
                    {
                        String[] rowClasses = new String[ctClrMapRowTypes];
                        String[] rowClrBack = new String[ctClrMapRowTypes];
                        String[] rowClrFore = new String[ctClrMapRowTypes];

                        getRowColourStyleData(options,
                                              ref rowClasses,
                                              ref rowClrBack,
                                              ref rowClrFore);

                        ReportCore.docInitialise(rptFileFmt, writer, true, false,
                                                 ctClrMapRowTypes, rowClasses,
                                                 rowClrBack, rowClrFore);
                    }
                    else
                    {
                        ReportCore.docInitialise(rptFileFmt, writer, true, false,
                                                 0, null,
                                                 null, null);
                    }

                    reportHeader(indxInfoType, rptFileFmt, writer,
                                 prnFilename, fileSize, reportSize);

                    reportBodyAnalysis(rptFileFmt, writer,
                                       table, flagOffsetHex);

                    ReportCore.docFinalise(rptFileFmt, writer);

                    ReportCore.docClose(rptFileFmt, stream, writer);
                }
            }
            else if (indxInfoType == ToolPrnAnalyse.eInfoType.Content)
            {
                saveFilename = prnFilename + "_content." + fileExt;

                OK = ReportCore.docOpen(rptFileFmt,
                                        ref saveFilename,
                                        ref stream,
                                        ref writer);
                if (OK)
                {
                    reportSize = table.Rows.Count;

                    ReportCore.docInitialise(rptFileFmt, writer, true, false,
                                             0, null,
                                             null, null);

                    reportHeader(indxInfoType, rptFileFmt, writer,
                                 prnFilename, fileSize, reportSize);

                    reportBodyContent(rptFileFmt, writer,
                                      table, flagOffsetHex);

                    ReportCore.docFinalise(rptFileFmt, writer);

                    ReportCore.docClose(rptFileFmt, stream, writer);
                }
            }
            else if (indxInfoType == ToolPrnAnalyse.eInfoType.Statistics)
            {
                saveFilename = prnFilename + "_statistics." + fileExt;

                OK = ReportCore.docOpen(rptFileFmt,
                                        ref saveFilename,
                                        ref stream,
                                        ref writer);
                if (OK)
                {
                    reportSize = table.Rows.Count;

                    ReportCore.docInitialise(rptFileFmt, writer, true, false,
                                             0, null,
                                             null, null);

                    reportHeader(indxInfoType, rptFileFmt, writer,
                                 prnFilename, fileSize, reportSize);

                    reportBodyStatistics(rptFileFmt, writer,
                                         table);

                    ReportCore.docFinalise(rptFileFmt, writer);

                    ReportCore.docClose(rptFileFmt, stream, writer);
                }
            }
        }
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // r e p o r t B o d y C h a r s                                      //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Write details of generated characters to report file.              //
        //                                                                    //
        //--------------------------------------------------------------------//

        private static void reportBodyChars(
            ReportCore.eRptFileFmt rptFileFmt,
            ReportCore.eRptChkMarks rptChkMarks,
            Object writer,
            DataTable table)
        {
            const Int32 colCt = 13;

            const String c0Name  = "DecCode";
            const String c1Name  = "HexCode";
            const String c2Name  = "Unicode";
            const String c3Name  = "Glyph";
            const String c4Name  = "Abs";
            const String c5Name  = "Prev";
            const String c6Name  = "Comp";
            const String c7Name  = "Depth";
            const String c8Name  = "Width";
            const String c9Name  = "LSB";
            const String c10Name = "Height";
            const String c11Name = "TSB";
            const String c12Name = "Length";

            const String c0Hddr  = "DecCode";
            const String c1Hddr  = "HexCode";
            const String c2Hddr  = "Unicode";
            const String c3Hddr  = "Glyph";
            const String c4Hddr  = "Abs?";
            const String c5Hddr  = "Prev?";
            const String c6Hddr  = "Comp?";
            const String c7Hddr  = "Depth";
            const String c8Hddr  = "Width";
            const String c9Hddr  = "LSB";
            const String c10Hddr = "Height";
            const String c11Hddr = "TSB";
            const String c12Hddr = "Length";

            const Int32 lc0  = 7;
            const Int32 lc1  = 7;
            const Int32 lc2  = 7;
            const Int32 lc3  = 5;
            const Int32 lc4  = 5;
            const Int32 lc5  = 5;
            const Int32 lc6  = 5;
            const Int32 lc7  = 5;
            const Int32 lc8  = 5;
            const Int32 lc9  = 6;
            const Int32 lc10 = 6;
            const Int32 lc11 = 6;
            const Int32 lc12 = 6;

            String[] colHddrs;
            String[] colNames;
            Int32[]  colSizes;

            Int32 ctItems;

            ctItems = table.Rows.Count;

            colHddrs = new String[colCt] {
                c0Hddr, c1Hddr, c2Hddr, c3Hddr,
                c4Hddr, c5Hddr, c6Hddr, c7Hddr,
                c8Hddr, c9Hddr, c10Hddr, c11Hddr,
                c12Hddr
            };
            colNames = new String[colCt] {
                c0Name, c1Name, c2Name, c3Name,
                c4Name, c5Name, c6Name, c7Name,
                c8Name, c9Name, c10Name, c11Name,
                c12Name
            };
            colSizes = new Int32[colCt] {
                lc0, lc1, lc2, lc3,
                lc4, lc5, lc6, lc7,
                lc8, lc9, lc10, lc11,
                lc12
            };

            //----------------------------------------------------------------//
            //                                                                //
            // Open the table and Write the column header text.               //
            //                                                                //
            //----------------------------------------------------------------//

            ReportCore.tableHddrData(writer, rptFileFmt, false,
                                     colCt, colHddrs, colSizes);

            //----------------------------------------------------------------//
            //                                                                //
            // Write the data rows.                                           //
            //                                                                //
            //----------------------------------------------------------------//

            for (Int32 i = 0; i < ctItems; i++)
            {
                DataRow row = table.Rows[i];

                ReportCore.tableRowData(writer, rptFileFmt, rptChkMarks,
                                        colCt, null,
                                        row, colNames, colSizes);
            }

            //----------------------------------------------------------------//
            //                                                                //
            // Write any required end tags.                                   //
            //                                                                //
            //----------------------------------------------------------------//

            ReportCore.tableClose(writer, rptFileFmt);
        }
Пример #18
0
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // r e p o r t B o d y A n a l y s i s                                //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Write details of Analysis to report file.                          //
        //                                                                    //
        //--------------------------------------------------------------------//

        private static void reportBodyAnalysis(
            ReportCore.eRptFileFmt rptFileFmt,
            Object writer,
            DataTable table,
            Boolean flagOffsetHex)
        {
            const Int32 colCt = 4;

            const String c0Name = PrnParseConstants.cRptA_colName_Offset;
            const String c1Name = PrnParseConstants.cRptA_colName_Type;
            const String c2Name = PrnParseConstants.cRptA_colName_Seq;
            const String c3Name = PrnParseConstants.cRptA_colName_Desc;

            const Int32 lc0 = PrnParseConstants.cRptA_colMax_Offset;
            const Int32 lc1 = PrnParseConstants.cRptA_colMax_Type;
            const Int32 lc2 = PrnParseConstants.cRptA_colMax_Seq;
            const Int32 lc3 = PrnParseConstants.cRptA_colMax_Desc;

            const String rtName = PrnParseConstants.cRptA_colName_RowType;

            String c0Hddr;

            String[] colHddrs;
            String[] colNames;
            Int32[]  colSizes;

            Int32 ctItems;

            ctItems = table.Rows.Count;

            if (flagOffsetHex)
            {
                c0Hddr = c0Name + ": hex";
            }
            else
            {
                c0Hddr = c0Name + ": dec";
            }

            colHddrs = new String[colCt] {
                c0Hddr, c1Name, c2Name, c3Name
            };
            colNames = new String[colCt] {
                c0Name, c1Name, c2Name, c3Name
            };
            colSizes = new Int32[colCt] {
                lc0, lc1, lc2, lc3
            };

            //----------------------------------------------------------------//
            //                                                                //
            // Open the table and Write the column header text.               //
            //                                                                //
            //----------------------------------------------------------------//

            ReportCore.tableHddrData(writer, rptFileFmt, false,
                                     colCt, colHddrs, colSizes);

            //----------------------------------------------------------------//
            //                                                                //
            // Write the data rows.                                           //
            //                                                                //
            //----------------------------------------------------------------//

            for (Int32 i = 0; i < ctItems; i++)
            {
                DataRow row = table.Rows[i];

                Int32 indxRowType = (Int32)row[rtName];

                String rowType = Enum.GetName
                                     (typeof(PrnParseRowTypes.eType),
                                     indxRowType);

                ReportCore.tableRowData(
                    writer, rptFileFmt,
                    ReportCore.eRptChkMarks.text,   // not used by this tool //
                    colCt, rowType,
                    row, colNames, colSizes);
            }

            //----------------------------------------------------------------//
            //                                                                //
            // Write any required end tags.                                   //
            //                                                                //
            //----------------------------------------------------------------//

            ReportCore.tableClose(writer, rptFileFmt);
        }
Пример #19
0
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // m e t r i c s L o a d F i l e R p t                                //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Load current target report file metrics data.                      //
        //                                                                    //
        //--------------------------------------------------------------------//

        public static void metricsLoadFileRpt(
            ToolCommonData.eToolIds crntToolId)
        {
            Int32 tmpFmt      = 0,
                  tmpChkMarks = 0;

            Byte indxFmtNA    = (Byte)ReportCore.eRptFileFmt.NA;
            Byte indxOptChkNA = (Byte)ReportCore.eRptChkMarks.NA;

            Boolean flagNA = false;

            //----------------------------------------------------------------//

            if (crntToolId == ToolCommonData.eToolIds.MakeOverlay)
            {
                ToolMakeOverlayPersist.loadDataRpt(ref tmpFmt);
            }
            else if (crntToolId == ToolCommonData.eToolIds.PrintLang)
            {
                ToolPrintLangPersist.loadDataRpt(ref tmpFmt, ref tmpChkMarks,
                                                 ref _flagOptRptWrap);
            }
            else if (crntToolId == ToolCommonData.eToolIds.PrnAnalyse)
            {
                ToolPrnAnalysePersist.loadDataRpt(ref tmpFmt);
            }
            else if (crntToolId == ToolCommonData.eToolIds.SoftFontGenerate)
            {
                ToolSoftFontGenPersist.loadDataRpt(ref tmpFmt,
                                                   ref tmpChkMarks);
            }
            else if (crntToolId == ToolCommonData.eToolIds.StatusReadback)
            {
                ToolStatusReadbackPersist.loadDataRpt(ref tmpFmt);
            }
            else if (crntToolId == ToolCommonData.eToolIds.SymbolSetGenerate)
            {
                ToolSymbolSetGenPersist.loadDataRpt(ref tmpFmt);
            }
            else
            {
                flagNA = true;
            }

            //----------------------------------------------------------------//

            if (flagNA)
            {
                tmpFmt = indxFmtNA;
            }
            else
            {
                if (tmpFmt >= indxFmtNA)
                {
                    tmpFmt = 0;
                }

                if (tmpChkMarks >= indxOptChkNA)
                {
                    tmpChkMarks = 0;
                }
            }

            _rptFileFmt  = (ReportCore.eRptFileFmt)tmpFmt;
            _rptChkMarks = (ReportCore.eRptChkMarks)tmpChkMarks;
        }
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // r e p o r t B o d y S t d                                          //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Write details of specified two-column table to report file.        //
        //                                                                    //
        //--------------------------------------------------------------------//

        private static void reportBodyStd(
            ReportCore.eRptFileFmt rptFileFmt,
            ReportCore.eRptChkMarks rptChkMarks,
            Object writer,
            DataTable table)
        {
            const Int32 colCt = 2;

            const String c0Name = "Name";
            const String c1Name = "Value";

            const Int32 lc0 = 21;
            const Int32 lc1 = 57;

            String[] colHddrs;
            String[] colNames;
            Int32[]  colSizes;

            Int32 ctItems;

            ctItems = table.Rows.Count;

            colHddrs = new String[colCt] {
                c0Name, c1Name
            };
            colNames = new String[colCt] {
                c0Name, c1Name
            };
            colSizes = new Int32[colCt] {
                lc0, lc1
            };

            ctItems = table.Rows.Count;

            //----------------------------------------------------------------//
            //                                                                //
            // Open the table and Write the column header text.               //
            //                                                                //
            //----------------------------------------------------------------//

            ReportCore.tableHddrData(writer, rptFileFmt, false,
                                     colCt, colHddrs, colSizes);

            //----------------------------------------------------------------//
            //                                                                //
            // Write the data rows.                                           //
            //                                                                //
            //----------------------------------------------------------------//

            for (Int32 i = 0; i < ctItems; i++)
            {
                DataRow row = table.Rows[i];

                ReportCore.tableRowData(writer, rptFileFmt, rptChkMarks,
                                        colCt, null,
                                        row, colNames, colSizes);
            }

            //----------------------------------------------------------------//
            //                                                                //
            // Write any required end tags.                                   //
            //                                                                //
            //----------------------------------------------------------------//

            ReportCore.tableClose(writer, rptFileFmt);
        }
Пример #21
0
        //--------------------------------------------------------------------//
        //                                                        F i e l d s //
        // Class variables.                                                   //
        //                                                                    //
        //--------------------------------------------------------------------//

        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // g e n e r a t e                                                    //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Generate the report.                                               //
        //                                                                    //
        //--------------------------------------------------------------------//

        public static void generate(ReportCore.eRptFileFmt rptFileFmt,
                                    String symSetFilename,
                                    UInt16 symSetNo,
                                    UInt16 [] symSetMap,
                                    UInt16 codeMin,
                                    UInt16 codeMax,
                                    UInt16 codeCt,
                                    UInt64 charCollReq,
                                    Boolean flagIgnoreC0,
                                    Boolean flagIgnoreC1,
                                    Boolean flagMapHex,
                                    PCLSymSetTypes.eIndex symSetType)
        {
            Object stream = null;
            Object writer = null;

            Boolean OK = false;

            String fileExt;
            String saveFilename = null;

            if (rptFileFmt == ReportCore.eRptFileFmt.html)
            {
                fileExt = "html";
            }
            else if (rptFileFmt == ReportCore.eRptFileFmt.xml)
            {
                fileExt = "xml";
            }
            else
            {
                fileExt = "txt";
            }

            saveFilename = symSetFilename + "_report." + fileExt;

            OK = ReportCore.docOpen(rptFileFmt,
                                    ref saveFilename,
                                    ref stream,
                                    ref writer);

            if (OK)
            {
                ReportCore.docInitialise(rptFileFmt, writer, true, false,
                                         0, null,
                                         null, null);

                reportHddr(rptFileFmt, writer, symSetFilename);

                reportBodyMain(rptFileFmt, writer, symSetNo,
                               codeMin, codeMax, codeCt, charCollReq,
                               flagIgnoreC0, flagIgnoreC1, flagMapHex,
                               symSetType);

                reportBodyMap(rptFileFmt, writer, symSetMap,
                              codeMin, codeMax,
                              flagIgnoreC0, flagIgnoreC1, flagMapHex);

                ReportCore.docFinalise(rptFileFmt, writer);

                ReportCore.docClose(rptFileFmt, stream, writer);
            }
        }
Пример #22
0
        //--------------------------------------------------------------------//
        //                                                        F i e l d s //
        // Class variables.                                                   //
        //                                                                    //
        //--------------------------------------------------------------------//

        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // g e n e r a t e                                                    //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Generate the report.                                               //
        //                                                                    //
        //--------------------------------------------------------------------//

        public static void generate(
            ReportCore.eRptFileFmt rptFileFmt,
            DataTable table,
            String prnFilename,
            String ovlFilename,
            Boolean flagOffsetHex,
            PrnParseOptions options)
        {
            Object stream = null;
            Object writer = null;

            Boolean OK = false;

            String fileExt;
            String saveFilename = null;

            if (rptFileFmt == ReportCore.eRptFileFmt.html)
            {
                fileExt = "html";
            }
            else if (rptFileFmt == ReportCore.eRptFileFmt.xml)
            {
                fileExt = "xml";
            }
            else
            {
                fileExt = "txt";
            }

            saveFilename = ovlFilename + "_report." + fileExt;

            OK = ReportCore.docOpen(rptFileFmt,
                                    ref saveFilename,
                                    ref stream,
                                    ref writer);

            if (OK)
            {
                Int32 ctClrMapRowTypes = PrnParseRowTypes.getCount();

                Boolean useClr = options.FlagClrMapUseClr;

                if (useClr)
                {
                    String[] rowClasses = new String[ctClrMapRowTypes];
                    String[] rowClrBack = new String[ctClrMapRowTypes];
                    String[] rowClrFore = new String[ctClrMapRowTypes];

                    getRowColourStyleData(options,
                                          ref rowClasses,
                                          ref rowClrBack,
                                          ref rowClrFore);

                    ReportCore.docInitialise(rptFileFmt, writer, true, false,
                                             ctClrMapRowTypes, rowClasses,
                                             rowClrBack, rowClrFore);
                }
                else
                {
                    ReportCore.docInitialise(rptFileFmt, writer, true, false,
                                             0, null,
                                             null, null);
                }

                reportHeader(rptFileFmt, writer,
                             prnFilename, ovlFilename);

                reportBody(rptFileFmt, writer,
                           table, flagOffsetHex);

                ReportCore.docFinalise(rptFileFmt, writer);

                ReportCore.docClose(rptFileFmt, stream, writer);
            }
        }
Пример #23
0
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // r e p o r t B o d y M a p                                          //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Write details of mapping to report file.                           //
        //                                                                    //
        //--------------------------------------------------------------------//

        private static void reportBodyMap(
            ReportCore.eRptFileFmt rptFileFmt,
            Object writer,
            UInt16[] symSetMap,
            UInt16 codeMin,
            UInt16 codeMax,
            Boolean flagIgnoreC0,
            Boolean flagIgnoreC1,
            Boolean flagMapHex)
        {
            const Int32 maxLineLen = 80;        // ***************** constant elsewhere ???????????????

            const Int32 lcDec = 5;
            const Int32 lcHex = 4;
            const Int32 lrDec = 5;
            const Int32 lrHex = 4;

            const Int32 colCt = 17;

            Int32 lcCol,
                  lrHddr;

            String fmtHddr,
                   fmtVal;

            Int32 mapIndx,
                  rowIndx;

            String[] colHddrs = new String [colCt];
            String[] colNames = new String [colCt];
            Int32[]  colSizes = new Int32 [colCt];

            Int32 ctItems;

            ctItems = symSetMap.Length;

            //----------------------------------------------------------------//
            //                                                                //
            // Write out the header.                                          //
            //                                                                //
            //----------------------------------------------------------------//

            ReportCore.hddrTitle(writer, rptFileFmt, true,
                                 "Mapping detail:");

            ReportCore.tableHddrPair(writer, rptFileFmt);

            ReportCore.tableRowPair(writer, rptFileFmt,
                                    "Format",
                                    (flagMapHex ? "hexadecimal" : "decimal"),
                                    _colSpanNone, _colSpanNone,
                                    _maxSizeNameTag, maxLineLen,
                                    _flagNone, _flagNone, _flagNone);

            ReportCore.tableClose(writer, rptFileFmt);

            //----------------------------------------------------------------//
            //                                                                //
            // Open the table and write the column header text.               //
            //                                                                //
            //----------------------------------------------------------------//

            if (flagMapHex)
            {
                lcCol  = lcHex;
                lrHddr = lrHex;

                fmtHddr = "x4";
                fmtVal  = "x4";

                colSizes[0] = lrHex;
                colNames[0] = "row";
                colHddrs[0] = "";

                for (Int32 i = 1; i < colCt; i++)
                {
                    colSizes[i] = lcHex;
                    colNames[i] = "col" + (i - 1).ToString("D2");
                    colHddrs[i] = "_" + (i - 1).ToString("x");
                }
            }
            else
            {
                lcCol  = lcDec;
                lrHddr = lrDec;

                fmtHddr = "";
                fmtVal  = "";

                colSizes[0] = lrDec;
                colNames[0] = "row";
                colHddrs[0] = "";

                for (Int32 i = 1; i < colCt; i++)
                {
                    colSizes[i] = lcDec;
                    colNames[i] = "col" + (i - 1).ToString("D2");
                    colHddrs[i] = "+" + (i - 1).ToString("d");
                }
            }

            ReportCore.tableHddrData(writer, rptFileFmt, true,
                                     colCt, colHddrs, colSizes);

            //----------------------------------------------------------------//
            //                                                                //
            // Write the data rows.                                           //
            //                                                                //
            //----------------------------------------------------------------//

            Int32 colCtData = colCt - 1;

            mapIndx = 0;
            rowIndx = codeMin / colCtData;

            for (Int32 i = rowIndx; mapIndx < codeMax; i++)
            {
                String[] rowData = new String [colCt];

                rowIndx = (i * colCtData);

                if (flagMapHex)
                {
                    rowData[0] = (rowIndx.ToString(fmtHddr).
                                  Substring(0, 3) + "_").
                                 PadLeft(lrHddr, ' ');
                }
                else
                {
                    rowData[0] = rowIndx.ToString(fmtHddr).
                                 PadLeft(lrHddr, ' ');
                }

                for (Int32 j = 0; j < colCtData; j++)
                {
                    String val;

                    mapIndx = rowIndx + j;

                    if ((mapIndx < codeMin) || (mapIndx > codeMax))
                    {
                        val = " ".PadLeft(lcCol, ' ');
                    }
                    else if ((flagIgnoreC1) &&
                             ((mapIndx >= cCodePointC1Min) &&
                              (mapIndx <= cCodePointC1Max)))
                    {
                        val = cCodePointUnused.
                              ToString(fmtVal).PadLeft(lcCol, ' ');
                    }
                    else
                    {
                        val = symSetMap[mapIndx].
                              ToString(fmtVal).PadLeft(lcCol, ' ');
                    }

                    rowData[j + 1] = val;
                }

                ReportCore.tableRowText(writer, rptFileFmt, colCt,
                                        rowData, colNames, colSizes);
            }

            //----------------------------------------------------------------//
            //                                                                //
            // Write any required end tags.                                   //
            //                                                                //
            //----------------------------------------------------------------//

            ReportCore.tableClose(writer, rptFileFmt);
        }
Пример #24
0
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // r e p o r t B o d y M a i n                                        //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Write report header.                                               //
        //                                                                    //
        //--------------------------------------------------------------------//

        private static void reportBodyMain(
            ReportCore.eRptFileFmt rptFileFmt,
            Object writer,
            //  String symSetFilename,
            UInt16 symSetNo,
            UInt16 codeMin,
            UInt16 codeMax,
            UInt16 codeCt,
            UInt64 charCollReq,
            Boolean flagIgnoreC0,
            Boolean flagIgnoreC1,
            Boolean flagMapHex,
            PCLSymSetTypes.eIndex symSetType)
        {
            const Int32 maxLineLen = 80;        // ***************** constant elsewhere ???????????????

            //----------------------------------------------------------------//
            //                                                                //
            // Write out the title.                                           //
            //                                                                //
            //----------------------------------------------------------------//

            ReportCore.hddrTitle(writer, rptFileFmt, true,
                                 "Symbol set details:");

            //----------------------------------------------------------------//
            //                                                                //
            // Write out the symbol set basic details.                        //
            //                                                                //
            //----------------------------------------------------------------//

            ReportCore.tableHddrPair(writer, rptFileFmt);

            ReportCore.tableRowPair(writer, rptFileFmt,
                                    "SymSetNo", symSetNo.ToString(),
                                    _colSpanNone, _colSpanNone,
                                    _maxSizeNameTag, maxLineLen,
                                    _flagNone, _flagNone, _flagNone);

            ReportCore.tableRowPair(writer, rptFileFmt,
                                    "SymSetId",
                                    PCLSymbolSets.translateKind1ToId(symSetNo).ToString(),
                                    _colSpanNone, _colSpanNone,
                                    _maxSizeNameTag, maxLineLen,
                                    _flagNone, _flagNone, _flagNone);

            ReportCore.tableRowPair(writer, rptFileFmt,
                                    "IgnoreC0Codes",
                                    (flagIgnoreC0 ? "true" : "false"),
                                    _colSpanNone, _colSpanNone,
                                    _maxSizeNameTag, maxLineLen,
                                    _flagNone, _flagNone, _flagNone);

            ReportCore.tableRowPair(writer, rptFileFmt,
                                    "IgnoreC1Codes",
                                    (flagIgnoreC1 ? "true" : "false"),
                                    _colSpanNone, _colSpanNone,
                                    _maxSizeNameTag, maxLineLen,
                                    _flagNone, _flagNone, _flagNone);

            ReportCore.tableRowPair(writer, rptFileFmt,
                                    "FirstCode",
                                    (flagMapHex ? "0x" + codeMin.ToString("x4")
                                             : codeMin.ToString()),
                                    _colSpanNone, _colSpanNone,
                                    _maxSizeNameTag, maxLineLen,
                                    _flagNone, _flagNone, _flagNone);

            ReportCore.tableRowPair(writer, rptFileFmt,
                                    "Lastcode",
                                    (flagMapHex ? "0x" + codeMax.ToString("x4")
                                             : codeMax.ToString()),
                                    _colSpanNone, _colSpanNone,
                                    _maxSizeNameTag, maxLineLen,
                                    _flagNone, _flagNone, _flagNone);

            ReportCore.tableRowPair(writer, rptFileFmt,
                                    "CharCount",
                                    (flagMapHex ? "0x" + codeCt.ToString("x4")
                                             : codeCt.ToString()),
                                    _colSpanNone, _colSpanNone,
                                    _maxSizeNameTag, maxLineLen,
                                    _flagNone, _flagNone, _flagNone);

            ReportCore.tableRowPair(writer, rptFileFmt,
                                    "CharReqBits",
                                    "0x" + charCollReq.ToString("x16"),
                                    _colSpanNone, _colSpanNone,
                                    _maxSizeNameTag, maxLineLen,
                                    _flagNone, _flagNone, _flagNone);

            ReportCore.tableClose(writer, rptFileFmt);
        }
        //--------------------------------------------------------------------//
        //                                                        F i e l d s //
        // Class variables.                                                   //
        //                                                                    //
        //--------------------------------------------------------------------//

        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // g e n e r a t e                                                    //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Generate the report.                                               //
        //                                                                    //
        //--------------------------------------------------------------------//

        public static void generate(ReportCore.eRptFileFmt rptFileFmt,
                                    ReportCore.eRptChkMarks rptChkMarks,
                                    DataTable tableDonor,
                                    DataTable tableMapping,
                                    DataTable tableTarget,
                                    DataTable tableChars,
                                    String fontNameTTF,
                                    String fontFilenameTTF,
                                    String fontFilenamePCL)
        {
            Object stream = null;
            Object writer = null;

            Boolean OK = false;

            String fileExt;
            String saveFilename = null;

            if (rptFileFmt == ReportCore.eRptFileFmt.html)
            {
                fileExt = "html";
            }
            else if (rptFileFmt == ReportCore.eRptFileFmt.xml)
            {
                fileExt = "xml";
            }
            else
            {
                fileExt = "txt";
            }

            saveFilename = fontFilenamePCL + "_report." + fileExt;

            OK = ReportCore.docOpen(rptFileFmt,
                                    ref saveFilename,
                                    ref stream,
                                    ref writer);
            if (OK)
            {
                ReportCore.docInitialise(rptFileFmt, writer, true, false,
                                         0, null,
                                         null, null);

                reportHddr(rptFileFmt, writer,
                           fontNameTTF, fontFilenameTTF, fontFilenamePCL);

                reportHddrSub(rptFileFmt, writer, "Donor font details");

                reportBodyStd(rptFileFmt, rptChkMarks, writer, tableDonor);

                reportHddrSub(rptFileFmt, writer, "Mapping details");

                reportBodyStd(rptFileFmt, rptChkMarks, writer, tableMapping);

                reportHddrSub(rptFileFmt, writer, "Target font details");

                reportBodyStd(rptFileFmt, rptChkMarks, writer, tableTarget);

                reportHddrSub(rptFileFmt, writer, "Generated character details");

                reportBodyChars(rptFileFmt, rptChkMarks, writer, tableChars);

                ReportCore.docFinalise(rptFileFmt, writer);

                ReportCore.docClose(rptFileFmt, stream, writer);
            }
        }