Updates from upstream (firstforge): NetworkTable handles deleted values, CAN has a new minimum version, ...
git-svn-id: https://robotics.mvla.net/svn/frc971/2013/trunk/src@4155 f308d9b7-e957-4cde-b6ac-9a88185e7312
diff --git a/azaleasource/WPILibCProgramming/trunk/WPILib/Commands/Subsystem.cpp b/azaleasource/WPILibCProgramming/trunk/WPILib/Commands/Subsystem.cpp
index dfd559c..c0d8c62 100644
--- a/azaleasource/WPILibCProgramming/trunk/WPILib/Commands/Subsystem.cpp
+++ b/azaleasource/WPILibCProgramming/trunk/WPILib/Commands/Subsystem.cpp
@@ -22,6 +22,7 @@
m_name = name;
Scheduler::GetInstance()->RegisterSubsystem(this);
m_table = NULL;
+ m_currentCommandChanged = true;
}
/**
* Initialize the default command for this subsystem
@@ -106,6 +107,7 @@
void Subsystem::SetCurrentCommand(Command *command)
{
m_currentCommand = command;
+ m_currentCommandChanged = true;
}
/**
@@ -124,17 +126,20 @@
*/
void Subsystem::ConfirmCommand()
{
- if (m_table != NULL)
- {
- if (m_currentCommand != NULL)
+ if (m_currentCommandChanged) {
+ if (m_table != NULL)
{
- m_table->PutBoolean("hasCommand", true);
- m_table->PutString("command", m_currentCommand->GetName());
+ if (m_currentCommand != NULL)
+ {
+ m_table->PutBoolean("hasCommand", true);
+ m_table->PutString("command", m_currentCommand->GetName());
+ }
+ else
+ {
+ m_table->PutBoolean("hasCommand", false);
+ }
}
- else
- {
- m_table->PutBoolean("hasCommand", false);
- }
+ m_currentCommandChanged = false;
}
}