http://www.youtube.com/watch?v=59ymnKUi49A
Cheers

the problem is that I'm not a FG aircraft developer or anything like it,not even close.
I will try to do something but,really not sure how to do it,simply because I have never done that. Anyway ,thanks for the tips,I think this is worth trying.
var distance = 100;
print ("Remaining distance: ", distance);
var runway_length_m = 3000;
var touchdown_point_m = 600;
var remaining_m = runway_length_m - touchdown_point_m;
print ("Remaining distance: ", remaining_m);
var groundspeed_kmh = 180;
var runway_length_m = 3000;
var touchdown_point_m = 600;
var remaining_m = runway_length_m - touchdown_point_m;
var groundspeed_mph = groundspeed_kmh * 1000;
var groundspeed_m_per_minute = groundspeed_mph / 60;
var groundspeed_m_per_second = groundspeed_m_per_minute / 60;
var remaining_secs = remaining_m / groundspeed_m_per_second;
print ("Remaining distance: ", remaining_m);
print("Remaining time: ", remaining_secs);
FGRS wrote in Fri Nov 08, 2013 6:53 pm:Hooray: No way...this coding stuff is just way out of my league.It really is but I will try to do something.
FGRS wrote:It's off topic completely,but one thing is making me mad with my FGFS . The TerraSync. On my PC and my FGFS installation,that thing is not working ,at all... When I try to enable it ,in FG Wizard,after clicking on "Run" ,all I get is this: "Access is denied" . Without enabling of it at the FG Wizard,when I go to TerraSync in FG Run,it's all disabled and ...let's call it blurred.
# this defines a new variable named sum and assigns the result of evaluating 1+3
var sum = 1 + 3;
# this prints the sum
print( sum );
FGRS wrote in Thu Nov 07, 2013 10:09 pm:Hey everyone, I would like to ask is it possible to add one interesting system to our lovely FG aircarft? The system works quite similar to the GPWS,with the difference that is counting the runway length on landing,and it call-out the reaming legth of the rw,like 400m remaining ,300m remaining and so on. In this video ,you hear it,it's quite interesting.
var on_runway = func (runway) {
var message = sprintf("On runway %s", runway.getValue());
betty_say(message);
};
var approaching_runway = func (runway) {
var message = sprintf("Approaching runway %s", runway.getValue());
betty_say(message);
};
var remaining_distance = func (distance) {
var message = sprintf("%d remaining", distance.getValue());
betty_say(message);
};
var vacated_runway = func (runway) {
var message = sprintf("Vacated runway %s", runway.getValue());
betty_say(message);
landing_announcer.stop();
takeoff_announcer.set_mode("taxi");
};
var landed_runway = func (runway) {
var message = sprintf("Touchdown on runway %s", runway.getValue());
betty_say(message);
};
var landed_outside_runway = func {
var message = sprintf("We did not land on a runway!");
copilot_say(message);
landing_announcer.stop();
takeoff_announcer.set_mode("taxi");
};
var takeoff_config = { parents: [runway.TakeoffRunwayAnnounceConfig] };
var takeoff_announcer = runway.TakeoffRunwayAnnounceClass.new(takeoff_config);
takeoff_announcer.connect("on-runway", on_runway);
takeoff_announcer.connect("approaching-runway", approaching_runway);
var landing_config = { parents: [runway.LandingRunwayAnnounceConfig] };
var landing_announcer = runway.LandingRunwayAnnounceClass.new(landing_config);
landing_announcer.connect("remaining-distance", remaining_distance);
landing_announcer.connect("vacated-runway", vacated_runway);
landing_announcer.connect("landed-runway", landed_runway);
landing_announcer.connect("landed-outside-runway", landed_outside_runway);
var make_notification_cb = func(status, action=nil) {
return func(data=nil) {
if(data != nil)
var message = sprintf("%s %s", status, data.getValue());
else
var message = status;
betty_say(message);
if(typeof(action)!='nil') action();
};
};
var stop_announcer = func() {
landing_announcer.stop();
takeoff_announcer.set_mode("taxi");
};
var takeoff_config = { parents: [runway.TakeoffRunwayAnnounceConfig] };
var takeoff_announcer = runway.TakeoffRunwayAnnounceClass.new(takeoff_config);
takeoff_announcer.connect("on-runway", make_notification_cb("On runway") );
takeoff_announcer.connect("approaching-runway", make_notification_cb("Approaching runway"));
var landing_config = { parents: [runway.LandingRunwayAnnounceConfig] };
var landing_announcer = runway.LandingRunwayAnnounceClass.new(landing_config);
landing_announcer.connect("remaining-distance", make_notification_cb("%d remaining"));
landing_announcer.connect("vacated-runway", make_notification_cb("Vacated runway", stop_announcer ));
landing_announcer.connect("landed-runway", make_notification_cb("Touchdown on runway"));
landing_announcer.connect("landed-outside-runway", make_notification_cb("We did not land on a runway!", stop_announcer ));
Hooray wrote in Fri Aug 15, 2014 2:07 pm:@onox, as a proof-of-concept this is looking pretty good - but for the sake of simplicity, you could simply use function generators to get rid of quite a bit of redundant code
make_notification_cb("%d remaining")
Users browsing this forum: No registered users and 1 guest