Examples of InputLog


Examples of logformat.slog2.input.InputLog

        TopWindow.Control.setShowLegendButtonEnabled( !val );
    }

    public static void main( String[] args )
    {
        InputLog       in_slog_ins;
        LegendFrame    frame;

        checkVersion();
        parseCmdLineArgs( args );

        System.out.print( "Reading the SLOG-2 file ...... " );
        in_slog_ins  = new InputLog( in_filename );
        System.out.println( "Done." );
        String err_msg;
        if ( in_slog_ins == null ) {
            Dialogs.error( null, "Null InputLog!!" );
            in_slog_ins = null;
            System.exit( 1 );
        }
        if ( ! in_slog_ins.isSLOG2() ) {
            Dialogs.error( null, in_filename + " is NOT a SLOG-2 file!" );
            in_slog_ins = null;
            System.exit( 1 );
        }
        if ( (err_msg = in_slog_ins.getCompatibleHeader() ) != null ) {
            if ( ! Dialogs.confirm( null, err_msg
                                  + "Check the following version history "
                                  + "for compatibility.\n\n"
                                  + logformat.slog2.Const.VERSION_HISTORY + "\n"
                                  + "Do you still want to continue reading "
                                  + "the logfile ?" ) ) {
                in_slog_ins = null;
                System.exit( 1 );
            }
        }

        System.out.println( "Starting the SLOG-2 Legend .... " );
        in_slog_ins.initialize();
        frame     = new LegendFrame( in_slog_ins );
        // frame.pack() has to be called after the object is created
        frame.pack();
        frame.setVisible( true );
    }
View Full Code Here

