[Plib-devel] Re: control abstraction, continued (ad infinitum)
Brought to you by:
sjbaker
From: James T. <jm...@dc...> - 2000-06-01 19:09:44
|
Some more points that have come up: the need for controls with both analog inputs and digital buttons. Hence I have a new input type, ctlDual, which clan be used as follows: ctlDual *t = new ctlDual("Throttle", 0.1, 0.05, CTL_JS_0, 3); 2 parameter is the 'step size', explained below 3 param is a threshold, also explained below then: t->addDigital(new ctlDigital("100% Throttle", CTL_KEYBOARD, '#'), CTL_DUAL_MAX); t->addDigital(new ctlDigital("Increase Throttle", CTL_KEYBOARD, '+'), CTL_DUAL_INC); The current 'ops' for dual inputs are centre, min, max, increase and decrease. A digital source can be bound to any of these operations. Increase and decrease will use the specified step size. (10% in this example). The threshold specifies what change is required in the analog source before it 'overrides' the previous digital setting. So if full throttle is set, the analog source must change by > 5% before becoming 'active' again. There also needs to be a flag to determine whether the analog axis is rounded to step values or not. One other suggested change is that digital inputs drive callbacks rather than being polled; this makes a lot of sense I suspect, so I will add a setCallback method and alternate constructor to ctlDigital. I don't think callback behaviour makes sense for analog inputs, but if people disagree then it could be included. As ever feedback is appreciated especially from non-FG users of PLIB, who I suspect are all looking on in amazement and thinking 'when would I *ever* use this junk' :-) James Turner |