Go to Post Courtesy is the key. - Tom Schindler [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 24-01-2012, 20:33
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
Subsystem::GetName() Doesn't Do What I Expect

Here's some code and expected versus actual results. I'm confident that WPILib would benefit from an update.

The Test Code
Code:
MyRobot::RobotInit()
{
    //
    // The class called "MySubsystem" derives from Subsystem and calls the
    //  parent class constructor, with a Subsystem name of "MySusbsystem"
    //
    Subsystem* p_subsystem = new MySubsystem();

    //
    // This code prints the name of the newly-created subsystem to the
    //  DriverStationLCD.
    //
    DriverStationLCD* p_driver_station_lcd = DriverStationLCD::GetInstance();
    p_driver_station_lcd->PrintfLine(DriverStationLCD::kUser_Line1, "%s", p_subsystem->GetName().c_str() );
    p_driver_station_lcd->UpdateLCD();
}
The Expected Result
After I compile this code and download it to the cRIO, I expect the DriverStationLCD to have a single line of text showing "MySubsystem".

The Actual Result
Instead, I see "Subsystem". If I change the name of the passed-in subsystem name to anything else, I always see "Subsystem" as the returned string.

My Suspicion
Subsystem::GetName() is returning a hard-coded value and not the user-provided name.

Please provide an update to the WPILib that solves this problem
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 17:42.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi