Go to Post Every single person on the team, read the manual, cover to cover, NO skimming. Do not give the task of knowing the rules to a few people. Do not pass go, do not collect $200, READ THE MANUAL. - RoboChair [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
  #3   Spotlight this post!  
Unread 22-02-2015, 12:59
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,717
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Handling Exceptional Cases in a CommandGroup

What about something like this?

Code:
private Command2 timeoutCommand  = new Command2();

public SomethingCommandGroup() {
     addSequential(new Command1());
     addSequential(timeoutCommand, 5);
     addSequential(new Command3());

}

protected boolean isFinished() {
     return super.isFinished()
          || timeoutCommand.isTimedOut();
}
Since a CommandGroup is still a Command you can override isFinished() to finish if a certain command or several have timed out.

I am unsure if the timed out command will need reinitialized or not. My gut says no.

Last edited by notmattlythgoe : 22-02-2015 at 13:10.
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 22:27.

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