x52test: Check device type during reset

Prior to this change, x52test would always assume that the device was an
X52Pro when resetting the device state. This change fixes that
assumption by checking the feature flags, since only the X52Pro has LED
support.

This change also updates the translation files due to the automatic
update because of line numbers being changed.
pull/22/head
nirenjan 2020-06-01 00:10:01 -07:00
parent e7d14d7b53
commit 57f7758dd1
3 changed files with 59 additions and 52 deletions

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: x52pro-linux 0.2.1\n"
"Report-Msgid-Bugs-To: https://github.com/nirenjan/x52pro-linux/issues\n"
"POT-Creation-Date: 2020-05-22 18:05-0700\n"
"POT-Creation-Date: 2020-06-01 00:08-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -90,89 +90,89 @@ msgstr ""
msgid "Unknown error %d"
msgstr ""
#: utils/test/x52_test.c:87
#: utils/test/x52_test.c:94
msgid "Test brightness scale (~ 1m)"
msgstr ""
#: utils/test/x52_test.c:88
#: utils/test/x52_test.c:95
msgid "Test LED states (~ 45s)"
msgstr ""
#: utils/test/x52_test.c:89
#: utils/test/x52_test.c:96
msgid "Test MFD string display (~ 30s)"
msgstr ""
#: utils/test/x52_test.c:90
#: utils/test/x52_test.c:97
msgid "Test MFD displays all characters (~ 2m 15s)"
msgstr ""
#: utils/test/x52_test.c:91
#: utils/test/x52_test.c:98
msgid "Test the blink and shift commands (< 10s)"
msgstr ""
#: utils/test/x52_test.c:92
#: utils/test/x52_test.c:99
msgid "Test the clock commands (~1m)"
msgstr ""
#: utils/test/x52_test.c:116
#: utils/test/x52_test.c:123
msgid ""
"x52test is a suite of tests to write to the X52 Pro device\n"
"and test the extra functionality available in the LEDs and MFD\n"
msgstr ""
#: utils/test/x52_test.c:120
#: utils/test/x52_test.c:127
msgid "These tests take roughly 6 minutes to run"
msgstr ""
#: utils/test/x52_test.c:122
#: utils/test/x52_test.c:129
msgid "Press Enter to begin the tests, press Ctrl-C to abort anytime"
msgstr ""
#: utils/test/x52_test.c:128
#: utils/test/x52_test.c:135
#, c-format
msgid "Unable to initialize X52 library: %s\n"
msgstr ""
#: utils/test/x52_test.c:143
#: utils/test/x52_test.c:150
msgid "All tests completed successfully"
msgstr ""
#: utils/test/x52_test.c:145
#: utils/test/x52_test.c:152
#, c-format
msgid "Got error %s\n"
msgstr ""
#: utils/test/x52_test.c:147
#: utils/test/x52_test.c:154
#, c-format
msgid "Received %s signal, quitting...\n"
msgstr ""
#: utils/test/x52_test.c:166
#: utils/test/x52_test.c:173
msgid ""
"These are the available tests with a description and\n"
"approximate runtime. Not specifying any tests will run\n"
"all the tests\n"
msgstr ""
#: utils/test/x52_test.c:170
#: utils/test/x52_test.c:177
msgid "List of tests:"
msgstr ""
#: utils/test/x52_test.c:220
#: utils/test/x52_test.c:227
#, c-format
msgid ""
"Usage: %s [list of tests]\n"
"\n"
msgstr ""
#: utils/test/x52_test.c:234
#: utils/test/x52_test.c:241
#, c-format
msgid ""
"Unrecognized test identifier: %s\n"
"\n"
msgstr ""
#: utils/test/x52_test.c:247
#: utils/test/x52_test.c:254
msgid "Not running any tests"
msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: x52pro-linux 0.2.1\n"
"Report-Msgid-Bugs-To: https://github.com/nirenjan/x52pro-linux/issues\n"
"POT-Creation-Date: 2020-05-22 18:05-0700\n"
"POT-Creation-Date: 2020-06-01 00:08-0700\n"
"PO-Revision-Date: 2020-05-22 13:25-0700\n"
"Last-Translator: Nirenjan Krishnan <nirenjan@gmail.com>\n"
"Language-Team: Dummy Language for testing i18n\n"
@ -90,31 +90,31 @@ msgstr "Ystemsay allcay interrupteday"
msgid "Unknown error %d"
msgstr "Unknownay erroray %d"
#: utils/test/x52_test.c:87
#: utils/test/x52_test.c:94
msgid "Test brightness scale (~ 1m)"
msgstr "Esttay ightnessbray alescay (~ 1m)"
#: utils/test/x52_test.c:88
#: utils/test/x52_test.c:95
msgid "Test LED states (~ 45s)"
msgstr "Esstay EDLay atesstay (~ 45s)"
#: utils/test/x52_test.c:89
#: utils/test/x52_test.c:96
msgid "Test MFD string display (~ 30s)"
msgstr "Esttay MFDay ingstray isplayday (~ 30s)"
#: utils/test/x52_test.c:90
#: utils/test/x52_test.c:97
msgid "Test MFD displays all characters (~ 2m 15s)"
msgstr "Esttay MFDay isplaysday allay aracterschay (~ 2m 15s)"
#: utils/test/x52_test.c:91
#: utils/test/x52_test.c:98
msgid "Test the blink and shift commands (< 10s)"
msgstr "Esttay ethay inkblay anday iftshay ommandscay (< 10s)"
#: utils/test/x52_test.c:92
#: utils/test/x52_test.c:99
msgid "Test the clock commands (~1m)"
msgstr "Esttay ethay ockclay ommandscay (~1m)"
#: utils/test/x52_test.c:116
#: utils/test/x52_test.c:123
msgid ""
"x52test is a suite of tests to write to the X52 Pro device\n"
"and test the extra functionality available in the LEDs and MFD\n"
@ -123,36 +123,36 @@ msgstr ""
"X52 Pro eviceday anday esttay ethay extray unctionalityfay\n"
"availableay inay ethay EDsLay anday FDMay\n"
#: utils/test/x52_test.c:120
#: utils/test/x52_test.c:127
msgid "These tests take roughly 6 minutes to run"
msgstr "Esethay eststay aketay oughlyray 6 inutesmay otay unray"
#: utils/test/x52_test.c:122
#: utils/test/x52_test.c:129
msgid "Press Enter to begin the tests, press Ctrl-C to abort anytime"
msgstr ""
"Esspray Enteray otay eginbay ethay eststay, esspray Ctrl-C otay abortay "
"anytimeay"
#: utils/test/x52_test.c:128
#: utils/test/x52_test.c:135
#, c-format
msgid "Unable to initialize X52 library: %s\n"
msgstr "Unableay otay initializeay X52 ibrarylay: %s\n"
#: utils/test/x52_test.c:143
#: utils/test/x52_test.c:150
msgid "All tests completed successfully"
msgstr "Allay eststay ompletedcay uccessfullysay"
#: utils/test/x52_test.c:145
#: utils/test/x52_test.c:152
#, c-format
msgid "Got error %s\n"
msgstr "Otgay erroray %s\n"
#: utils/test/x52_test.c:147
#: utils/test/x52_test.c:154
#, c-format
msgid "Received %s signal, quitting...\n"
msgstr "Eceivedray %s ignalsay, uittingqay...\n"
#: utils/test/x52_test.c:166
#: utils/test/x52_test.c:173
msgid ""
"These are the available tests with a description and\n"
"approximate runtime. Not specifying any tests will run\n"
@ -163,18 +163,18 @@ msgstr ""
"ecifyingspay anyay eststay illway unray allay ethay\n"
"eststay\n"
#: utils/test/x52_test.c:170
#: utils/test/x52_test.c:177
msgid "List of tests:"
msgstr "Istlay ofay eststay:"
#: utils/test/x52_test.c:220
#: utils/test/x52_test.c:227
#, c-format
msgid ""
"Usage: %s [list of tests]\n"
"\n"
msgstr "Usageay: %s [istlay ofay eststay]\n"
#: utils/test/x52_test.c:234
#: utils/test/x52_test.c:241
#, c-format
msgid ""
"Unrecognized test identifier: %s\n"
@ -183,7 +183,7 @@ msgstr ""
"Unrecognizeday esttay identifieray: %s\n"
"\n"
#: utils/test/x52_test.c:247
#: utils/test/x52_test.c:254
msgid "Not running any tests"
msgstr "Otnay unningray anyay eststay"

