Go to Post Where does one get a henchman? I have a pretty good group of minions, but have always wanted a henchman. - IKE [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 26-01-2013, 22:09
joelg236 joelg236 is offline
4334 Retired Mentor & Alumni
AKA: Joel Gallant
no team
Team Role: Mentor
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Calgary
Posts: 733
joelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond repute
Buttons without Scheduler

I need to implement functionality with buttons on the SmartDashboard which do things to the robot. I do not want to use Scheduler, since we are not using command-based. Is there a way to do this without making a smartdashboard widget and hack network tables backwards?
__________________
All opinions are my own.
Reply With Quote
  #2   Spotlight this post!  
Unread 26-01-2013, 23:55
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 542
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: Buttons without Scheduler

Quote:
Originally Posted by joelg236 View Post
I need to implement functionality with buttons on the SmartDashboard which do things to the robot. I do not want to use Scheduler, since we are not using command-based. Is there a way to do this without making a smartdashboard widget and hack network tables backwards?
make a class that implements Sendable

and put in this data somewhere

Code:
    public String getSmartDashboardType(){
        return "Button";
    }
    private ITable table;
    public void initTable(ITable table){
        this.table = table;
        if(table!=null){
            table.putBoolean("pressed" false);
        }
    }
    
    /**
     * {@inheritDoc}
     */
    public ITable getTable(){
        return table;
    }
to check if the button is currently pressed on the dashboard, just use

Code:
table.getBoolean("pressed");
(not 100% sure about this but thats how Trigger does it)

e/ No. send it to the dashboard via

Code:
SmartDashboard.putData(yourButton)
than get it via

Code:
SmartDashboard.getData(yourButton
Reply With Quote
  #3   Spotlight this post!  
Unread 27-01-2013, 00:24
joelg236 joelg236 is offline
4334 Retired Mentor & Alumni
AKA: Joel Gallant
no team
Team Role: Mentor
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Calgary
Posts: 733
joelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond repute
Re: Buttons without Scheduler

Quote:
Originally Posted by Arhowk View Post
than get it via

Code:
SmartDashboard.getData(yourButton
SmartDashboard.getData() is no longer a method in the wpilibj. It was removed in 2013...
__________________
All opinions are my own.
Reply With Quote
  #4   Spotlight this post!  
Unread 27-01-2013, 00:31
joelg236 joelg236 is offline
4334 Retired Mentor & Alumni
AKA: Joel Gallant
no team
Team Role: Mentor
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Calgary
Posts: 733
joelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond repute
Re: Buttons without Scheduler

We've decided to not bother with it because the feature really isn't needed, but thank you for helping anyway.
__________________
All opinions are my own.
Reply With Quote
  #5   Spotlight this post!  
Unread 27-01-2013, 01:04
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,561
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: Buttons without Scheduler

I haven't tried it, but have you looked at NetworkButton?
Reply With Quote
  #6   Spotlight this post!  
Unread 27-01-2013, 01:06
joelg236 joelg236 is offline
4334 Retired Mentor & Alumni
AKA: Joel Gallant
no team
Team Role: Mentor
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Calgary
Posts: 733
joelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond repute
Re: Buttons without Scheduler

Quote:
Originally Posted by Joe Ross View Post
I haven't tried it, but have you looked at NetworkButton?
Never tried it either.
__________________
All opinions are my own.
Reply With Quote
  #7   Spotlight this post!  
Unread 27-01-2013, 10:49
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 542
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: Buttons without Scheduler

Quote:
Originally Posted by joelg236 View Post
SmartDashboard.getData() is no longer a method in the wpilibj. It was removed in 2013...
than just call it from the ITable..
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 10:09.

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