2016-07-08 23:13:15 +08:00
|
|
|
#Place holder
|
|
|
|
var getTrackData = func {
|
|
|
|
# print("My test module got loaded!");
|
|
|
|
var rngM=110000.0;
|
|
|
|
var brg=0.0;
|
|
|
|
var tgt=geo.click_position();
|
|
|
|
if (tgt != nil){
|
2016-07-09 00:36:36 +08:00
|
|
|
#print ("ping");
|
2016-07-08 23:13:15 +08:00
|
|
|
var ac=geo.aircraft_position();
|
|
|
|
var distance = ac.distance_to(tgt);
|
|
|
|
var bearing =ac.course_to(tgt);
|
|
|
|
rngM=distance;
|
|
|
|
brg=bearing;
|
2016-07-09 00:36:36 +08:00
|
|
|
settimer(getTrackData, 0.1);
|
2016-07-08 23:13:15 +08:00
|
|
|
}
|
|
|
|
#
|
|
|
|
# # finally, write the result to the property tree using the setprop() call
|
|
|
|
setprop("/tracking/rng-km", rngM * 0.001);
|
|
|
|
setprop("/tracking/rng-nml", rngM * 0.000539957);
|
|
|
|
setprop("/tracking/bearing",brg);
|
|
|
|
}
|
|
|
|
|
|
|
|
setlistener("sim/signals/click", getTrackData,1);
|