Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Buttons without Scheduler (http://www.chiefdelphi.com/forums/showthread.php?t=112151)

joelg236 26-01-2013 22:09

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?

Arhowk 26-01-2013 23:55

Re: Buttons without Scheduler
 
Quote:

Originally Posted by joelg236 (Post 1222535)
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

joelg236 27-01-2013 00:24

Re: Buttons without Scheduler
 
Quote:

Originally Posted by Arhowk (Post 1222582)
than get it via

Code:

SmartDashboard.getData(yourButton

SmartDashboard.getData() is no longer a method in the wpilibj. It was removed in 2013...

joelg236 27-01-2013 00:31

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.

Joe Ross 27-01-2013 01:04

Re: Buttons without Scheduler
 
I haven't tried it, but have you looked at NetworkButton?

joelg236 27-01-2013 01:06

Re: Buttons without Scheduler
 
Quote:

Originally Posted by Joe Ross (Post 1222609)
I haven't tried it, but have you looked at NetworkButton?

Never tried it either.

Arhowk 27-01-2013 10:49

Re: Buttons without Scheduler
 
Quote:

Originally Posted by joelg236 (Post 1222593)
SmartDashboard.getData() is no longer a method in the wpilibj. It was removed in 2013...

than just call it from the ITable..


All times are GMT -5. The time now is 10:09.

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