View Single Post
  #3   Spotlight this post!  
Unread 24-01-2012, 22:57
grantf's Avatar
grantf grantf is offline
Software Engineering Mentor
FRC #4061 (SciBorgs)
Team Role: Engineer
 
Join Date: Feb 2007
Rookie Year: 2005
Location: Pullman, WA
Posts: 16
grantf has a spectacular aura aboutgrantf has a spectacular aura about
Re: Subsystem::GetName() Doesn't Do What I Expect

Quote:
Originally Posted by mikets View Post
It is returning a hard-coded value. Here is the source code of the function:
Code:
std::string Subsystem::GetName()
{
        return "Subsystem";
}
Indeed, I imagine that the root cause of the issue is that the code from the Subsystem::GetType() method was copy-pasted into the GetName() method - you can see the implementations are the same.

Just in case someone is interested, we implemented a workaround where we simply introduce another intermediate sub-class of Subsystem that extends the GetName() method and returns a local copy of the name. When the WPILib is updated to correct this issue, we will remove our intermediate class.
Reply With Quote