示例#1
0
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // r e s e t S t a t i s t i c s                                      //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Reset analysis statisics counts.                                   //
        //                                                                    //
        //--------------------------------------------------------------------//

        public void resetStatistics()
        {
            btnStatistics.IsEnabled   = false;
            txtRptSizeStatistics.Text = "0";

            _tableStatistics.Clear();

            PrescribeCommands.resetStatsCounts();
            PJLCommands.resetStatsCounts();
            PCLComplexSeqs.resetStatsCounts();
            PCLSimpleSeqs.resetStatsCounts();
            PCLControlCodes.resetStatsCounts();
            HPGL2Commands.resetStatsCounts();
            HPGL2ControlCodes.resetStatsCounts();
            PCLXLDataTypes.resetStatsCounts();
            //   PCLXLAttrDefiners.resetStatsCounts ();
            PCLXLAttributes.resetStatsCounts();
            PCLXLAttrEnums.resetStatsCounts();
            //   PCLXLEmbedDataDefs.resetStatsCounts ();
            PCLXLOperators.resetStatsCounts();
            PCLXLWhitespaces.resetStatsCounts();
        }
示例#2
0
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // b t n S t a t i s t i c s _ C l i c k                              //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Called when the 'Show Statistics' button is clicked.               //
        //                                                                    //
        //--------------------------------------------------------------------//

        private void btnStatistics_Click(object sender, RoutedEventArgs e)
        {
            if (_redoStatistics)
            {
                PrnParseConstants.eOptStatsLevel level =
                    PrnParseConstants.eOptStatsLevel.ReferencedOnly;

                Boolean incUsedSeqsOnly       = false;
                Boolean excUnusedObsPCLSeqs   = false;
                Boolean excUnusedResPCLXLTags = false;

                _options.getOptStats(ref level,
                                     ref excUnusedObsPCLSeqs,
                                     ref excUnusedResPCLXLTags);

                _tableStatistics.Clear();

                if (level ==
                    PrnParseConstants.eOptStatsLevel.ReferencedOnly)
                {
                    incUsedSeqsOnly = true;
                }
                else
                {
                    incUsedSeqsOnly = false;
                }

                PrescribeCommands.displayStatsCounts(_tableStatistics,
                                                     incUsedSeqsOnly);

                PJLCommands.displayStatsCounts(_tableStatistics,
                                               incUsedSeqsOnly);

                PCLControlCodes.displayStatsCounts(_tableStatistics,
                                                   incUsedSeqsOnly);

                PCLSimpleSeqs.displayStatsCounts(_tableStatistics,
                                                 incUsedSeqsOnly,
                                                 excUnusedObsPCLSeqs);

                PCLComplexSeqs.displayStatsCounts(_tableStatistics,
                                                  incUsedSeqsOnly,
                                                  excUnusedObsPCLSeqs);

                HPGL2Commands.displayStatsCounts(_tableStatistics,
                                                 incUsedSeqsOnly);

                HPGL2ControlCodes.displayStatsCounts(_tableStatistics,
                                                     incUsedSeqsOnly);

                PCLXLDataTypes.displayStatsCounts(_tableStatistics,
                                                  incUsedSeqsOnly,
                                                  excUnusedResPCLXLTags);

                PCLXLAttrEnums.displayStatsCounts(_tableStatistics,
                                                  incUsedSeqsOnly,
                                                  excUnusedResPCLXLTags);

                PCLXLAttributes.displayStatsCounts(_tableStatistics,
                                                   incUsedSeqsOnly,
                                                   excUnusedResPCLXLTags);

                PCLXLOperators.displayStatsCounts(_tableStatistics,
                                                  incUsedSeqsOnly,
                                                  excUnusedResPCLXLTags);

                PCLXLWhitespaces.displayStatsCounts(_tableStatistics,
                                                    incUsedSeqsOnly,
                                                    excUnusedResPCLXLTags);

                PMLDataTypes.displayStatsCounts(_tableStatistics,
                                                incUsedSeqsOnly);

                PMLActions.displayStatsCounts(_tableStatistics,
                                              incUsedSeqsOnly);

                PMLOutcomes.displayStatsCounts(_tableStatistics,
                                               incUsedSeqsOnly);

                // TODO = remaining types
                // PCL XL Attribute Definers ??
                // PCL XL Embedded Data Definers ??

                _redoStatistics = false;
            }

            tabCtrl.SelectedItem = tabStatistics;

            /*
             * //----------------------------------------------------------------//
             * //                                                                //
             * // If we ever support the 'doWork' mechanism:                     //
             * //      statusBar updates                                         //
             * //                                                                //
             * //----------------------------------------------------------------//
             *
             * statusBar.Items[2] = dgStatistics.Items.Count;
             * txtRptSizeStatistics.Text = dgStatistics.Items.Count.ToString ();
             */

            txtRptSizeStatistics.Text = _tableStatistics.Rows.Count.ToString();

            btnSaveReport.Content = "Save Statistics Report ...";
        }