Quote:
Originally Posted by DjScribbles
@jwakeman: your issue appears to be that your alternate condition was causing a new command to be created every iteration
|
Thanks for taking a look at my code. The second if condition in the actually has a 'not operator' (!) on the throwSwitch1.get() so I don't think I was creating new command every iteration.
Code:
if(throwSwitch1.get() && oi.current_interface == oi.CONFIG_FIELD_INTERFACE)
{
oi.setPitInterface();
}
if(!throwSwitch1.get() && oi.current_interface == oi.CONFIG_PIT_INTERFACE)
{
oi.setFieldInterface();
}
My code would probably be more readable if I used throwSwitch1.get() == false, throwSwitch1.get() == true. I like your suggestion of switching back and forth between pre-made commands instead of creating new every time I switch. This still leaves the issue of being able to unmap a command, i.e. have a button go from doing something to doing nothing. I suppose you could create a null command which does nothing and switch between that and the do something command.