Skip to content

Commit d58cacb

Browse files
committed
bug fix for the user defined menus
1 parent 7bb29fb commit d58cacb

File tree

3 files changed

+86
-15
lines changed

3 files changed

+86
-15
lines changed

change_log.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Change Log
2+
### V1.106
3+
- bug fix for the user defined menus
24
### V1.105
35
- Initial Chinese language support. Needed a new define to be able to override the direction font
46
### V1.104
@@ -20,7 +22,7 @@
2022
- Use ``#define USE_FAST_WIFI_SCAN_METHOD true`` to use a faster scanning method
2123
- Now disconects the WiFi as a precaution on startup
2224
- Fixed a bug with use of the WiFi country codes
23-
- Realised that ``#define ENFORCED_COUNTRY_CODE true`` is not actualyl used byt the code. I will look into that later
25+
- Realised that ``#define ENFORCED_COUNTRY_CODE true`` is not actually used by the code. I will look into that later
2426

2527
### V1.97
2628
- Additional logging

config_buttons_example.h

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,18 @@
9292
// #define CHOSEN_KEYPAD_8_DISPLAY_NAME "8 Estop"
9393
// #define CHOSEN_KEYPAD_9_DISPLAY_NAME "9 Fwd"
9494

95+
// Chinese equivalent for the default keypad display names
96+
// #define CHOSEN_KEYPAD_0_DISPLAY_NAME "0 灯光"
97+
// #define CHOSEN_KEYPAD_1_DISPLAY_NAME "1 铃声"
98+
// #define CHOSEN_KEYPAD_2_DISPLAY_NAME "2 喇叭"
99+
// #define CHOSEN_KEYPAD_3_DISPLAY_NAME "3 F3"
100+
// #define CHOSEN_KEYPAD_4_DISPLAY_NAME "4 F4"
101+
// #define CHOSEN_KEYPAD_5_DISPLAY_NAME "5 下一个总计"
102+
// #define CHOSEN_KEYPAD_6_DISPLAY_NAME "6 X倍速度"
103+
// #define CHOSEN_KEYPAD_7_DISPLAY_NAME "7 倒车"
104+
// #define CHOSEN_KEYPAD_8_DISPLAY_NAME "8 急停"
105+
// #define CHOSEN_KEYPAD_9_DISPLAY_NAME "9 前进"
106+
95107
// '#" button action
96108
// By default, # will show the list above.
97109
// true = will take you to the Loco Function Labels screen directly
@@ -482,6 +494,8 @@
482494
// #include "language_deutsch.h"
483495
// Italian - Italiano
484496
// #include "language_italiano.h"
497+
498+
// Note: to use Chinese characters a suitable font must also be selected below
485499
// Chinese - 中文
486500
// #include "language_chinese.h"
487501

@@ -494,30 +508,21 @@
494508

495509
// Chinese
496510
// This font is required for Chinese characters
511+
// Uncomment it if you wish to use the Chinese translations
497512
// #define FONT_DEFAULT u8g2_font_boutique_bitmap_7x7_t_gb2312
498513

499-
// Direction Indication Font override (not recommended other than for use of Chinese characters)
500-
// Any font from here can be used https://github.com/olikraus/u8g2/wiki/fntlist8#8-pixel-height
501-
// The default one is 29px high
502-
// Uncomment if and change to the appropriate font if required
503-
// #define FONT_DIRECTION u8g2_font_neuecraft_tr
514+
// ******************
504515

505-
// Chinese
506-
// This font is required for Chinese characters
507-
508-
// *****
509-
510-
// #define FONT_DIRECTION u8g2_font_boutique_bitmap_9x9_bold_t_gb2312
511516
// Direction Indication Font override (not recommended other than for use of Chinese characters)
512517
// Any font from here can be used https://github.com/olikraus/u8g2/wiki/fntlist8#8-pixel-height
513-
// The default one is 14px high
518+
// The default one is 29px high
514519
// Uncomment if and change to the appropriate font if required
515520
// #define FONT_DIRECTION u8g2_font_neuecraft_tr
516521

517522
// Chinese
518523
// One (only) of these fonts is required for Chinese characters. The first is recommended. The second is smaller is preferred.
519-
// #define FONT_DIRECTION u8g2_font_wqy13_t_gb2312a
520524
// #define FONT_DIRECTION u8g2_font_boutique_bitmap_9x9_bold_t_gb2312
525+
// #define FONT_DIRECTION u8g2_font_wqy13_t_gb2312a
521526

