4 XCSoar Glide Computer - http://www.xcsoar.org/
5 Copyright (C) 2000-2013 The XCSoar Project
6 A detailed list of copyright holders can be found in the file "AUTHORS".
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 #include "Util/Macros.hpp"
26 #include "Language/Language.hpp"
28 static const TCHAR
*const severity_strings
[] = {
31 N_("Reduced functionality"),
36 FlarmError::ToString(Severity severity
)
38 unsigned i
= (unsigned)severity
;
39 return i
< ARRAY_SIZE(severity_strings
)
44 static constexpr struct {
45 FlarmError::Code code
;
48 { FlarmError::Code::FIRMWARE_TIMEOUT
, N_("Firmware timeout") },
49 { FlarmError::Code::POWER
, N_("Power") },
50 { FlarmError::Code::GPS_COMMUNICATION
, N_("GPS communication") },
51 { FlarmError::Code::GPS_CONFIGURATION
, N_("GPS configuration") },
52 { FlarmError::Code::RF_COMMUNICATION
, N_("RF communication") },
53 { FlarmError::Code::COMMUNICATION
, N_("Communication") },
54 { FlarmError::Code::FLASH_MEMORY
, N_("Flash memory") },
55 { FlarmError::Code::PRESSURE_SENSOR
, N_("Pressure sensor") },
56 { FlarmError::Code::OBSTACLE_DATABASE
, N_("Obstacle database") },
57 { FlarmError::Code::FLIGHT_RECORDER
, N_("Flight recorder") },
58 { FlarmError::Code::TRANSPONDER_RECEIVER
,
59 N_("Transponder receiver") },
60 { FlarmError::Code::OTHER
, N_("Other") },
61 { FlarmError::Code::OTHER
, nullptr }
65 FlarmError::ToString(Code code
)
67 for (auto i
= error_strings
; i
->string
!= nullptr; ++i
)