RE: [Flightgear-devel] property control question

2005-04-06 Thread Vivian Meazza
Josh Babcock wrote:

 The Superfort's flaps and gear are electrically powered, and the controls
 for
 both are instantaneous switches. ie. you have to hold the switch the whole
 cycle
 to keep the motor running. Can anyone think of a way to do this? For all I
 can
 tell, there's no way to tell YASim to stop the flaps anywhere but a
 detent, and
 I don't want to have to define 30 or 40 detents just to simulate a smooth
 action
 that can be stopped anywhere.

I need a similar facility for the hydraulic flaps in the Hawker Hurricane
model that I am currently constructing. I'm assuming that it will be doable
in Nasal, but I won't be looking into it until next week at the earliest.
There's also a very complicated example of using .xml to operate flaps in
seahawk-set.xml. It uses the principle of separating the movement of a lever
and the operation of the flaps, which I think is what you need. I wouldn't
recommend doing it in .xml (I did it before Nasal was available), but it
does demonstrate the principle of not using detents.

If you get there first, I'll be looking to 'borrow' the code :-).

 
 As for the gear, I suppose there is a way to get Nasal to slowly change
 gear-pos-norm and then flip the gear extended property once they are fully
 extended, but I haven't figured it out yet. 

I can't think that the B29 gear is too complicated. Again, you may need to
separate the functions of the switch and gear. The Hurricane does something
similar so ...
 
 Also, I need to find a way to
 block
 gear commands that are defined in custom keyboard.xml and joystick files,
 but
 the only way I can think of requires that I know what input is tied to the
 command, which I won't unless it happens not to be a custom setup.

I use the null property to disable unwanted standard keyboard commands.
Again, an example in seahawk-set.xml.





___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] property control question

2005-04-06 Thread Martin Spott
Josh Babcock wrote:
 The Superfort's flaps and gear are electrically powered, and the controls for 
 both are instantaneous switches. ie. you have to hold the switch the whole 
 cycle 
 to keep the motor running.

BTW, if someone attempts to create a C150 he'll hit the same obstacle.
A general solution might be worthwhile,

Martin.
-- 
 Unix _IS_ user friendly - it's just selective about who its friends are !
--

___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] property control question

2005-04-06 Thread Erik Hofman
Martin Spott wrote:
Josh Babcock wrote:
The Superfort's flaps and gear are electrically powered, and the controls for 
both are instantaneous switches. ie. you have to hold the switch the whole cycle 
to keep the motor running.

BTW, if someone attempts to create a C150 he'll hit the same obstacle.
A general solution might be worthwhile,
The solution provided by Melchior is the way to go.
Erik
___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] property control question

2005-04-06 Thread Andy Ross
Josh Babcock wrote:
 The Superfort's flaps and gear are electrically powered, and the
 controls for both are instantaneous switches. ie. you have to hold the
 switch the whole cycle to keep the motor running. Can anyone think of
 a way to do this? For all I can tell, there's no way to tell YASim to
 stop the flaps anywhere but a detent

YASim takes control input as a floating point number that can have any
value you want.  It doesn't stop the flaps except to seek to the
number you give it.  The transition-time feature is more or less
deprecated in favor of Nasal's interpolate() function.

Take a look at the Nasal code in controls.nas (especially slewProp(),
which looks like exactly what you want) and please ask nicely if you
have any questions. :)

 As for the gear, I suppose there is a way to get Nasal to slowly
 change gear-pos-norm and then flip the gear extended property once
 they are fully extended, but I haven't figured it out yet

Same deal.  If the hard-coded transition-time semantics aren't what
you want, you can do anything else with Nasal.

 Also, I need to find a way to block gear commands that are defined
 in custom keyboard.xml and joystick files,

Blocking user customizations is almost guaranteed to be a disaster.
What is this for?

Andy

___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] property control question

2005-04-06 Thread Andy Ross
Erik Hofman wrote:
 Martin Spott wrote:
  Josh Babcock wrote:
   The Superfort's flaps and gear are electrically powered, and the
   controls for both are instantaneous switches. ie. you have to hold
   the switch the whole cycle to keep the motor running.
 
  BTW, if someone attempts to create a C150 he'll hit the same obstacle.
  A general solution might be worthwhile,

 The solution provided by Melchior is the way to go.

Actually, since this is an instantaneous change (i.e. you want to move
it this frame, but don't know how much longer the key or button will
be held down), I'd suggest something more along the lines of
slewProp() in controls.nas.

This function slews a property value at a constant rate
(i.e. offsets it by an amount proportional to the current frame
rate) every time it is called.  Docs are in the file:

##
# Slews a property smoothly, without dependence on the simulator
# frame rate.  The first argument is the property name.  The second is
# a rate, in units per second.  NOTE: this modifies the property for
# the current frame only; it is intended to be called by bindings
# which repeat each frame.  If you want to cause motion over time, see
# interpolate().
#
slewProp = func {
prop = arg[0];
delta = arg[1] * getprop(/sim/time/delta-realtime-sec);
setprop(prop, getprop(prop) + delta);
}

Andy

___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] property control question

2005-04-06 Thread Josh Babcock
Andy Ross wrote:
Josh Babcock wrote:

Blocking user customizations is almost guaranteed to be a disaster.
What is this for?
Andy
Well, if someone has some button on their joystick defined to cycle the gear, 
and I change g/G from cycling the gear to slewing the position then I see 
potential conflicts. If they hit their custom button (which I would assume is 
their preference) they get the old behavior, but then if they use the standard 
g/G keys, they get the new behavior. What happens if they put the gear halfway 
down and then git the joystick button to cycle the gear? I have no way of 
knowing because I don't know how they implemented their custom command.

I don't want to block the custom commands, I want to make sure that they have 
the same behavior as the standard ones, which I will have to change to get the 
kind of historical accuracy that I want. I will have to experiment with all the 
suggestions I have gotten (thanks everyone!) before I will really understand 
what the potential problems with each solution are.

Josh
___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


[Flightgear-devel] property control question

2005-04-05 Thread Josh Babcock
The Superfort's flaps and gear are electrically powered, and the controls for 
both are instantaneous switches. ie. you have to hold the switch the whole cycle 
to keep the motor running. Can anyone think of a way to do this? For all I can 
tell, there's no way to tell YASim to stop the flaps anywhere but a detent, and 
I don't want to have to define 30 or 40 detents just to simulate a smooth action 
that can be stopped anywhere.

As for the gear, I suppose there is a way to get Nasal to slowly change 
gear-pos-norm and then flip the gear extended property once they are fully 
extended, but I haven't figured it out yet. Also, I need to find a way to block 
gear commands that are defined in custom keyboard.xml and joystick files, but 
the only way I can think of requires that I know what input is tied to the 
command, which I won't unless it happens not to be a custom setup.

Josh
___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d