522527
// *******************************************************************************************************************
523528
// Startup Commands

static.h

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const String appVersion = "v1.105";
1+
const String appVersion = "v1.106";
22
#ifndef CUSTOM_APPNAME
33
const String appName = "WiTcontroller";
44
#else
@@ -468,6 +468,70 @@ const int glyph_speed_step = 0x00d6;
468468
const int menuCharsRequired[20] = MENU_CHARS_REQUIRED;
469469
#endif
470470

471+
// catchall in case a particular menu item isn't used
472+
// must be unique and not be used for any actual menu item
473+
#ifndef MENU_ITEM_FUNCTION
474+
#define MENU_ITEM_FUNCTION 'M'
475+
#endif
476+
#ifndef MENU_ITEM_ADD_LOCO
477+
#define MENU_ITEM_ADD_LOCO 'N'
478+
#endif
479+
#ifndef MENU_ITEM_DROP_LOCO
480+
#define MENU_ITEM_DROP_LOCO 'O'
481+
#endif
482+
#ifndef MENU_ITEM_TOGGLE_DIRECTION
483+
#define MENU_ITEM_TOGGLE_DIRECTION 'P'
484+
#endif
485+
#ifndef MENU_ITEM_SPEED_STEP_MULTIPLIER
486+
#define MENU_ITEM_SPEED_STEP_MULTIPLIER 'Q'
487+
#endif
488+
#ifndef MENU_ITEM_THROW_POINT
489+
#define MENU_ITEM_THROW_POINT 'R'
490+
#endif
491+
#ifndef MENU_ITEM_CLOSE_POINT
492+
#define MENU_ITEM_CLOSE_POINT 'S'
493+
#endif
494+
#ifndef MENU_ITEM_ROUTE
495+
#define MENU_ITEM_ROUTE 'T'
496+
#endif
497+
#ifndef MENU_ITEM_TRACK_POWER
498+
#define MENU_ITEM_TRACK_POWER 'U'
499+
#endif
500+
#ifndef MENU_ITEM_EXTRAS
501+
#define MENU_ITEM_EXTRAS 'V'
502+
#endif
503+
#ifndef MENU_ITEM_FUNCTION_KEY_TOGGLE
504+
#define MENU_ITEM_FUNCTION_KEY_TOGGLE 'W'
505+
#endif
506+
#ifndef MENU_ITEM_EDIT_CONSIST
507+
#define MENU_ITEM_EDIT_CONSIST 'X'
508+
#endif
509+
#ifndef MENU_ITEM_TBA
510+
#define MENU_ITEM_TBA 'Y'
511+
#endif
512+
#ifndef MENU_ITEM_HEARTBEAT_TOGGLE
513+
#define MENU_ITEM_HEARTBEAT_TOGGLE 'Z'
514+
#endif
515+
#ifndef MENU_ITEM_INCREASE_MAX_THROTTLES
516+
#define MENU_ITEM_INCREASE_MAX_THROTTLES '{'
517+
#endif
518+
#ifndef MENU_ITEM_DECREASE_MAX_THROTTLES
519+
#define MENU_ITEM_DECREASE_MAX_THROTTLES '}'
520+
#endif
521+
#ifndef MENU_ITEM_DISCONNECT
522+
#define MENU_ITEM_DISCONNECT '['
523+
#endif
524+
#ifndef MENU_ITEM_OFF_SLEEP
525+
#define MENU_ITEM_OFF_SLEEP ']'
526+
#endif
527+
#ifndef MENU_ITEM_DROP_BEFORE_ACQUIRE_TOGGLE
528+
#define MENU_ITEM_DROP_BEFORE_ACQUIRE_TOGGLE ':'
529+
#endif
530+
#ifndef MENU_ITEM_SAVE_CURRENT_LOCOS
531+
#define MENU_ITEM_SAVE_CURRENT_LOCOS ';'
532+
#endif
533+
534+
471535
// if defined in config_buttons.h these values will be overwritten
472536
//
473537
#ifndef ENCODER_ROTATION_CLOCKWISE_IS_INCREASE_SPEED

0 commit comments

Comments
 (0)