Skip to content

Commit

Permalink
Merge branch 'woraround_osx_qt_slider_bug' into brain
Browse files Browse the repository at this point in the history
  • Loading branch information
BrainFPV committed Feb 13, 2015
2 parents db62906 + 01776fb commit 7dca061
Show file tree
Hide file tree
Showing 13 changed files with 83 additions and 18 deletions.
5 changes: 5 additions & 0 deletions flight/targets/colibri/fw/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ include $(BOARD_INFO_DIR)/board-info.mk
# Set developer code and compile options
# Set to YES for debugging
DEBUG ?= NO
ERASE_FLASH ?= NO

# List of modules to include
MODULES = Sensors
Expand Down Expand Up @@ -110,6 +111,10 @@ SRC += $(DEBUG_CM3_DIR)/dcc_stdio.c
SRC += $(DEBUG_CM3_DIR)/cm3_fault_handlers.c
endif

ifeq ($(ERASE_FLASH), YES)
CDEFS += -DERASE_FLASH
endif

SRC += $(FLIGHTLIB)/paths.c
SRC += $(FLIGHTLIB)/fifo_buffer.c
SRC += $(FLIGHTLIB)/WorldMagModel.c
Expand Down
5 changes: 5 additions & 0 deletions flight/targets/colibri/fw/pios_board.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,11 @@ void PIOS_Board_Init(void)
(&pios_waypoints_settings_fs_id, &flashfs_waypoints_cfg,
FLASH_PARTITION_LABEL_WAYPOINTS) != 0)
panic(1);

#if defined(ERASE_FLASH)
PIOS_FLASHFS_Format(pios_uavo_settings_fs_id);
#endif

#endif /* PIOS_INCLUDE_FLASH */

/* Initialize the task monitor library */
Expand Down
6 changes: 5 additions & 1 deletion flight/targets/flyingf3/fw/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ include $(BOARD_INFO_DIR)/board-info.mk
# @groupbrief Set developer code and compile options
# @optbrief Set to YES to compile for debugging
DEBUG ?= NO

ERASE_FLASH ?= NO

# @endgroup Compile Options
# List of modules to include
Expand Down Expand Up @@ -113,6 +113,10 @@ SRC += $(DEBUG_CM3_DIR)/dcc_stdio.c
SRC += $(DEBUG_CM3_DIR)/cm3_fault_handlers.c
endif

ifeq ($(ERASE_FLASH), YES)
CDEFS += -DERASE_FLASH
endif