Examples of logformat.slog2.input.InputLog

                Dialogs.error( window,
                               "File " + logname + " cannot be read." );
                return null;
            }

            InputLog slog = null;
            try {
                slog = new InputLog( logname );
            } catch ( NullPointerException nperr ) {
                Dialogs.error( window,
                               "NullPointerException when initializing "
                             + logname + "!" );
                return null;
View Full Code Here

Examples of logformat.slog2.input.InputLog

        String              convertor;
        String              path2jardir, path2tracelib;
        String              infile_name, outfile_name, jar_path;
        String              option4jar;
        File                infile, outfile, jar_file;
        InputLog            slog_ins;
        RuntimeExecCommand  exec_cmd;

        SwingProcessWorker  conv_worker;
        ProgressAction      conv_progress;

        // Check the validity of the Input File
        infile_name   = cmd_infile.getText();
        infile        = new File( infile_name );
        if ( ! infile.exists() ) {
            Dialogs.error( top_window,
                           infile_name + " does not exist!\n"
                         + "No conversion will take place." );
            return null;
        }
        if ( infile.isDirectory() ) {
            Dialogs.error( top_window,
                           infile_name + " is a directory!\n"
                         + "No conversion will take place." );
            return null;
        }
        if ( ! infile.canRead() ) {
            Dialogs.error( top_window,
                           "File " + infile_name + " is NOT readable!\n"
                         + "No conversion will take place." );
            return null;
        }
        slog_ins = null;
        try {
            slog_ins = new InputLog( infile_name );
        } catch ( NullPointerException nperr ) {
            slog_ins = null;
        } catch ( Exception err ) {
            slog_ins = null;
        }
        if ( slog_ins != null && slog_ins.isSLOG2() ) {
            Dialogs.error( top_window,
                           infile_name + " is already a SLOG-2 file!\n"
                         + "No conversion will take place." );
            cmd_outfile.setText( infile_name );
            return null;
View Full Code Here

Examples of logformat.slog2.input.InputLog

                                 "\t It is too old to run this viewer." );
    }

    public static void main( String[] args )
    {
        InputLog       in_slog_ins;
        TimelineFrame  frame;
        String         err_msg;

        checkVersion();
        parseCmdLineArgs( args );

        // Debug.setActive( true ); Debug.initTextArea();

        System.out.print( "Reading the SLOG-2 file ...... " );
        in_slog_ins  = new InputLog( in_filename );
        if ( in_slog_ins == null ) {
            Dialogs.error( TopWindow.First.getWindow(), "Null InputLog!" );
            System.exit( 1 );
        }
        if ( ! in_slog_ins.isSLOG2() ) {
            Dialogs.error( TopWindow.First.getWindow(),
                           in_filename + " is NOT a SLOG-2 file!" );
            in_slog_ins = null;
            System.exit( 1 );
        }
        if ( (err_msg = in_slog_ins.getCompatibleHeader() ) != null ) {
            if ( ! Dialogs.confirm( TopWindow.First.getWindow(),
                            err_msg
                          + "Check the following version history "
                          + "for compatibility.\n\n"
                          + logformat.slog2.Const.VERSION_HISTORY + "\n"
                          + "Do you still want to continue reading "
                          + "the logfile ?" ) ) {
                 in_slog_ins = null;
                 System.exit( 1 );
            }
        }
        in_slog_ins.initialize();
        System.out.println( "Done." );

        /*  Initialization  */
        Parameters.initSetupFile();
        Parameters.readFromSetupFile( null );
View Full Code Here

Examples of logformat.slog2.input.InputLog

    private static       double   time_final_ftr    = 1.0;
    private static       short    lowest_depth      = 0;

    public static final void main( String[] args )
    {
        InputLog         slog_ins;
        // CategoryMap      objdefs;
        TreeTrunk        treetrunk;
        TreeNode         treeroot;
        TimeBoundingBox  timebounds;
        String           err_msg;

        parseCmdLineArgs( args );

        slog_ins   = new InputLog( in_filename );
        if ( slog_ins == null ) {
            System.err.println( "Null input logfile!" );
            System.exit( 1 );
        }
        if ( ! slog_ins.isSLOG2() ) {
            System.err.println( in_filename + " is NOT SLOG-2 file!." );
            System.exit( 1 );
        }
        if ( (err_msg = slog_ins.getCompatibleHeader()) != null ) {
            System.err.print( err_msg );
            InputLog.stdoutConfirmation();
        }
        slog_ins.initialize();
        System.out.println( slog_ins );

        treetrunk  = new TreeTrunk( slog_ins, Drawable.INCRE_STARTTIME_ORDER );
        treetrunk.initFromTreeTop();
        treeroot   = treetrunk.getTreeRoot();
        if ( treeroot == null ) {
            System.out.println( "SLOG-2 file, " + in_filename + " "
                              + "contains no drawables" );
            slog_ins.close();
            System.exit( 0 );
        }

        timebounds = new TimeBoundingBox( treeroot );
        resetTimeBounds( timebounds );
        System.err.println( "Time Window is " + timebounds );

        treetrunk.growInTreeWindow( treeroot, lowest_depth, timebounds );
        if ( printNode )
            System.out.println( treetrunk.toString() );
        else
            System.out.println( treetrunk.toString( timebounds ) );
       
        slog_ins.close();
    }
View Full Code Here

Examples of logformat.slog2.input.InputLog

    private static String             in_filename;
    private static short              depth_max, depth;

    public static final void main( String[] args )
    {
        InputLog          slog_ins;
        TreeTrunk         treetrunk;
        TreeNode          treeroot;
        TimeBoundingBox   timeframe_root, timeframe_old, timeframe;
        String            err_msg;

        parseCmdLineArgs( args );

        slog_ins   = new InputLog( in_filename );
        if ( slog_ins == null ) {
            System.err.println( "Null input logfile!" );
            System.exit( 1 );
        }
        if ( ! slog_ins.isSLOG2() ) {
            System.err.println( in_filename + " is NOT SLOG-2 file!." );
            System.exit( 1 );
        }
        if ( (err_msg = slog_ins.getCompatibleHeader()) != null ) {
            System.err.print( err_msg );
            InputLog.stdoutConfirmation();
        }
        slog_ins.initialize();
        // System.out.println( slog_ins );

        // Initialize the TreeTrunk
        treetrunk  = new TreeTrunk( slog_ins, Drawable.INCRE_STARTTIME_ORDER );
        treetrunk.setDebuggingEnabled( isVerbose );
        treetrunk.initFromTreeTop();
        treeroot        = treetrunk.getTreeRoot();
        if ( treeroot == null ) {
            System.out.println( "SLOG-2 file, " + in_filename + " "
                              + "contains no drawables" );
            slog_ins.close();
            System.exit( 0 );
        }
        timeframe_root  = new TimeBoundingBox( treeroot );
        depth_max       = treeroot.getTreeNodeID().depth;
        System.out.println( "TimeWindow = " + timeframe_root
                          + " @ dmax = " + depth_max );
        timeframe_old   = new TimeBoundingBox( timeframe_root );

        // Grow to a fixed size first
        // Init depth before getTimeWindowFromStdin()
        depth           = depth_max;
        timeframe       = getTimeWindowFromStdin( timeframe_old );
        System.out.println( "TimeWindow = " + timeframe
                          + " @ d = " + depth );
        treetrunk.growInTreeWindow( treeroot, depth, timeframe );
        if ( printAll )
            System.out.println( treetrunk.toString( timeframe ) );
        else
            System.out.println( treetrunk.toStubString() );
        timeframe_old = timeframe;

        // Navigate the slog2 tree
        while (    ( timeframe = getTimeWindowFromStdin( timeframe_old ) )
                != null ) {
            System.out.println( "TimeWindow = " + timeframe
                              + " @ d = " + depth );
            if ( changedPrintAll
               ||   treetrunk.updateTimeWindow( timeframe_old, timeframe )
                  > TreeTrunk.TIMEBOX_EQUAL ) {
                if ( printAll )
                    //System.out.println( treetrunk.toFloorString( timeframe ) );
                    System.out.println( treetrunk.toString( timeframe ) );
                    // System.out.println( treetrunk.toString() );
                else
                    System.out.println( treetrunk.toStubString() );
                timeframe_old = timeframe;
                changedPrintAll = false;
            }
        }

        slog_ins.close();
    }
View Full Code Here

Examples of logformat.slog2.input.InputLog

    private static short              depth_max;

    public static final void main( String[] args )
    throws IOException
    {
        InputLog          slog_ins;
        CategoryMap       objdefs;
        TreeTrunk         treetrunk;
        TreeNode          treeroot;
        TimeBoundingBox   timeframe_old, timeframe;
        short             depth;
        String            err_msg;

        parseCmdLineArgs( args );

        slog_ins   = new InputLog( in_slog2filename );
        if ( slog_ins == null ) {
            System.err.println( "Null input logfile!" );
            System.exit( 1 );
        }
        if ( ! slog_ins.isSLOG2() ) {
            System.err.println( in_slog2filename + " is NOT SLOG-2 file!." );
            System.exit( 1 );
        }
        if ( (err_msg = slog_ins.getCompatibleHeader()) != null ) {
            System.err.print( err_msg );
            InputLog.stdoutConfirmation();
        }
        slog_ins.initialize();
        // System.out.println( slog_ins );

        long         time1, time2;
        StringBuffer timing_str;

        // Initialize the TreeTrunk with same order as in Jumpshot.
        treetrunk  = new TreeTrunk( slog_ins, Drawable.INCRE_STARTTIME_ORDER );
        treetrunk.setDebuggingEnabled( isVerbose );
        treetrunk.initFromTreeTop();
        treeroot   = treetrunk.getTreeRoot();
        if ( treeroot == null ) {
            System.out.println( "SLOG-2 file, " + in_slog2filename + " "
                              + "contains no drawables" );
            slog_ins.close();
            System.exit( 0 );
        }
        timeframe_root  = new TimeBoundingBox( treeroot );
        depth_max       = treeroot.getTreeNodeID().depth;
        System.out.println( "# TimeWindow = " + timeframe_root
                          + " @ dmax = " + depth_max );

        File         data_file = new File( in_datafilename );
        TimeBoxList  tbox_list = new TimeBoxList( data_file );
        Iterator     itr_times = tbox_list.iterator();

        timeframe = timeframe_root;
        if ( itr_times.hasNext() )
            timeframe = (TimeBoundingBox) itr_times.next();
        else {
            System.out.println( "No more timeframe in datafile "
                              + in_datafilename + ".  Exiting..." );
            System.exit( 0 );
        }

        System.out.println( "# Srolling Duration = "
                          + timeframe.getDuration() );

        // Append xmgrace description of the graph
        StringBuffer xmgrace_strbuf = new StringBuffer();
        xmgrace_strbuf.append( "@with g0\n" );
        xmgrace_strbuf.append( "@    title \"" + in_slog2filename + "\"\n" );
        xmgrace_strbuf.append( "@    legend 0.4, 0.8\n" );
        xmgrace_strbuf.append( "@    xaxis label " );
        xmgrace_strbuf.append( "\"Time location in logfile (sec).\"\n" );
        xmgrace_strbuf.append( "@    yaxis label " );
        xmgrace_strbuf.append( "\"Time taken per scroll (msec).\"\n" );
        xmgrace_strbuf.append( "@    s0 symbol 1\n" );
        xmgrace_strbuf.append( "@    s0 symbol size 0.25\n" );
        xmgrace_strbuf.append( "@    s0 line type 0\n" );
        xmgrace_strbuf.append( "@    s0 legend " );
        xmgrace_strbuf.append( "\"Duration of each scroll = "
                             + (float)timeframe.getDuration() + " sec.\"\n" );
        xmgrace_strbuf.append( "@target G0.S0\n" );
        xmgrace_strbuf.append( "@type xy\n" );
        System.out.println( xmgrace_strbuf.toString() );

        timing_str = new StringBuffer();
        // timing_str.append( timeframe + " @ d = " + depth + ": " );
        timing_str.append( timeframe.getEarliestTime() + " " );
        time1  = System.nanoTime();

        // Grow to a fixed size first
        // depth           = depth_max;
        depth           = 0;
        treetrunk.growInTreeWindow( treeroot, depth, timeframe );
        switch (print_opt) {
            case PRINT_ALL :
                System.out.println( treetrunk.toString( timeframe ) );
                break;
            case PRINT_STUB :
                System.out.println( treetrunk.toStubString() );
                break;
            case PRINT_NONE :
            default :
        }
        timeframe_old = timeframe;

        time2  = System.nanoTime();
        // timing_str.append( (1.0e-6 * (time2 - time1)) + " msec." );
        timing_str.append( (1.0e-6 * (time2 - time1)) );
        System.out.println( timing_str.toString() );

        // Navigate the slog2 tree
        while ( itr_times.hasNext() ) {
            timeframe = (TimeBoundingBox) itr_times.next();
            timing_str = new StringBuffer();
            // timing_str.append( timeframe + " @ d = " + depth + ": " );
            timing_str.append( timeframe.getEarliestTime() + " " );
            time1  = System.nanoTime();

            if (   treetrunk.updateTimeWindow( timeframe_old, timeframe )
                 > TreeTrunk.TIMEBOX_EQUAL ) {
                switch (print_opt) {
                    case PRINT_ALL :
                        // System.out.println(
                        // treetrunk.toFloorString( timeframe ) );
                        System.out.println( treetrunk.toString( timeframe ) );
                        // System.out.println( treetrunk.toString() );
                        break;
                    case PRINT_STUB :
                        System.out.println( treetrunk.toStubString() );
                        break;
                    case PRINT_NONE :
                    default :
                }
                timeframe_old = timeframe;
            }

            time2  = System.nanoTime();
            // timing_str.append( (1.0e-6 * (time2 - time1)) + " msec." );
            timing_str.append( (1.0e-6 * (time2 - time1)) );
            System.out.println( timing_str.toString() );
        }

        slog_ins.close();
    }
View Full Code Here

Examples of logformat.slog2.input.InputLog

    private static boolean        printDrawables    = true;


    public static final void main( String[] args )
    {
        InputLog         slog_ins;
        TreeDir          treedir;
        TimeBoundingBox  timeframe;
        String           err_msg;

        parseCmdLineArgs( args );

        slog_ins   = new InputLog( in_filename );
        if ( slog_ins == null ) {
            System.err.println( "Null input logfile!" );
            System.exit( 1 );
        }
        if ( ! slog_ins.isSLOG2() ) {
            System.err.println( in_filename + " is NOT SLOG-2 file!." );
            System.exit( 1 );
        }
        if ( (err_msg = slog_ins.getCompatibleHeader()) != null ) {
            System.err.print( err_msg );
            InputLog.stdoutConfirmation();
        }
        slog_ins.initialize();
        System.out.println( slog_ins.toString( printCategoryMap,
                                               printTreeDir,
                                               printLineIDMaps ) );
        if ( !printDrawables ) {
            slog_ins.close();
            System.exit( 0 );
        }

        treedir = slog_ins.getTreeDir();
        // System.out.println( treedir );

        TreeDirValue  root_dir;
        root_dir  = (TreeDirValue) treedir.get( treedir.firstKey() );
        timeframe = new TimeBoundingBox( root_dir.getTimeBoundingBox() );
        scaleTimeBounds( timeframe );

        boolean   isStartTimeOrdered;
        boolean   isIncreTimeOrdered;
        double    prev_bordertime;

        Iterator  dobj_itr;
        Drawable  dobj;
        double    dobj_bordertime;
        int       dobj_count;

        isStartTimeOrdered = dobj_order.isStartTimeOrdered();
        isIncreTimeOrdered = dobj_order.isIncreasingTimeOrdered();
        prev_bordertime    = isIncreTimeOrdered ?
                             Double.NEGATIVE_INFINITY :
                             Double.POSITIVE_INFINITY;
        dobj_count         = 0;

        dobj_itr = slog_ins.iteratorOfRealDrawables( timeframe, dobj_order,
                                                     itrTopoLevel );
        while ( dobj_itr.hasNext() ) {
            dobj            = (Drawable) dobj_itr.next();
            dobj_bordertime = dobj.getBorderTime( isStartTimeOrdered );
            if ( isIncreTimeOrdered ) {
                if ( prev_bordertime > dobj_bordertime )
                    System.out.print( "  *****  " );
            }
            else {
                if ( prev_bordertime < dobj_bordertime )
                    System.out.print( "  *****  " );
            }


            System.out.println( (++dobj_count) + ": " + dobj );
            // System.out.println( dobj + " <=> " + (++dobj_count) );
            // System.out.println( dobj  );
            // printClogArrowMessageSize( dobj );
            prev_bordertime  = dobj_bordertime;
        }

        slog_ins.close();
    }
View Full Code Here

Examples of logformat.slog2.input.InputLog

    private static short              depth_max;

    public static final void main( String[] args )
    throws java.io.IOException
    {
        InputLog          slog_ins;
        CategoryMap       objdefs;
        TreeTrunk         treetrunk;
        TreeNode          treeroot;
        TimeBoundingBox   timeframe;
        String            err_msg;

        parseCmdLineArgs( args );

        slog_ins   = new InputLog( in_filename );
        if ( slog_ins == null ) {
            System.err.println( "Null input logfile!" );
            System.exit( 1 );
        }
        if ( ! slog_ins.isSLOG2() ) {
            System.err.println( in_filename + " is NOT SLOG-2 file!." );
            System.exit( 1 );
        }
        if ( (err_msg = slog_ins.getCompatibleHeader()) != null ) {
            System.err.print( err_msg );
            InputLog.stdoutConfirmation();
        }
        slog_ins.initialize();
        // System.out.println( slog_ins );

        // Initialize the TreeTrunk with same order as in Jumpshot.
        treetrunk  = new TreeTrunk( slog_ins, Drawable.INCRE_STARTTIME_ORDER );
        treetrunk.setDebuggingEnabled( isVerbose );
        treetrunk.initFromTreeTop();
        treeroot   = treetrunk.getTreeRoot();
        if ( treeroot == null ) {
            System.out.println( "SLOG-2 file, " + in_filename + " "
                              + "contains no drawables" );
            slog_ins.close();
            System.exit( 0 );
        }
        timeframe_root  = new TimeBoundingBox( treeroot );
        depth_max       = treeroot.getTreeNodeID().depth;
        System.out.println( "# TimeWindow = " + timeframe_root
                          + " @ dmax = " + depth_max );

        File             out_file;
        FileOutputStream out_fos;
        DataOutputStream out_dos;
        Iterator         itr_times;

        System.out.println( "****  Foreward  ****" );
        out_file = new File( append_name( in_filename, "_fscroll.dat" ) );
        out_fos  = new FileOutputStream( out_file );
        out_dos  = new DataOutputStream( out_fos );
        itr_times = new ItrOfForeScrollTimes( timeframe_root );
        while ( itr_times.hasNext() ) {
             timeframe = (TimeBoundingBox) itr_times.next();
             timeframe.writeObject( out_dos );
             System.out.println( timeframe );
        }
        out_fos.close();

        System.out.println( "****  Backward  ****" );
        out_file = new File( append_name( in_filename, "_bscroll.dat" ) );
        out_fos  = new FileOutputStream( out_file );
        out_dos  = new DataOutputStream( out_fos );
        itr_times = new ItrOfBackScrollTimes( timeframe_root );
        while ( itr_times.hasNext() ) {
             timeframe = (TimeBoundingBox) itr_times.next();
             timeframe.writeObject( out_dos );
             System.out.println( timeframe );
        }
        out_fos.close();

        System.out.println( "****  Alternate Zoom  ****" );
        out_file = new File( append_name( in_filename, "_altzoom.dat" ) );
        out_fos  = new FileOutputStream( out_file );
        out_dos  = new DataOutputStream( out_fos );
        itr_times = new ItrOfAltZoomTimes( timeframe_root );
        while ( itr_times.hasNext() ) {
             timeframe = (TimeBoundingBox) itr_times.next();
             timeframe.writeObject( out_dos );
             System.out.println( timeframe );
        }
        out_fos.close();

        slog_ins.close();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.