From: Siraaj Khandkar Date: Thu, 30 Jul 2015 17:32:36 +0000 (-0400) Subject: Unpack example records. X-Git-Url: https://git.xandkar.net/?p=erlang-x-plane-data.git;a=commitdiff_plain;h=8892b9afe9757950420b83fb56a8df1a5a30bf7f Unpack example records. --- diff --git a/README.md b/README.md index 73d7f93..16c0a3d 100644 --- a/README.md +++ b/README.md @@ -20,10 +20,37 @@ main(Port) -> % The types I've not yet labeled are in the format specified by % x_plane_datum:anonymous() and can be looked-up by their index number. - % Find a labeled data type - {some, #x_plane_datum_speeds{}} = hope_kv_list:get(XPlaneData, speeds), - {some, #x_plane_datum_pitch_roll_heading{}} = hope_kv_list:get(XPlaneData, pitch_roll_heading), - {some, #x_plane_datum_lat_lon_alt{}} = hope_kv_list:get(XPlaneData, lat_lon_alt), + % Find labeled data types + {some, #x_plane_datum_speeds + { vind_kias = VindKias + , vind_keas = VindKeas + , vtrue_ktas = VtrueKtas + , vtrue_ktgs = VtrueKtgs + , vind_mph = VindMph + , vtrue_mphas = VtrueMphas + , vtrue_mphgs = VtrueMphgs + }, + } = hope_kv_list:get(XPlaneData, speeds), + + {some, #x_plane_datum_pitch_roll_heading + { pitch_deg = PitchDeg + , roll_deg = RollDeg + , hding_true = HdingTrue + , hding_mag = HdingMag + }, + } = hope_kv_list:get(XPlaneData, pitch_roll_heading), + + {some, #x_plane_datum_lat_lon_alt + { lat_deg = LatDeg + , lon_deg = LonDeg + , alt_ftmsl = AltFtmsl + , alt_ftagl = AltFtagl + , on_runwy = OnRunwy + , alt_ind = AltInd + , lat_south = LatSouth + , lat_west = LatWest + }, + } = hope_kv_list:get(XPlaneData, lat_lon_alt), % Find an unlabled data type {some, {10, V1, V2, V3, V4, V5, V6, V7, V8}} = hope_kv_list:get(XPlaneData, 10),