--WA28 compensated variometer, copied/adapted from Laminar Research ASK21 model.

----------------------------------- LOCATE AND CREATE DATAREFS OR COMMANDS -----------------------------------
acceleration_kts_sec = find_dataref("sim/cockpit2/gauges/indicators/airspeed_acceleration_kts_sec_pilot")
total_energy_fpm = find_dataref("sim/cockpit2/gauges/indicators/total_energy_fpm")
-- vvi_fpm = find_dataref("sim/cockpit2/gauges/indicators/vvi_fpm_pilot")

vvi_ms_compensated = create_dataref("custom/WA28/vvi_ms_compensated","number") -- the compensated vario in meter/sec



--------------------------------- REGULAR RUNTIME ---------------------------------

function do_stuff()

	-- (TOTALENERGY IN M/S) + (A REDUCED FACTOR OF THE ACCEL/DECEL VECTOR)
	vvi_ms_compensated = (total_energy_fpm * 0.00508) + (acceleration_kts_sec * 0.25)
	
end

function after_physics()
	do_stuff()	
end

function after_replay()
	do_stuff()
end