don't reset Number of Time Gates on clear task.
Add Sonar Warning configuration in config Alarm page.
By default Sonar is enabled. The configuration choice is set on startup.
It is still possible to change sonar on and off with button and custom keys, but
on startup the configuration choice will always be loaded.
Refactoring Bluetooth read/write : needed for working Task declare to external device
IMI Erixx : use hardcoded baudrate (4800) when the port doesn't support it.
Fix wrong assertion check in visualglide
Merge branch 'BthFix' of https://github.com/brunotl/LK8000
Merge branch 'TimeGates' of https://github.com/brunotl/LK8000
Add PNA_GENERIC_BTK1 2 and 3  new devices.
Only Keyboard 1 is available in device config.
Not affecting anything, because GENERIC devices have no special setups.

	modified:   ../../Header/Enums.h
	modified:   ../../Header/Modeltype.h
	modified:   ../Dialogs/dlgConfiguration.cpp
	modified:   MapWndProc.cpp
	modified:   ../LKProfileInitRuntime.cpp
	modified:   ../Models.cpp
Change task Requiered Altitude Calculation :
if next Tp Requiered Altitude is less than current tp altitude, use current tp altitude for requiered altitude...
 - AAT Task : altitude of AAT Target point is used if upper center altitude, otherwise, center altitude is used.
 - PG optimized : always use Optimized point altitude. (reverted from commit 14c9a655a322867ee7f8643a1548078100dc22e4)
Fix Glide Bar should not be visible when there is no valid start, if it is configured to show task arrival altitude.
Beside, the value shown without a valid start was wrong.
LKUtils, InputEvents: close the handles returned from CreateProcess()

MSDN says: "Handles in PROCESS_INFORMATION must be closed with
CloseHandle when they are no longer needed."

Fix for a memory leak.
LKInstall: fix memory leak
CommandLine: remove unused parameter
lk8000.rc: remove obsolete ACCELERATORS section
wcecompat/ts_string: add missing stdlib.h include

For malloc().
Common/Data/Bitmaps: shrink brush pattern to 8x8

GDI is optimised for 8x8 patterns.  This reduces the time needed for
DrawAirSpace() by 40% on a Dell Axim x51v.  Other graphics
chips/drivers may result in different speedups, however it is safe to
say that 8x8 is the best bitmap size for patterns.
Revert "Bug fix in task start/finish lines"

This reverts commit f3fe24fbed27aa6864b3ac7710c696d20591b4d1.  This
commit is obscure, bloats the code, adds CPU overhead, and is still
wrong.
Calc/TaskUtils: fix rounding error in sector angle calculation

A great circle is the shortest path on earth's surface from one point
to another.  A big problem with great circles is that while flying on
one, your bearing will change over time.

Simple example: fly from Canada north (360 degrees) until you pass the
north pole, continue flying straight until you hit Russia.  You are
now heading south (180 degrees), even though you have not turned, and
you are still flying on the very same great circle in the same
direction.

The problem that is addressed by this patch is not so drastic, however
it must be addressed or LK8000 task calculations are wrong.  I fixed
the same bug in XCSoar yesterday, and LK8000 being derived from XCSoar
has been sharing the same bug for quite a few years.

The calculation of symmetric sectors was using the wrong reference,
and therefore was using the wrong angle!

Imagine a task consisting of just one start point and a finish line.
LK8000 determines the orientation of the finish line by calculating
the angle from start to finish .... WRONG!  Wrong because it looks at
the task from the eyes of the start point, but we really want to
calculate the finish line.  Therefore, the reference must the the
finish line.

The error is small (sometimes 0.1% or less for common tasks), but
still it is significant if you miss the finish line by a few hundred
meters.

Thanks to Peter Scholz for noticing the problem and providing sample
data (http://bugs.xcsoar.org/ticket/2209).
LKInstall: fix _POLARS directory

Was appending "_POLARS" twice.
DrawTRI: don't disable in LKCOMPETITION mode

The "competition" version of LK8000 is intentionally crippled to avoid
the ban in US competitions.  This patch shall demonstrate that this is
futile, by imitating the crippled version without actually being
crippled.