Exemplo n.º 1
0
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // g e t R o w C o l o u r S t y l e D a t a                          //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Get references to colour style data for colour coded analysis.     //
        //                                                                    //
        //--------------------------------------------------------------------//

        private static void getRowColourStyleData(
            PrnParseOptions options,
            ref String[] classes,
            ref String[] clrBack,
            ref String[] clrFore)
        {
            Int32 indxClrBack;
            Int32 indxClrFore;

            PropertyInfo[] stdClrsPropertyInfo = null;

            Boolean flagClrMapUseClr = false;

            PropertyInfo pInfoBack,
                         pInfoFore;

            Int32 ctClrMapRowTypes = PrnParseRowTypes.getCount();
            Int32 ctClrMapStdClrs  = 0;

            Int32[] indxClrMapBack = new Int32[ctClrMapRowTypes];
            Int32[] indxClrMapFore = new Int32[ctClrMapRowTypes];

            options.getOptClrMap(ref flagClrMapUseClr,
                                 ref indxClrMapBack,
                                 ref indxClrMapFore);

            options.getOptClrMapStdClrs(ref ctClrMapStdClrs,
                                        ref stdClrsPropertyInfo);

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

            for (Int32 i = 0; i < ctClrMapRowTypes; i++)
            {
                String rowType =
                    Enum.GetName(typeof(PrnParseRowTypes.eType), i);

                indxClrBack = indxClrMapBack[i];
                indxClrFore = indxClrMapFore[i];

                pInfoBack = stdClrsPropertyInfo[indxClrBack] as PropertyInfo;
                pInfoFore = stdClrsPropertyInfo[indxClrFore] as PropertyInfo;

                classes[i] = rowType;
                clrBack[i] = pInfoBack.Name;
                clrFore[i] = pInfoFore.Name;
            }
        }
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // i n i t i a l i s e                                                //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Initialise 'target' data.                                          //
        //                                                                    //
        //--------------------------------------------------------------------//

        private void initialise()
        {
            //----------------------------------------------------------------//
            //                                                                //
            // Populate form.                                                 //
            //                                                                //
            //----------------------------------------------------------------//

            btnGenerate.Content = "Generate overlay";

            _options = new PrnParseOptions();  // need a dummy one //

            grpOverlay.Visibility  = Visibility.Hidden;
            grpProgress.Visibility = Visibility.Hidden;

            btnGenerate.Visibility   = Visibility.Hidden;
            btnSaveReport.Visibility = Visibility.Hidden;

            //----------------------------------------------------------------//
            //                                                                //
            // Reinstate settings from persistent storage.                    //
            //                                                                //
            //----------------------------------------------------------------//

            metricsLoad();

            txtPrnFilename.Text = _prnFilename;

            txtPCLMacroId.Text      = _macroIdPCL.ToString();
            txtPCLXLStreamName.Text = _streamNamePCLXL;

            rbPCLOvlEnc.IsChecked   = _flagOvlEncPCL;
            rbPCLXLOvlEnc.IsChecked = _flagOvlEncPCLXL;

            chkPCLRestoreCursor.IsChecked = _flagRestoreCursorPCL;
            chkPCLXLRestoreGS.IsChecked   = _flagRestoreGSPCLXL;

            if (_flagOvlEncPCL)
            {
                lbPCLMacroId.Visibility  = Visibility.Visible;
                txtPCLMacroId.Visibility = Visibility.Visible;
            }
            else
            {
                lbPCLMacroId.Visibility  = Visibility.Hidden;
                txtPCLMacroId.Visibility = Visibility.Hidden;
            }

            if (_flagOvlEncPCLXL)
            {
                lbPCLXLStreamName.Visibility  = Visibility.Visible;
                txtPCLXLStreamName.Visibility = Visibility.Visible;
            }
            else
            {
                lbPCLXLStreamName.Visibility  = Visibility.Hidden;
                txtPCLXLStreamName.Visibility = Visibility.Hidden;
            }

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

            txtPCLOvlFilename.Text   = _ovlFilenamePCL;
            txtPCLXLOvlFilename.Text = _ovlFilenamePCLXL;

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

            Int32 ctRowTypes = PrnParseRowTypes.getCount();

            _indxClrMapBack = new Int32[ctRowTypes];
            _indxClrMapFore = new Int32[ctRowTypes];

            _options.getOptClrMap(ref _flagClrMapUseClr,
                                  ref _indxClrMapBack,
                                  ref _indxClrMapFore);

            _options.getOptClrMapStdClrs(ref _ctClrMapStdClrs,
                                         ref _stdClrsPropertyInfo);

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

            initialiseGridProgress();
        }
Exemplo n.º 3
0
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // i n i t i a l i s e                                                //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Initialise . . .                                                   //
        //                                                                    //
        //--------------------------------------------------------------------//

        private void initialise()
        {
            //    _initialised = false;

            _redoAnalysis   = true;
            _redoContent    = true;
            _redoStatistics = true;

            //----------------------------------------------------------------//
            //                                                                //
            // Populate form.                                                 //
            //                                                                //
            //----------------------------------------------------------------//

            btnAnalysis.IsEnabled   = false;
            btnContent.IsEnabled    = false;
            btnStatistics.IsEnabled = false;
            btnSaveReport.IsEnabled = false;

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

            //     btnAnalyse.Content = "Analyse print file";

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

            _options = new PrnParseOptions();

            /*
             * //----------------------------------------------------------------//
             * //                                                                //
             * // If we ever support the 'doWork' mechanism:                     //
             * //                                                                //
             * //----------------------------------------------------------------//
             *
             * _bkWk = new BackgroundWorker ();
             *
             * _bkWk.WorkerReportsProgress = true;
             *
             * _bkWk.DoWork += new DoWorkEventHandler (this.bkWk_DoWork);
             *
             * _bkWk.RunWorkerCompleted +=
             *  new RunWorkerCompletedEventHandler (this.bkWk_Completed);
             *
             * _bkWk.ProgressChanged +=
             *  new ProgressChangedEventHandler (this.bkWk_Progress);
             */

            //----------------------------------------------------------------//
            //                                                                //
            // Reinstate settings from persistent storage.                    //
            //                                                                //
            //----------------------------------------------------------------//

            metricsLoad();

            _fileSize = -1;

            Int32 ctRowTypes = PrnParseRowTypes.getCount();

            _indxClrMapBack = new Int32[ctRowTypes];
            _indxClrMapFore = new Int32[ctRowTypes];

            _options.getOptClrMap(ref _flagClrMapUseClr,
                                  ref _indxClrMapBack,
                                  ref _indxClrMapFore);

            _options.getOptClrMapStdClrs(ref _ctClrMapStdClrs,
                                         ref _stdClrsPropertyInfo);

            /*
             * //----------------------------------------------------------------//
             * //                                                                //
             * // If we ever support the 'doWork' mechanism:                     //
             * //      statusBar updates                                         //
             * //                                                                //
             * //----------------------------------------------------------------//
             *
             * statusBar.Items[0] = "";
             * statusBar.Items[1] = "";
             */

            txtFileName.Text = "";
            txtFileSize.Text = "";

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

            initialiseGridAnalysis();
            initialiseGridContent();
            initialiseGridStatistics();

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

            //     _initialised = true;
        }