Go to Post However, I am a firm believer in the theory that if you are pushing with a mecanum wheeled robot you are doing it wrong. - Andrew Schreiber [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 07-03-2014, 20:50
Tedi Tedi is offline
Registered User
FRC #4343
 
Join Date: Mar 2014
Location: Aurora
Posts: 3
Tedi is an unknown quantity at this point
Can isTimedOut() be used in a command group?

Hey guys,
So I was wondering if in the constructor of a command group (where addParallel and addSequential are added), can I also add setTimeout(x); and then check within the same command group if it has timed out? I am asking because I am unsure if setting a timeout inside a command group actually works or if it's only for commands.

Example:

Code:
public class cmdg extends CommandGroup {
    boolean A = false;
    public cmdg() {
        setTimeout(x);
        addSequential(command_here, x);
        if (isTimedOut()) {
            A = false;
        } else {
            A = true;
        }
        if (A) {
            //stuff here
        } else {
            //stuff here
        }
        
        
        
    }
}
Thanks,
Tedi

Last edited by Tedi : 07-03-2014 at 20:52.
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 18:11.

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