Now you can download a copy of these docs so you can use them offline! Download now
CommandGroupEntry.cpp
00001 /*----------------------------------------------------------------------------*/ 00002 /* Copyright (c) FIRST 2011. All Rights Reserved. */ 00003 /* Open Source Software - may be modified and shared by FRC teams. The code */ 00004 /* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */ 00005 /*----------------------------------------------------------------------------*/ 00006 00007 #include "Commands/CommandGroupEntry.h" 00008 00009 #include "Commands/Command.h" 00010 00011 CommandGroupEntry::CommandGroupEntry() : 00012 m_timeout(-1.0), 00013 m_command(NULL), 00014 m_state(kSequence_InSequence) 00015 { 00016 } 00017 00018 CommandGroupEntry::CommandGroupEntry(Command *command, Sequence state) : 00019 m_timeout(-1.0), 00020 m_command(command), 00021 m_state(state) 00022 { 00023 } 00024 00025 CommandGroupEntry::CommandGroupEntry(Command *command, Sequence state, double timeout) : 00026 m_timeout(timeout), 00027 m_command(command), 00028 m_state(state) 00029 { 00030 } 00031 00032 bool CommandGroupEntry::IsTimedOut() 00033 { 00034 if (m_timeout < 0.0) 00035 return false; 00036 double time = m_command->TimeSinceInitialized(); 00037 if (time == 0.0) 00038 return false; 00039 return time >= m_timeout; 00040 }
Generated on Thu Jan 12 2012 22:35:18 for WPILibC++ by
1.7.1