//--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // b t n G e n e r a t e _ C l i c k                                  //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Called when the 'Generate' button is clicked.                      //
        //                                                                    //
        //--------------------------------------------------------------------//

        private void btnGenerate_Click(object sender, RoutedEventArgs e)
        {
            PrnParse parseFile = new PrnParse(PrnParse.eParseType.MakeOverlay,
                                              0);

            _tableProgress.Clear();

            if (_crntPDL == ToolCommonData.ePrintLang.PCL)
            {
                parseFile.makeOverlayPCL(_prnFilename,
                                         ref _ovlFilenamePCL,
                                         _options,
                                         _tableProgress,
                                         _flagRestoreCursorPCL,
                                         _flagOvlEncPCL,
                                         _macroIdPCL);

                txtPCLOvlFilename.Text = _ovlFilenamePCL;
            }
            else if (_crntPDL == ToolCommonData.ePrintLang.PCLXL)
            {
                parseFile.makeOverlayPCLXL(_prnFilename,
                                           ref _ovlFilenamePCLXL,
                                           _options,
                                           _tableProgress,
                                           _flagRestoreGSPCLXL,
                                           _flagOvlEncPCLXL,
                                           _streamNamePCLXL);

                txtPCLXLOvlFilename.Text = _ovlFilenamePCLXL;
            }

            grpProgress.Visibility   = Visibility.Visible;
            btnSaveReport.Visibility = Visibility.Visible;
        }
Ejemplo n.º 2
0
        //--------------------------------------------------------------------//
        //                                              C o n s t r u c t o r //
        // P r n P a r s e L i n k D a t a                                    //
        //                                                                    //
        //--------------------------------------------------------------------//

        public PrnParseLinkData(
            PrnParse analysisOwner,
            Int32 analysisLevel,
            Int32 macroLevel,
            PCLXLOperators.eEmbedDataType pclxlEmbedType)
        {
            _analysisOwner  = analysisOwner;
            _analysisLevel  = analysisLevel;
            _macroLevel     = macroLevel;
            _pclxlEmbedType = pclxlEmbedType;

            _contType    = PrnParseConstants.eContType.None;
            _prefixLen   = 0;
            _dataLen     = 0;
            _downloadRem = 0;

            _entryCt  = 0;
            _entryNo  = 0;
            _entryRem = 0;
            _entrySz1 = 0;
            _entrySz2 = 0;

            _backTrack = false;
            _prefixA   = 0x00;
            _prefixB   = 0x00;

            _eof = false;

            _fileSize = 0;

            _makeOvlOffset      = 0;
            _makeOvlSkipBegin   = -1;
            _makeOvlSkipEnd     = -1;
            _makeOvlAct         = PrnParseConstants.eOvlAct.None;
            _makeOvlPos         = PrnParseConstants.eOvlPos.BeforeFirstPage;
            _makeOvlShow        = PrnParseConstants.eOvlShow.None;
            _makeOvlMacroId     = -1;
            _makeOvlStreamName  = "";
            _makeOvlPageMark    = false;
            _makeOvlXL          = false;
            _makeOvlEncapsulate = false;

            _pclComboStart    = -1;
            _pclComboSeq      = false;
            _pclComboFirst    = false;
            _pclComboLast     = false;
            _pclComboModified = false;

            _prescribeSCRC      = PrnParseConstants.prescribeSCRCDefault;
            _prescribeIntroRead = false;
        }
Ejemplo n.º 3
0
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // b t n A n a l y s i s _ C l i c k                                  //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Called when the 'Analyse' button is clicked.                       //
        //                                                                    //
        //--------------------------------------------------------------------//

        private void btnAnalysis_Click(object sender, RoutedEventArgs e)
        {
            //    progBar1.Value = 0;

            if (_redoAnalysis)
            {
                /*
                 * //------------------------------------------------------------//
                 * //                                                            //
                 * // If we ever support the 'doWork' mechanism:                 //
                 * //                                                            //
                 * //------------------------------------------------------------//
                 *
                 * this._bkWk.RunWorkerAsync (); // Then move following code to DoWork
                 */

                PrnParse parseFile = new PrnParse(PrnParse.eParseType.Analyse,
                                                  0);

                _tableAnalysis.Clear();
                _tableStatistics.Clear();

                initialiseGridAnalysis();

                parseFile.analyse(_prnFilename,
                                  _options,
                                  _tableAnalysis);

                _redoAnalysis = false;
            }

            tabCtrl.SelectedItem = tabAnalysis;

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

            txtRptSizeAnalysis.Text = _tableAnalysis.Rows.Count.ToString();

            btnSaveReport.Content   = "Save Analysis Report ...";
            btnSaveReport.IsEnabled = true;
            btnStatistics.IsEnabled = true;
        }
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // b t n S c a n _ C l i c k                                          //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Called when the 'Scan' button is clicked.                          //
        //                                                                    //
        //--------------------------------------------------------------------//

        private void btnScan_Click(object sender, RoutedEventArgs e)
        {
            Boolean validPDL = false;

            Int32 ptr;

            ToolCommonData.ePrintLang scanPDL;

            PrnParse parseFile = new PrnParse(PrnParse.eParseType.ScanForPDL,
                                              0);

            _tableProgress.Clear();

            scanPDL = ToolCommonData.ePrintLang.Unknown;

            parseFile.makeOverlayScan(_prnFilename,
                                      _options,
                                      ref scanPDL);

            ptr = _prnFilename.LastIndexOf(".");

            if (ptr <= 0)
            {
                ptr = _prnFilename.Length;
            }

            if ((scanPDL == ToolCommonData.ePrintLang.PCL)
                ||
                (scanPDL == ToolCommonData.ePrintLang.HPGL2))
            {
                validPDL = true;
                _crntPDL = ToolCommonData.ePrintLang.PCL;

                tabPCL.IsEnabled  = true;
                tabPCL.IsSelected = true;

                tabPCLXL.IsEnabled = false;

                _ovlFilenamePCL = _prnFilename.Substring(0, ptr) + ".ovl";

                txtPCLOvlFilename.Text = _ovlFilenamePCL;
            }
            else if ((scanPDL == ToolCommonData.ePrintLang.PCLXL)
                     ||
                     (scanPDL == ToolCommonData.ePrintLang.XL2HB))
            {
                validPDL = true;
                _crntPDL = ToolCommonData.ePrintLang.PCLXL;

                tabPCLXL.IsEnabled  = true;
                tabPCLXL.IsSelected = true;

                tabPCL.IsEnabled = false;

                _ovlFilenamePCLXL = _prnFilename.Substring(0, ptr) + ".ovx";

                txtPCLXLOvlFilename.Text = _ovlFilenamePCLXL;
            }

            if (validPDL)
            {
                grpOverlay.Visibility  = Visibility.Visible;
                btnGenerate.Visibility = Visibility.Visible;
            }
            else
            {
                MessageBox.Show("Source print file appears to be a '" +
                                scanPDL.ToString() +
                                "' printfile.\n\n" +
                                "This tool does not support the generation of an " +
                                "overlay from such a print file.",
                                "Page Description Language not supported",
                                MessageBoxButton.OK,
                                MessageBoxImage.Warning);
            }
        }