1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-25 17:25:13 +03:00

3djc/horus fine tune mixers setup (#3643)

* Optimize display for mixer setup

* Make mixer setup screen full icons

* - Display flighmode in SMLSIZE
- Add icon for it
- Space out things given then gain space

* Introduce SLOW_BLINK (half rate BLINK)
WARNING : code for both DS and single icon 'DS' is here, need cleaning before PR after choice is made

* Introduce snail and hourglass icons
Fine tuning

* Move to single icon column for DS (3 possibles icons)
Space things a little

* delayslow icon

* delayslow icon
This commit is contained in:
3djc 2016-07-04 19:54:50 +02:00 committed by Bertrand Songis
parent 646170fe19
commit 9237d6af63
20 changed files with 105 additions and 15 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 891 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 755 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 815 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 891 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 755 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 815 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 B

View file

@ -193,3 +193,11 @@ BitmapBuffer * mixerSetupOutputBitmap = NULL;
BitmapBuffer * mixerSetupAddBitmap = NULL;
BitmapBuffer * mixerSetupMultiBitmap = NULL;
BitmapBuffer * mixerSetupReplaceBitmap = NULL;
BitmapBuffer * mixerSetupLabelBitmap = NULL;
BitmapBuffer * mixerSetupCurveBitmap = NULL;
BitmapBuffer * mixerSetupSwitchBitmap = NULL;
BitmapBuffer * mixerSetupDelayBitmap = NULL;
BitmapBuffer * mixerSetupSlowBitmap = NULL;
BitmapBuffer * mixerSetupDelaySlowBitmap = NULL;
BitmapBuffer * mixerSetupFlightmodeBitmap = NULL;

View file

@ -88,5 +88,12 @@ extern BitmapBuffer * mixerSetupOutputBitmap;
extern BitmapBuffer * mixerSetupAddBitmap;
extern BitmapBuffer * mixerSetupMultiBitmap;
extern BitmapBuffer * mixerSetupReplaceBitmap;
extern BitmapBuffer * mixerSetupLabelBitmap;
extern BitmapBuffer * mixerSetupFlightmodeBitmap;
extern BitmapBuffer * mixerSetupCurveBitmap;
extern BitmapBuffer * mixerSetupSwitchBitmap;
extern BitmapBuffer * mixerSetupDelayBitmap;
extern BitmapBuffer * mixerSetupSlowBitmap;
extern BitmapBuffer * mixerSetupDelaySlowBitmap;
#endif // _BITMAPS_H_

View file

@ -267,6 +267,7 @@ void lcdSetContrast();
#define BLINK_ON_PHASE (0)
#else
#define BLINK_ON_PHASE (g_blinkTmr10ms & (1<<6))
#define SLOW_BLINK_ON_PHASE (g_blinkTmr10ms & (1<<7))
#endif
#endif // _LCD_H_

View file

@ -270,14 +270,15 @@ bool menuModelMixOne(evt_t event)
#define _STR_MAX(x) PSTR("/" #x)
#define STR_MAX(x) _STR_MAX(x)
#define MIX_LINE_WEIGHT_POS 110
#define MIX_LINE_SRC_POS 115
#define MIX_LINE_CURVE_POS 165
#define MIX_LINE_SWITCH_POS 230
#define MIX_LINE_DELAY_POS 270
#define MIX_LINE_FM_POS 290
#define MIX_LINE_NAME_POS 405
#define MIX_LINE_SELECT_POS 50
#define MIX_LINE_WEIGHT_POS 105
#define MIX_LINE_SRC_POS 120
#define MIX_LINE_CURVE_ICON 175
#define MIX_LINE_CURVE_POS 195
#define MIX_LINE_SWITCH_ICON 260
#define MIX_LINE_SWITCH_POS 280
#define MIX_LINE_DELAY_SLOW_POS 340
#define MIX_LINE_NAME_FM_ICON 370
#define MIX_LINE_NAME_FM_POS 390
#define MIX_LINE_SELECT_POS 50
#define MIX_LINE_SELECT_WIDTH (LCD_W-MIX_LINE_SELECT_POS-15)
#define MIX_STATUS_MARGIN_LEFT MENUS_MARGIN_LEFT + 45
@ -322,20 +323,51 @@ void onMixesMenu(const char * result)
void displayMixInfos(coord_t y, MixData *md)
{
if (md->curve.value != 0 ) lcd->drawBitmap(MIX_LINE_CURVE_ICON, y + 2, mixerSetupCurveBitmap);
putsCurveRef(MIX_LINE_CURVE_POS, y, md->curve);
if (md->swtch) {
lcd->drawBitmap(MIX_LINE_SWITCH_ICON, y + 2, mixerSetupSwitchBitmap);
putsSwitches(MIX_LINE_SWITCH_POS, y, md->swtch);
}
}
void displayMixSmallFlightModes(coord_t x, coord_t y, FlightModesType value)
{
for (int i=0; i<MAX_FLIGHT_MODES; i++) {
char s[] = " ";
s[0] = '0' + i;
if (value & (1<<i)) lcd->drawFilledRect(x, y+2, 8, 12 , SOLID, CURVE_AXIS_COLOR);
lcdDrawText(x, y, s, SMLSIZE);
x += 8;
}
}
void displayMixLine(coord_t y, MixData *md)
{
if (md->name[0]) {
lcdDrawSizedText(MIX_LINE_NAME_POS, y+2, md->name, sizeof(md->name), ZCHAR | SMLSIZE);
if (md->name[0] && md->flightModes)
{
if (SLOW_BLINK_ON_PHASE) {
lcd->drawBitmap(MIX_LINE_NAME_FM_ICON, y + 2, mixerSetupFlightmodeBitmap);
displayMixSmallFlightModes(MIX_LINE_NAME_FM_POS, y + 2, md->flightModes);
}
else {
lcd->drawBitmap(MIX_LINE_NAME_FM_ICON, y + 2, mixerSetupLabelBitmap);
lcdDrawSizedText(MIX_LINE_NAME_FM_POS, y, md->name, sizeof(md->name), ZCHAR);
}
}
else
{
if (md->name[0]) {
lcd->drawBitmap(MIX_LINE_NAME_FM_ICON, y + 2, mixerSetupLabelBitmap);
lcdDrawSizedText(MIX_LINE_NAME_FM_POS, y, md->name, sizeof(md->name), ZCHAR);
}
if (md->flightModes) {
lcd->drawBitmap(MIX_LINE_NAME_FM_ICON, y + 2, mixerSetupFlightmodeBitmap);
displayMixSmallFlightModes(MIX_LINE_NAME_FM_POS, y + 2, md->flightModes);
}
}
displayMixInfos(y, md);
displayFlightModes(MIX_LINE_FM_POS, y, md->flightModes, 0);
}
void displayMixStatus(uint8_t channel)
@ -523,12 +555,13 @@ bool menuModelMixAll(evt_t event)
displayMixLine(y, md);
char cs[] = " ";
BitmapBuffer * delayslow = 0;
if (md->speedDown || md->speedUp)
cs[0] = 'S';
delayslow = mixerSetupSlowBitmap;
if (md->delayUp || md->delayDown)
cs[0] = (cs[0] =='S' ? '*' : 'D');
lcdDrawText(MIX_LINE_DELAY_POS, y, cs);
delayslow = (delayslow ? mixerSetupDelaySlowBitmap : mixerSetupDelayBitmap );
if (delayslow)
lcd->drawBitmap(MIX_LINE_DELAY_SLOW_POS, y + 2, delayslow);
if (s_copyMode) {
if ((s_copyMode==COPY_MODE || s_copyTgtOfs == 0) && s_copySrcCh == ch && i == (s_copySrcIdx + (s_copyTgtOfs<0))) {

View file

@ -145,6 +145,27 @@ class DarkblueTheme: public Theme
delete mixerSetupReplaceBitmap;
mixerSetupReplaceBitmap = BitmapBuffer::loadMaskOnBackground("mask_mplex_replace.png", TEXT_COLOR, TEXT_BGCOLOR);
delete mixerSetupLabelBitmap;
mixerSetupLabelBitmap = BitmapBuffer::loadMaskOnBackground("mask_textline_label.png", TEXT_COLOR, TEXT_BGCOLOR);
delete mixerSetupCurveBitmap;
mixerSetupCurveBitmap = BitmapBuffer::loadMaskOnBackground("mask_textline_curve.png", TEXT_COLOR, TEXT_BGCOLOR);
delete mixerSetupSwitchBitmap;
mixerSetupSwitchBitmap = BitmapBuffer::loadMaskOnBackground("mask_textline_switch.png", TEXT_COLOR, TEXT_BGCOLOR);
delete mixerSetupSlowBitmap;
mixerSetupSlowBitmap = BitmapBuffer::loadMaskOnBackground("mask_textline_slow.png", TEXT_COLOR, TEXT_BGCOLOR);
delete mixerSetupDelayBitmap;
mixerSetupDelayBitmap = BitmapBuffer::loadMaskOnBackground("mask_textline_delay.png", TEXT_COLOR, TEXT_BGCOLOR);
delete mixerSetupDelaySlowBitmap;
mixerSetupDelaySlowBitmap = BitmapBuffer::loadMaskOnBackground("mask_textline_delayslow.png", TEXT_BGCOLOR, TEXT_COLOR);
delete mixerSetupFlightmodeBitmap;
mixerSetupFlightmodeBitmap = BitmapBuffer::loadMaskOnBackground("mask_textline_fm.png", TEXT_COLOR, TEXT_BGCOLOR);
}
virtual void load() const

View file

@ -201,6 +201,26 @@ class DefaultTheme: public Theme
delete mixerSetupReplaceBitmap;
mixerSetupReplaceBitmap = BitmapBuffer::loadMaskOnBackground("mask_mplex_replace.png", TEXT_COLOR, TEXT_BGCOLOR);
delete mixerSetupLabelBitmap;
mixerSetupLabelBitmap = BitmapBuffer::loadMaskOnBackground("mask_textline_label.png", TEXT_COLOR, TEXT_BGCOLOR);
delete mixerSetupCurveBitmap;
mixerSetupCurveBitmap = BitmapBuffer::loadMaskOnBackground("mask_textline_curve.png", TEXT_COLOR, TEXT_BGCOLOR);
delete mixerSetupSwitchBitmap;
mixerSetupSwitchBitmap = BitmapBuffer::loadMaskOnBackground("mask_textline_switch.png", TEXT_COLOR, TEXT_BGCOLOR);
delete mixerSetupFlightmodeBitmap;
mixerSetupFlightmodeBitmap = BitmapBuffer::loadMaskOnBackground("mask_textline_fm.png", TEXT_COLOR, TEXT_BGCOLOR);
delete mixerSetupSlowBitmap;
mixerSetupSlowBitmap = BitmapBuffer::loadMaskOnBackground("mask_textline_slow.png", TEXT_COLOR, TEXT_BGCOLOR);
delete mixerSetupDelayBitmap;
mixerSetupDelayBitmap = BitmapBuffer::loadMaskOnBackground("mask_textline_delay.png", TEXT_COLOR, TEXT_BGCOLOR);
delete mixerSetupDelaySlowBitmap;
mixerSetupDelaySlowBitmap = BitmapBuffer::loadMaskOnBackground("mask_textline_delayslow.png", TEXT_BGCOLOR, TEXT_COLOR);
}
virtual void load() const