SRC += $(FLIGHTLIB)/paths.c
SRC += $(FLIGHTLIB)/fifo_buffer.c
SRC += $(FLIGHTLIB)/WorldMagModel.c
Expand Down
5 changes: 5 additions & 0 deletions flight/targets/flyingf3/fw/pios_board.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,11 @@ void PIOS_Board_Init(void) {
/* Mount all filesystems */
PIOS_FLASHFS_Logfs_Init(&pios_uavo_settings_fs_id, &flashfs_internal_settings_cfg, FLASH_PARTITION_LABEL_SETTINGS);
PIOS_FLASHFS_Logfs_Init(&pios_waypoints_settings_fs_id, &flashfs_internal_waypoints_cfg, FLASH_PARTITION_LABEL_WAYPOINTS);

#if defined(ERASE_FLASH)
PIOS_FLASHFS_Format(pios_uavo_settings_fs_id);
#endif

#endif

/* Initialize the task monitor library */
Expand Down
5 changes: 5 additions & 0 deletions flight/targets/flyingf4/fw/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ include $(BOARD_INFO_DIR)/board-info.mk
# Set developer code and compile options
# Set to YES for debugging
DEBUG ?= NO
ERASE_FLASH ?= NO

# List of modules to include
MODULES = Sensors
Expand Down Expand Up @@ -110,6 +111,10 @@ SRC += $(DEBUG_CM3_DIR)/dcc_stdio.c
SRC += $(DEBUG_CM3_DIR)/cm3_fault_handlers.c
endif

ifeq ($(ERASE_FLASH), YES)
CDEFS += -DERASE_FLASH
endif

SRC += $(FLIGHTLIB)/paths.c
SRC += $(FLIGHTLIB)/fifo_buffer.c
SRC += $(FLIGHTLIB)/WorldMagModel.c
Expand Down
4 changes: 4 additions & 0 deletions flight/targets/flyingf4/fw/pios_board.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,10 @@ void PIOS_Board_Init(void) {
panic(1);
#endif /* PIOS_INCLUDE_EXTERNAL_FLASH_WAYPOINTS */

#if defined(ERASE_FLASH)
PIOS_FLASHFS_Format(pios_uavo_settings_fs_id);
#endif

#endif /* PIOS_INCLUDE_FLASH */

/* Initialize the task monitor library */
Expand Down
6 changes: 4 additions & 2 deletions flight/targets/freedom/fw/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ include $(BOARD_INFO_DIR)/board-info.mk
# @groupbrief Set developer code and compile options
# @optbrief Set to YES to compile for debugging
DEBUG ?= NO

ERASE_FLASH ?= NO

# @endgroup Compile Options
# List of modules to include
Expand Down Expand Up @@ -256,7 +256,9 @@ else
CFLAGS += -Os
endif


ifeq ($(ERASE_FLASH), YES)
CDEFS += -DERASE_FLASH
endif

# common architecture-specific flags from the device-specific library makefile
CFLAGS += $(ARCHFLAGS)
Expand Down
5 changes: 5 additions & 0 deletions flight/targets/freedom/fw/pios_board.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,11 @@ void PIOS_Board_Init(void) {
panic(1);
if (PIOS_FLASHFS_Logfs_Init(&pios_waypoints_settings_fs_id, &flashfs_waypoints_cfg, FLASH_PARTITION_LABEL_WAYPOINTS) != 0)
panic(1);

#if defined(ERASE_FLASH)
PIOS_FLASHFS_Format(pios_uavo_settings_fs_id);
#endif

#endif /* PIOS_INCLUDE_FLASH */

/* Initialize the task monitor library */
Expand Down
5 changes: 5 additions & 0 deletions flight/targets/quanton/fw/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ include $(BOARD_INFO_DIR)/board-info.mk
# Set developer code and compile options
# Set to YES for debugging
DEBUG ?= NO
ERASE_FLASH ?= NO

# List of modules to include
MODULES = Sensors
Expand Down Expand Up @@ -112,6 +113,10 @@ SRC += $(DEBUG_CM3_DIR)/dcc_stdio.c
SRC += $(DEBUG_CM3_DIR)/cm3_fault_handlers.c
endif

ifeq ($(ERASE_FLASH), YES)
CDEFS += -DERASE_FLASH
endif

SRC += $(FLIGHTLIB)/paths.c
SRC += $(FLIGHTLIB)/fifo_buffer.c
SRC += $(FLIGHTLIB)/WorldMagModel.c
Expand Down
5 changes: 5 additions & 0 deletions flight/targets/quanton/fw/pios_board.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,11 @@ void PIOS_Board_Init(void) {
panic(1);
if (PIOS_FLASHFS_Logfs_Init(&pios_waypoints_settings_fs_id, &flashfs_waypoints_cfg, FLASH_PARTITION_LABEL_WAYPOINTS) != 0)
panic(1);

#if defined(ERASE_FLASH)
PIOS_FLASHFS_Format(pios_uavo_settings_fs_id);
#endif

#endif /* PIOS_INCLUDE_FLASH */

/* Initialize the task monitor library */
Expand Down
5 changes: 4 additions & 1 deletion flight/targets/revomini/fw/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ include $(BOARD_INFO_DIR)/board-info.mk
# Set developer code and compile options
# Set to YES for debugging
DEBUG ?= NO
ERASE_FLASH ?= NO

# List of modules to include
MODULES = Sensors
Expand Down Expand Up @@ -249,7 +250,9 @@ else
CFLAGS += -Os
endif


ifeq ($(ERASE_FLASH), YES)
CDEFS += -DERASE_FLASH
endif

# common architecture-specific flags from the device-specific library makefile
CFLAGS += $(ARCHFLAGS)
Expand Down
5 changes: 5 additions & 0 deletions flight/targets/revomini/fw/pios_board.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,11 @@ void PIOS_Board_Init(void) {
/* Mount all filesystems */
PIOS_FLASHFS_Logfs_Init(&pios_uavo_settings_fs_id, &flashfs_settings_cfg, FLASH_PARTITION_LABEL_SETTINGS);
PIOS_FLASHFS_Logfs_Init(&pios_waypoints_settings_fs_id, &flashfs_waypoints_cfg, FLASH_PARTITION_LABEL_WAYPOINTS);

#if defined(ERASE_FLASH)
PIOS_FLASHFS_Format(pios_uavo_settings_fs_id);
#endif

#endif /* PIOS_INCLUDE_FLASH */

/* Initialize the task monitor library */
Expand Down
40 changes: 26 additions & 14 deletions ground/gcs/src/plugins/config/inputchannelform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,33 @@ void inputChannelForm::setName(QString &name)
*/
void inputChannelForm::minMaxUpdated()
{
bool reverse = (ui->channelMin->value() > ui->channelMax->value());
if(reverse) {
ui->channelNeutral->setMinimum(ui->channelMax->value());
ui->channelNeutral->setMaximum(ui->channelMin->value());

// Set the QSlider groove colors so that the fill is on the side of the minimum value
ui->channelNeutral->setProperty("state", "inverted");
} else {
ui->channelNeutral->setMinimum(ui->channelMin->value());
ui->channelNeutral->setMaximum(ui->channelMax->value());

// Set the QSlider groove colors so that the fill is on the side of the minimum value
ui->channelNeutral->setProperty("state", "normal");
if (ui->channelMin->value() != ui->channelMax->value()) {
bool reverse = (ui->channelMin->value() > ui->channelMax->value());
if(reverse) {
ui->channelNeutral->setMinimum(ui->channelMax->value());
ui->channelNeutral->setMaximum(ui->channelMin->value());

// Set the QSlider groove colors so that the fill is on the side of the minimum value
ui->channelNeutral->setProperty("state", "inverted");
} else {
ui->channelNeutral->setMinimum(ui->channelMin->value());
ui->channelNeutral->setMaximum(ui->channelMax->value());

// Set the QSlider groove colors so that the fill is on the side of the minimum value
ui->channelNeutral->setProperty("state", "normal");
}
ui->channelNeutral->setInvertedAppearance(reverse);

// make sure slider is enabled (can be removed when "else" below is removed)
ui->channelNeutral->setEnabled(true);
}
else {
// when the min and max is equal, disable this slider to prevent crash
// from Qt bug: https://bugreports.qt.io/browse/QTBUG-43398
ui->channelNeutral->setMinimum(ui->channelMin->value() - 1);
ui->channelNeutral->setMaximum(ui->channelMax->value() + 1);
ui->channelNeutral->setEnabled(false);
}
ui->channelNeutral->setInvertedAppearance(reverse);

// Force refresh of style sheet.
ui->channelNeutral->setStyle(QApplication::style());
Expand Down

0 comments on commit 7dca061

Please sign in to comment.