Go to Post Robots aside, how we handle these situations, communicate with one another, resolve differences and potential conflict, and overcome obstacles defines us all as people. Remember the big picture and have fun. - Rich Kressly [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 01-08-2018, 03:44 PM
cpapplefamily's Avatar
cpapplefamily cpapplefamily is offline
Registered User
FRC #3244 (Granite City Gearheads)
Team Role: Mentor
 
Join Date: May 2015
Rookie Year: 2015
Location: Minnesota
Posts: 643
cpapplefamily is a name known to allcpapplefamily is a name known to allcpapplefamily is a name known to allcpapplefamily is a name known to allcpapplefamily is a name known to allcpapplefamily is a name known to all
what to do with the LiveWindow.add#####

The
Code:
LiveWindow.addActuator
are all deprecated and I read somewhere that the objects now handle on their own an addChild method to put it on the dashboard.
Should we delete these lines in ported code now? Seems RobotBuilder still wants to enter these lines for us.
__________________
It makes sense in my mind.


Reply With Quote
  #2   Spotlight this post!  
Unread 01-08-2018, 08:34 PM
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,954
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: what to do with the LiveWindow.add#####

The long term plan is to update RobotBuilder. However, the changes require a rearchitecture of where RobotBuilder declares items. That is why issue #86 is assigned for 2019.

If you remove the LiveWindow calls, the items will still be on the dashboard, but not grouped by subsystem. The existing LiveWindow calls make sure that they are grouped by subsystem.

Deprecated means that it may be removed in the future, but doesn't mean it doesn't work now.
Reply With Quote
  #3   Spotlight this post!  
Unread 01-18-2018, 09:44 PM
tcjinaz tcjinaz is offline
Tim
FRC #3853
Team Role: Mentor
 
Join Date: May 2011
Rookie Year: 2011
Location: Arizona
Posts: 259
tcjinaz has a spectacular aura abouttcjinaz has a spectacular aura about
Re: what to do with the LiveWindow.add#####

Please help me out. This was not enough information to work with:

public static void addChild(Sendable parent,
java.lang.Object child)

Add a child component to a component.

Parameters:
parent - parent component
child - child component
__________________
3853 Pridetronics



Reply With Quote
  #4   Spotlight this post!  
Unread 01-18-2018, 10:10 PM
SamCarlberg's Avatar
SamCarlberg SamCarlberg is offline
GRIP/Shuffleboard/WPILib. 2084 alum
FRC #2084
Team Role: Mentor
 
Join Date: Nov 2015
Rookie Year: 2010
Location: MA
Posts: 341
SamCarlberg has much to be proud ofSamCarlberg has much to be proud ofSamCarlberg has much to be proud ofSamCarlberg has much to be proud ofSamCarlberg has much to be proud ofSamCarlberg has much to be proud ofSamCarlberg has much to be proud ofSamCarlberg has much to be proud ofSamCarlberg has much to be proud ofSamCarlberg has much to be proud of
Re: what to do with the LiveWindow.add#####

addChild makes it easier to have nested components in shuffleboard, eg

Code:
- Subsystem
  - Drive base
    - Motor 1
    - Motor 2
Code:
class MySubsystem extends Subsystem {

  private final SpeedController motor1 = ...
  private final SpeedController motor2 = ...
  private final RobotDrive driveBase = ...

  public MySubsystem() {
    super("MySubsystem");
    LiveWindow.addChild(this, driveBase)
    // RobotDrive internally adds the speed controllers as children,
    // so we don't need to do anything more with LiveWindow
  }

}
This will show up in shuffleboard in the LiveWindow as a subsystem with a RobotDrive inside it, with the drive displaying the motors internally.

SmartDashboard does not support this functionality very well, however.
__________________
WPILib developer
GRIP, RobotBuilder, Shuffleboard
Reply With Quote
  #5   Spotlight this post!  
Unread 01-18-2018, 10:51 PM
tcjinaz tcjinaz is offline
Tim
FRC #3853
Team Role: Mentor
 
Join Date: May 2011
Rookie Year: 2011
Location: Arizona
Posts: 259
tcjinaz has a spectacular aura abouttcjinaz has a spectacular aura about
Re: what to do with the LiveWindow.add#####

Thank you very much! I finally stumbled into addChild, not through the JavaDocs, boo, hiss). Figuring out what to pass was not intuitively obvious to this casual observer.
__________________
3853 Pridetronics



Reply With Quote
Reply


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 05:50 AM.

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


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