src/auto/Replayer.java
public boolean replay(String sFileName)
    {                
        if(!m_bRepStarted)
        {
            Output.println(Config.IdReplayer, "Replay Initiated");
            m_joy.setAutoMode(true);
            m_sFileName = sFileName;
            m_joyDataList = readAllData();
            m_joyCurrentData = m_joyDataList[m_iCounter++];
            m_tmReplay.start();
            m_bRepStarted = true;
        }

        if(!m_bDoneReplay)
        {            
            if(m_tmReplay.get() >= m_joyCurrentData.getTimer())    // If true it means we want new data
                m_joyCurrentData.setValues(m_joyDataList[m_iCounter++]);
            
            m_joy.setXY(m_joyCurrentData.getX(), m_joyCurrentData.getY());
            m_joy.setButton(Config.btEjector, m_joyCurrentData.getEjector());

            if(m_iCounter < 0 || m_iCounter >= m_iMax)   // If true it means we've read all data from file
                m_bDoneReplay = true;
            
            Output.println(Config.IdReplayer, "Left: " + m_joyCurrentData.getX() + ", Right: " + m_joyCurrentData.getY() + " Ejector: " + m_joy.gotPressed(Config.btEjector)); 
        }

        else
        {
            m_joy.setXY(0, 0);
            m_tmReplay.stop();
            m_tmReplay.reset();
            Output.println(Config.IdReplayer, "Replay Ended");
        }
        
        return m_bDoneReplay;
    }
/**
     * Replays data from desired file.
     * @param sFileName
     */
Replays data from desired file.
Replays data from desired file .
public boolean replay(String sFileName)
    {                
        if(!m_bRepStarted)
        {
            Output.println(Config.IdReplayer, "Replay Initiated");
            m_joy.setAutoMode(true);
            m_sFileName = sFileName;
            m_joyDataList = readAllData();
            m_joyCurrentData = m_joyDataList[m_iCounter++];
            m_tmReplay.start();
            m_bRepStarted = true;
        }
        if(!m_bDoneReplay)
        {            
            if(m_tmReplay.get() >= m_joyCurrentData.getTimer())    
                m_joyCurrentData.setValues(m_joyDataList[m_iCounter++]);
            m_joy.setXY(m_joyCurrentData.getX(), m_joyCurrentData.getY());
            m_joy.setButton(Config.btEjector, m_joyCurrentData.getEjector());
            if(m_iCounter < 0 || m_iCounter >= m_iMax)   
                m_bDoneReplay = true;
            Output.println(Config.IdReplayer, "Left: " + m_joyCurrentData.getX() + ", Right: " + m_joyCurrentData.getY() + " Ejector: " + m_joy.gotPressed(Config.btEjector)); 
        }
        else
        {
            m_joy.setXY(0, 0);
            m_tmReplay.stop();
            m_tmReplay.reset();
            Output.println(Config.IdReplayer, "Replay Ended");
        }
        return m_bDoneReplay;
    }
public boolean replay ( String sFileName ) { if ( ! m_bRepStarted ) { Output . println ( Config . IdReplayer , "Replay Initiated" ) ; m_joy . setAutoMode ( true ) ; m_sFileName = sFileName ; m_joyDataList = readAllData ( ) ; m_joyCurrentData = m_joyDataList [ m_iCounter ++ ] ; m_tmReplay . start ( ) ; m_bRepStarted = true ; } if ( ! m_bDoneReplay ) { if ( m_tmReplay . get ( ) >= m_joyCurrentData . getTimer ( ) ) m_joyCurrentData . setValues ( m_joyDataList [ m_iCounter ++ ] ) ; m_joy . setXY ( m_joyCurrentData . getX ( ) , m_joyCurrentData . getY ( ) ) ; m_joy . setButton ( Config . btEjector , m_joyCurrentData . getEjector ( ) ) ; if ( m_iCounter < 0 || m_iCounter >= m_iMax ) m_bDoneReplay = true ; Output . println ( Config . IdReplayer , "Left: " + m_joyCurrentData . getX ( ) + ", Right: " + m_joyCurrentData . getY ( ) + " Ejector: " + m_joy . gotPressed ( Config . btEjector ) ) ; } else { m_joy . setXY ( 0 , 0 ) ; m_tmReplay . stop ( ) ; m_tmReplay . reset ( ) ; Output . println ( Config . IdReplayer , "Replay Ended" ) ; } return m_bDoneReplay ; }
Replays data from desired file.
Replays data from desired file .
// If true it means we want new data // If true it means we've read all data from file