Now you can download a copy of these docs so you can use them offline! Download now
CommandGroupEntry.cpp
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) FIRST 2011. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
5 /*----------------------------------------------------------------------------*/
6 
7 #include "Commands/CommandGroupEntry.h"
8 
9 #include "Commands/Command.h"
10 
11 CommandGroupEntry::CommandGroupEntry() :
12  m_timeout(-1.0),
13  m_command(NULL),
14  m_state(kSequence_InSequence)
15 {
16 }
17 
18 CommandGroupEntry::CommandGroupEntry(Command *command, Sequence state) :
19  m_timeout(-1.0),
20  m_command(command),
21  m_state(state)
22 {
23 }
24 
25 CommandGroupEntry::CommandGroupEntry(Command *command, Sequence state, double timeout) :
26  m_timeout(timeout),
27  m_command(command),
28  m_state(state)
29 {
30 }
31 
32 bool CommandGroupEntry::IsTimedOut()
33 {
34  if (m_timeout < 0.0)
35  return false;
36  double time = m_command->TimeSinceInitialized();
37  if (time == 0.0)
38  return false;
39  return time >= m_timeout;
40 }
double TimeSinceInitialized()
Definition: Command.cpp:127

Generated on Sat Apr 26 2014 12:26:45 for WPILibC++ by doxygen 1.8.6