/*
!=======================================================================
!
!  PROGRAM  PHASE-Viewer  (PHASE-Viewer 2014.01 ver.3.3.0)
!
!  Created on ----
!  AUTHOR(S): KOGA, Junichiro
!  File : OutputParserTest.java
!  
!  Contact address :  Phase System Consortium
!                     E-mail: phase_system@nims.go.jp URL https://azuma.nims.go.jp
!
!
!   Since 2002, this program set had been intensively developed as a part of the following 
!  national projects supported by the Ministry of Education, Culture, Sports, Science and
!  Technology (MEXT) of Japan; "Frontier Simulation Software for Industrial Science
!  (FSIS)" from 2002 to 2005, "Revolutionary Simulation Software (RSS21)" from 2006 to
!  2008. "Research and Development of Innovative Simulation Software (RISS)" from 2008
!  to 2013. These projects is lead by the Center for Research on Innovative Simulation 
!  Software (CISS), the Institute of Industrial Science (IIS), the University of Tokyo.
!   Since 2013, this program set has been further developed centering on PHASE System
!  Consortium. 
!   The activity of development of this program set has been supervised by Takahisa Ohno.
!
!=======================================================================
 */
package ciss.phase_viewer.common;

import java.util.Vector;

public class OutputParserTest {
    public static void main(String args[]) {

        /* nfenf parser */
        /*
         * NfenfParser nfenfParser = new NfenfParser(args[0]);
         * nfenfParser.readFile(); System.out.println(nfenfParser.getHeader());
         * System.out.print("#! "); for ( int
         * i=0;i<nfenfParser.getNumColumns();i++ ) {
         * System.out.print(nfenfParser.getColumnName().get(i)+" "); }
         * System.out.print(OutputParser.CR); for ( int
         * i=0;i<nfenfParser.getNumRows();i++ ) { Vector vector = (Vector)
         * (nfenfParser.getDataRow()).get(i); for ( int
         * j=0;j<nfenfParser.getNumColumns();j++ ) {
         * System.out.print(vector.get(j)+" "); }
         * System.out.print(OutputParser.CR); }
         */

        /* nfdynm parser */
        /*
         * NfdynmParser nfdynmParser = new NfdynmParser(args[0]);
         * nfdynmParser.readFile(); System.out.print(nfdynmParser.getHeader());
         * System.out.print("#! "); for ( int
         * i=0;i<nfdynmParser.getNumColumns();i++ ) {
         * System.out.print(nfdynmParser.getColumnName().get(i)+" "); }
         * System.out.print(OutputParser.CR); for ( int
         * i=0;i<nfdynmParser.getNumRows();i++ ) { Vector vector = (Vector)
         * (nfdynmParser.getDataRow()).get(i); for ( int
         * j=0;j<nfdynmParser.getNumColumns();j++ ) {
         * System.out.print(vector.get(j)+" "); }
         * System.out.print(OutputParser.CR); }
         */

        /* nfenergy parser */
        /*
         * NfenergyParser nfenergyParser = new NfenergyParser(args[0]);
         * nfenergyParser.readFile();
         * System.out.print(nfenergyParser.getHeader());
         * System.out.print("#! "); for ( int
         * i=0;i<nfenergyParser.getNumColumns();i++ ) { // for ( int i=0;i<4;i++
         * ) { // System.out.print(nfenergyParser.getColumnName().get(i)+" ");
         * // } System.out.print(OutputParser.CR); for ( int
         * i=0;i<nfenergyParser.getNumRows();i++ ) { Vector vector = (Vector)
         * (nfenergyParser.getDataRow()).get(i); for ( int
         * j=0;j<nfenergyParser.getNumColumns();j++ ) {
         * System.out.print(vector.get(j)+" "); }
         * System.out.print(OutputParser.CR); } }
         */

        /*
         * Output000Parser outputParser = new Output000Parser(args[0],
         * Output000Parser.TYPE_ENERGY); outputParser.setTotalEnergy(true);
         * outputParser.setKI(true); outputParser.setHA(true);
         * outputParser.setXC(true); outputParser.setLO(true);
         * outputParser.setNL(true); outputParser.setEW(true);
         * outputParser.setPC(true); outputParser.calculateNumColumns();
         * 
         * outputParser.readFile(); //
         * System.out.println("numColumns: "+outputParser.getNumColumns()); //
         * System.out.println("numRows: "+outputParser.getNumRows()); int
         * numColumns = outputParser.getNumColumns(); int numRows =
         * outputParser.getNumRows(); int i,j;
         * 
         * Vector col = outputParser.getColumnName();
         * System.out.print(outputParser.getHeader()); System.out.print("#! ");
         * for ( i=0;i<numColumns;i++ ) { System.out.print(col.get(i)+" "); }
         * System.out.print(OutputParser.CR); for ( i=0;i<numRows;i++ ) { Vector
         * vector = (Vector) (outputParser.getDataRow()).get(i); for (
         * j=0;j<numColumns;j++ ) { System.out.print(vector.get(j)+" "); }
         * System.out.print(OutputParser.CR); }
         */

        Output000Parser outputParser = new Output000Parser(args[0],
                Output000Parser.TYPE_ENERGY);
        outputParser.setTotalEnergy(true);
        outputParser.setEdeltb(true);
        outputParser.calculateNumColumns();
        outputParser.readFile();

        int numColumns = outputParser.getNumColumns();
        int numRows = outputParser.getNumRows();
        int i, j;

        Vector col = outputParser.getColumnName();
        System.out.print(outputParser.getHeader());

        System.out.print("#! ");
        for (i = 0; i < numColumns; i++) {
            System.out.print(col.get(i) + " ");
        }
        System.out.print(OldOutputParser.CR);
        for (i = 0; i < numRows; i++) {
            Vector vector = (Vector) (outputParser.getDataRow()).get(i);
            for (j = 0; j < numColumns; j++) {
                System.out.print(vector.get(j) + " ");
            }
            System.out.print(OldOutputParser.CR);
        }
    }
}