View File

@ -20,21 +20,28 @@ bool nodelay;
void test_cleanup(void)
{
libx52_set_text(dev, 0, " Saitek X52 Pro ", 16);
libx52_set_text(dev, 1, " Flight ", 16);
libx52_set_text(dev, 2, " Control System ", 16);
if (libx52_check_feature(dev, LIBX52_FEATURE_LED) == LIBX52_SUCCESS) {
/* X52 Pro */
libx52_set_text(dev, 0, " Saitek X52 Pro ", 16);
libx52_set_text(dev, 1, " Flight ", 16);
libx52_set_text(dev, 2, " Control System ", 16);
libx52_set_led_state(dev, LIBX52_LED_FIRE, LIBX52_LED_STATE_ON);
libx52_set_led_state(dev, LIBX52_LED_THROTTLE, LIBX52_LED_STATE_ON);
libx52_set_led_state(dev, LIBX52_LED_A, LIBX52_LED_STATE_GREEN);
libx52_set_led_state(dev, LIBX52_LED_B, LIBX52_LED_STATE_GREEN);
libx52_set_led_state(dev, LIBX52_LED_D, LIBX52_LED_STATE_GREEN);
libx52_set_led_state(dev, LIBX52_LED_E, LIBX52_LED_STATE_GREEN);
libx52_set_led_state(dev, LIBX52_LED_T1, LIBX52_LED_STATE_GREEN);
libx52_set_led_state(dev, LIBX52_LED_T2, LIBX52_LED_STATE_GREEN);
libx52_set_led_state(dev, LIBX52_LED_T3, LIBX52_LED_STATE_GREEN);
libx52_set_led_state(dev, LIBX52_LED_POV, LIBX52_LED_STATE_GREEN);
libx52_set_led_state(dev, LIBX52_LED_CLUTCH, LIBX52_LED_STATE_GREEN);
libx52_set_led_state(dev, LIBX52_LED_FIRE, LIBX52_LED_STATE_ON);
libx52_set_led_state(dev, LIBX52_LED_THROTTLE, LIBX52_LED_STATE_ON);
libx52_set_led_state(dev, LIBX52_LED_A, LIBX52_LED_STATE_GREEN);
libx52_set_led_state(dev, LIBX52_LED_B, LIBX52_LED_STATE_GREEN);
libx52_set_led_state(dev, LIBX52_LED_D, LIBX52_LED_STATE_GREEN);
libx52_set_led_state(dev, LIBX52_LED_E, LIBX52_LED_STATE_GREEN);
libx52_set_led_state(dev, LIBX52_LED_T1, LIBX52_LED_STATE_GREEN);
libx52_set_led_state(dev, LIBX52_LED_T2, LIBX52_LED_STATE_GREEN);
libx52_set_led_state(dev, LIBX52_LED_T3, LIBX52_LED_STATE_GREEN);
libx52_set_led_state(dev, LIBX52_LED_POV, LIBX52_LED_STATE_GREEN);
libx52_set_led_state(dev, LIBX52_LED_CLUTCH, LIBX52_LED_STATE_GREEN);
} else {
libx52_set_text(dev, 0, " Saitek ", 16);
libx52_set_text(dev, 1, " X52 Flight ", 16);
libx52_set_text(dev, 2, " Control System ", 16);
}
libx52_set_blink(dev, 0);
libx52_set_shift(dev, 0);