Commit f6397a08 authored by lm's avatar lm

Cleaning up auto-config files, working on toolbar usability

parent abb19876
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#!/usr/bin/env python
'''
simple templating system for mavlink generator
Copyright Andrew Tridgell 2011
Released under GNU GPL version 3 or later
'''
from mavparse import MAVParseError
class MAVTemplate(object):
'''simple templating system'''
def __init__(self,
start_var_token="${",
end_var_token="}",
start_rep_token="${{",
end_rep_token="}}",
trim_leading_lf=True,
checkmissing=True):
self.start_var_token = start_var_token
self.end_var_token = end_var_token
self.start_rep_token = start_rep_token
self.end_rep_token = end_rep_token
self.trim_leading_lf = trim_leading_lf
self.checkmissing = checkmissing
def find_end(self, text, start_token, end_token):
'''find the of a token.
Returns the offset in the string immediately after the matching end_token'''
if not text.startswith(start_token):
raise MAVParseError("invalid token start")
offset = len(start_token)
nesting = 1
while nesting > 0:
idx1 = text[offset:].find(start_token)
idx2 = text[offset:].find(end_token)
if idx1 == -1 and idx2 == -1:
raise MAVParseError("token nesting error")
if idx1 == -1 or idx1 > idx2:
offset += idx2 + len(end_token)
nesting -= 1
else:
offset += idx1 + len(start_token)
nesting += 1
return offset
def find_var_end(self, text):
'''find the of a variable'''
return self.find_end(text, self.start_var_token, self.end_var_token)
def find_rep_end(self, text):
'''find the of a repitition'''
return self.find_end(text, self.start_rep_token, self.end_rep_token)
def substitute(self, text, subvars={},
trim_leading_lf=None, checkmissing=None):
'''substitute variables in a string'''
if trim_leading_lf is None:
trim_leading_lf = self.trim_leading_lf
if checkmissing is None:
checkmissing = self.checkmissing
# handle repititions
while True:
subidx = text.find(self.start_rep_token)
if subidx == -1:
break
endidx = self.find_rep_end(text[subidx:])
if endidx == -1:
raise MAVParseError("missing end macro in %s" % text[subidx:])
part1 = text[0:subidx]
part2 = text[subidx+len(self.start_rep_token):subidx+(endidx-len(self.end_rep_token))]
part3 = text[subidx+endidx:]
a = part2.split(':')
field_name = a[0]
rest = ':'.join(a[1:])
v = getattr(subvars, field_name, None)
if v is None:
raise MAVParseError('unable to find field %s' % field_name)
t1 = part1
for f in v:
t1 += self.substitute(rest, f, trim_leading_lf=False, checkmissing=False)
if len(v) != 0 and t1[-1] in ["\n", ","]:
t1 = t1[:-1]
t1 += part3
text = t1
if trim_leading_lf:
if text[0] == '\n':
text = text[1:]
while True:
idx = text.find(self.start_var_token)
if idx == -1:
return text
endidx = text[idx:].find(self.end_var_token)
if endidx == -1:
raise MAVParseError('missing end of variable: %s' % text[idx:idx+10])
varname = text[idx+2:idx+endidx]
if isinstance(subvars, dict):
if not varname in subvars:
if checkmissing:
raise MAVParseError("unknown variable in '%s%s%s'" % (
self.start_var_token, varname, self.end_var_token))
return text[0:idx+endidx] + self.substitute(text[idx+endidx:], subvars,
trim_leading_lf=False, checkmissing=False)
value = subvars[varname]
else:
value = getattr(subvars, varname, None)
if value is None:
if checkmissing:
raise MAVParseError("unknown variable in '%s%s%s'" % (
self.start_var_token, varname, self.end_var_token))
return text[0:idx+endidx] + self.substitute(text[idx+endidx:], subvars,
trim_leading_lf=False, checkmissing=False)
text = text.replace("%s%s%s" % (self.start_var_token, varname, self.end_var_token), str(value))
return text
def write(self, file, text, subvars={}, trim_leading_lf=True):
'''write to a file with variable substitution'''
file.write(self.substitute(text, subvars=subvars, trim_leading_lf=trim_leading_lf))
EEPROM,variable name,Min,Max,Default,Multiplier,Enabled (0 = no, 1 = yes),Comment
HDNG2RLL_P, 0, 5, 0.7, 1, 1, NAV_ROLL_P - Navigation control gains. Tuning values for the navigation control PID loops. The P term is the primary tuning value. This determines how the control deflection varies in proportion to the required correction.
SYS_TYPE, 0, 15, 1, 1, 1, System type (airframe)
\ No newline at end of file
# Onboard parameters for system BRAVO
#
# MAV ID COMPONENT ID PARAM NAME VALUE (FLOAT)
42 1 HANDLEWPDELAY 0.20000000298
42 1 POSFILTER 1
42 1 PROTDELAY 40
42 1 PROTTIMEOUT 2
42 1 SETPOINTDELAY 1
42 1 YAWTOLERANCE 0.174500003457
42 200 ACC_NAV_OFFS_X 0
42 200 ACC_NAV_OFFS_Y 0
42 200 ACC_NAV_OFFS_Z -1000
42 200 ATT_KAL_KACC 0.00329999998212
42 200 ATT_KAL_YAWMOD 3
42 200 ATT_OFFSET_X 0
42 200 ATT_OFFSET_Y 0
42 200 ATT_OFFSET_Z 0
42 200 CAL_ACC_X 0
42 200 CAL_ACC_Y 0
42 200 CAL_ACC_Z 0
42 200 CAL_FIT_ACTIVE 0
42 200 CAL_FIT_GYRO_X 31496.8007812
42 200 CAL_FIT_GYRO_Y 29383.4003906
42 200 CAL_FIT_GYRO_Z 30151.0996094
42 200 CAL_GYRO_X 29760
42 200 CAL_GYRO_Y 29671
42 200 CAL_GYRO_Z 29572
42 200 CAL_MAG_X 375
42 200 CAL_MAG_Y -25
42 200 CAL_MAG_Z -1000
42 200 CAL_PRES_DIFF 10000
42 200 CAL_TEMP 29557
42 200 CAM_ANG_X_FAC 0
42 200 CAM_ANG_X_OFF 0
42 200 CAM_ANG_Y_FAC 0
42 200 CAM_ANG_Y_OFF 0.81099998951
42 200 CAM_EXP 1000
42 200 CAM_INTERVAL 200000
42 200 DEBUG_1 0
42 200 DEBUG_2 0
42 200 DEBUG_3 0
42 200 DEBUG_4 0
42 200 DEBUG_5 1
42 200 DEBUG_6 0
42 200 GPS_MODE 0
42 200 KAL_VEL_AX 1
42 200 KAL_VEL_AY 1
42 200 KAL_VEL_BX 0
42 200 KAL_VEL_BY 0
42 200 MIX_OFFSET 1
42 200 MIX_POSITION 1
42 200 MIX_POS_YAW 1
42 200 MIX_REMOTE 0
42 200 MIX_Z_POSITION 1
42 200 PID_ATT_AWU 0.300000011921
42 200 PID_ATT_D 30
42 200 PID_ATT_I 60
42 200 PID_ATT_LIM 100
42 200 PID_ATT_P 90
42 200 PID_POS_AWU 5
42 200 PID_POS_D 2.20000004768
42 200 PID_POS_I 0.10000000149
42 200 PID_POS_LIM 0.20000000298
42 200 PID_POS_P 2
42 200 PID_POS_Z_AWU 3
42 200 PID_POS_Z_D 0.25
42 200 PID_POS_Z_I 0.300000011921
42 200 PID_POS_Z_LIM 0.300000011921
42 200 PID_POS_Z_P 0.25
42 200 PID_YAWPOS_AWU 1
42 200 PID_YAWPOS_D 1
42 200 PID_YAWPOS_I 0.10000000149
42 200 PID_YAWPOS_LIM 3
42 200 PID_YAWPOS_P 5
42 200 PID_YAWSPEED_D 0
42 200 PID_YAWSPEED_I 5
42 200 PID_YAWSPEED_P 15
42 200 PID_YAWSPE_AWU 1
42 200 PID_YAWSPE_LIM 50
42 200 POS_ESTIM_MODE 1
42 200 POS_HOV_TRUST 0.550000011921
42 200 POS_SON_MODE 0
42 200 POS_SON_SCALE 1
42 200 POS_SP_ACCEPT 1
42 200 POS_SP_X -0.0329026989639
42 200 POS_SP_Y -0.0478124991059
42 200 POS_SP_YAW 0
42 200 POS_SP_Z -0.643148005009
42 200 POS_TIMEOUT 2000000
42 200 POS_YAW_TRACK 0
42 200 RC_NICK_CHAN 1
42 200 RC_ROLL_CHAN 2
42 200 RC_SAFETY_CHAN 6
42 200 RC_THRUST_CHAN 3
42 200 RC_TRIM_CHAN 0
42 200 RC_TUNE_CHAN1 5
42 200 RC_TUNE_CHAN2 6
42 200 RC_TUNE_CHAN3 7
42 200 RC_TUNE_CHAN4 5
42 200 RC_YAW_CHAN 4
42 200 SEND_DEBUGCHAN 0
42 200 SLOT_ATTITUDE 1
42 200 SLOT_CONTROL 0
42 200 SLOT_RAW_IMU 0
42 200 SLOT_RC 1
42 200 SYS_COMP_ID 200
42 200 SYS_ID 42
42 200 SYS_IMU_RESET 0
42 200 SYS_SW_VER 2000
42 200 SYS_TYPE 2
42 200 UART_0_BAUD 115200
42 200 UART_1_BAUD 115200
42 200 VEL_DAMP 0.949999988079
42 200 VEL_OFFSET_X 0
42 200 VEL_OFFSET_Y 0
42 200 VEL_OFFSET_Z 0
42 200 VICON_TKO_DIST 0.5
42 200 VICON_TKO_TIME 2
42 200 VIS_OUTL_TRESH 0.20000000298
# Onboard parameters for system BRAVO
#
# MAV ID COMPONENT ID PARAM NAME VALUE (FLOAT)
42 200 ACC_NAV_OFFS_X 0
42 200 ACC_NAV_OFFS_Y 0
42 200 ACC_NAV_OFFS_Z -1000
42 200 ATT_KAL_KACC 0.00329999998212
42 200 ATT_KAL_YAWMOD 3
42 200 ATT_OFFSET_X 0
42 200 ATT_OFFSET_Y 0
42 200 ATT_OFFSET_Z 0
42 200 CAL_ACC_X 0
42 200 CAL_ACC_Y 0
42 200 CAL_ACC_Z 0
42 200 CAL_FIT_ACTIVE 0
42 200 CAL_FIT_GYRO_X 31496.8007812
42 200 CAL_FIT_GYRO_Y 29383.4003906
42 200 CAL_FIT_GYRO_Z 30151.0996094
42 200 CAL_GYRO_X 29760
42 200 CAL_GYRO_Y 29671
42 200 CAL_GYRO_Z 29572
42 200 CAL_MAG_X 375
42 200 CAL_MAG_Y -25
42 200 CAL_MAG_Z -1000
42 200 CAL_PRES_DIFF 10000
42 200 CAL_TEMP 29557
42 200 CAM_ANG_X_FAC 0
42 200 CAM_ANG_X_OFF 0
42 200 CAM_ANG_Y_FAC 0
42 200 CAM_ANG_Y_OFF 0.898000001907
42 200 CAM_EXP 1000
42 200 CAM_INTERVAL 200000
42 200 DEBUG_1 0
42 200 DEBUG_2 0
42 200 DEBUG_3 0
42 200 DEBUG_4 0
42 200 DEBUG_5 1
42 200 DEBUG_6 0
42 200 GPS_MODE 0
42 200 KAL_VEL_AX 1
42 200 KAL_VEL_AY 1
42 200 KAL_VEL_BX 0
42 200 KAL_VEL_BY 0
42 200 MIX_OFFSET 1
42 200 MIX_POSITION 1
42 200 MIX_POS_YAW 1
42 200 MIX_REMOTE 0
42 200 MIX_Z_POSITION 1
42 200 PID_ATT_AWU 0.300000011921
42 200 PID_ATT_D 30
42 200 PID_ATT_I 60
42 200 PID_ATT_LIM 100
42 200 PID_ATT_P 90
42 200 PID_POS_AWU 5
42 200 PID_POS_D 3.5
42 200 PID_POS_I 0.300000011921
42 200 PID_POS_LIM 0.20000000298
42 200 PID_POS_P 3
42 200 PID_POS_Z_AWU 3
42 200 PID_POS_Z_D 0.25
42 200 PID_POS_Z_I 0.300000011921
42 200 PID_POS_Z_LIM 0.300000011921
42 200 PID_POS_Z_P 0.25
42 200 PID_YAWPOS_AWU 1
42 200 PID_YAWPOS_D 1
42 200 PID_YAWPOS_I 0.10000000149
42 200 PID_YAWPOS_LIM 3
42 200 PID_YAWPOS_P 5
42 200 PID_YAWSPEED_D 0
42 200 PID_YAWSPEED_I 5
42 200 PID_YAWSPEED_P 15
42 200 PID_YAWSPE_AWU 1
42 200 PID_YAWSPE_LIM 50
42 200 POS_ESTIM_MODE 3
42 200 POS_HOV_TRUST 0.5
42 200 POS_SON_MODE 0
42 200 POS_SON_SCALE 1
42 200 POS_SP_ACCEPT 1
42 200 POS_SP_X 0.254168212414
42 200 POS_SP_Y -0.378409773111
42 200 POS_SP_YAW 0
42 200 POS_SP_Z -0.0880969688296
42 200 POS_TIMEOUT 2000000
42 200 POS_YAW_TRACK 0
42 200 RC_NICK_CHAN 1
42 200 RC_ROLL_CHAN 2
42 200 RC_SAFETY_CHAN 6
42 200 RC_THRUST_CHAN 3
42 200 RC_TRIM_CHAN 0
42 200 RC_TUNE_CHAN1 5
42 200 RC_TUNE_CHAN2 6
42 200 RC_TUNE_CHAN3 7
42 200 RC_TUNE_CHAN4 5
42 200 RC_YAW_CHAN 4
42 200 SEND_DEBUGCHAN 0
42 200 SLOT_ATTITUDE 1
42 200 SLOT_CONTROL 0
42 200 SLOT_RAW_IMU 0
42 200 SLOT_RC 1
42 200 SYS_COMP_ID 200
42 200 SYS_ID 42
42 200 SYS_IMU_RESET 0
42 200 SYS_SW_VER 2000
42 200 SYS_TYPE 2
42 200 UART_0_BAUD 115200
42 200 UART_1_BAUD 115200
42 200 VEL_DAMP 0.949999988079
42 200 VEL_OFFSET_X 0
42 200 VEL_OFFSET_Y 0
42 200 VEL_OFFSET_Z 0
42 200 VICON_TKO_DIST 0.5
42 200 VICON_TKO_TIME 2
42 200 VIS_OUTL_TRESH 0.20000000298
# Onboard parameters for system MAV 042
#
# MAV ID COMPONENT ID PARAM NAME VALUE (FLOAT)
42 1 HANDLEWPDELAY 0.20000000298
42 1 POSFILTER 1
42 1 PROTDELAY 40
42 1 PROTTIMEOUT 2
42 1 SETPOINTDELAY 1
42 1 YAWTOLERANCE 0.174500003457
42 200 ACC_NAV_OFFS_X 0
42 200 ACC_NAV_OFFS_Y 0
42 200 ACC_NAV_OFFS_Z -1000
42 200 ATT_KAL_KACC 0.00329999998212
42 200 ATT_KAL_YAWMOD 3
42 200 ATT_OFFSET_X 0
42 200 ATT_OFFSET_Y 0
42 200 ATT_OFFSET_Z -0.0799999982119
42 200 CAL_ACC_X 0
42 200 CAL_ACC_Y 0
42 200 CAL_ACC_Z 0
42 200 CAL_FIT_ACTIVE 0
42 200 CAL_FIT_GYRO_X 31496.8007812
42 200 CAL_FIT_GYRO_Y 29383.4003906
42 200 CAL_FIT_GYRO_Z 30151.0996094
42 200 CAL_GYRO_X 29767
42 200 CAL_GYRO_Y 29654
42 200 CAL_GYRO_Z 29570
42 200 CAL_MAG_X 375
42 200 CAL_MAG_Y -25
42 200 CAL_MAG_Z -1000
42 200 CAL_PRES_DIFF 10000
42 200 CAL_TEMP 29051
42 200 CAM_ANG_X_FAC 0
42 200 CAM_ANG_X_OFF 0
42 200 CAM_ANG_Y_FAC 0
42 200 CAM_ANG_Y_OFF 0.428000003099
42 200 CAM_EXP 1000
42 200 CAM_INTERVAL 200000
42 200 DEBUG_1 0
42 200 DEBUG_2 0
42 200 DEBUG_3 0
42 200 DEBUG_4 0
42 200 DEBUG_5 1
42 200 DEBUG_6 0
42 200 GPS_MODE 0
42 200 KAL_VEL_AX 1
42 200 KAL_VEL_AY 1
42 200 KAL_VEL_BX 0
42 200 KAL_VEL_BY 0
42 200 MIX_OFFSET 0
42 200 MIX_POSITION 0
42 200 MIX_POS_YAW 0
42 200 MIX_REMOTE 0
42 200 MIX_Z_POSITION 0
42 200 PID_ATT_AWU 0.300000011921
42 200 PID_ATT_D 30
42 200 PID_ATT_I 60
42 200 PID_ATT_LIM 100
42 200 PID_ATT_P 90
42 200 PID_POS_AWU 5
42 200 PID_POS_D 2
42 200 PID_POS_I 0.20000000298
42 200 PID_POS_LIM 0.20000000298
42 200 PID_POS_P 1.79999995232
42 200 PID_POS_Z_AWU 3
42 200 PID_POS_Z_D 0.20000000298
42 200 PID_POS_Z_I 0.300000011921
42 200 PID_POS_Z_LIM 0.300000011921
42 200 PID_POS_Z_P 0.25
42 200 PID_YAWPOS_AWU 1
42 200 PID_YAWPOS_D 1
42 200 PID_YAWPOS_I 0.10000000149
42 200 PID_YAWPOS_LIM 3
42 200 PID_YAWPOS_P 5
42 200 PID_YAWSPEED_D 0
42 200 PID_YAWSPEED_I 5
42 200 PID_YAWSPEED_P 15
42 200 PID_YAWSPE_AWU 1
42 200 PID_YAWSPE_LIM 50
42 200 POS_HOV_TRUST 0.300000011921
42 200 POS_SON_MODE 0
42 200 POS_SON_SCALE 1
42 200 POS_SP_ACCEPT 1
42 200 POS_SP_X 0
42 200 POS_SP_Y 0
42 200 POS_SP_YAW 0
42 200 POS_SP_Z -0.213201999664
42 200 POS_TIMEOUT 2000000
42 200 POS_YAW_TRACK 0
42 200 RC_NICK_CHAN 1
42 200 RC_ROLL_CHAN 2
42 200 RC_SAFETY_CHAN 5
42 200 RC_THRUST_CHAN 3
42 200 RC_TRIM_CHAN 0
42 200 RC_TUNE_CHAN1 5
42 200 RC_TUNE_CHAN2 6
42 200 RC_TUNE_CHAN3 7
42 200 RC_TUNE_CHAN4 8
42 200 RC_YAW_CHAN 4
42 200 SEND_DEBUGCHAN 0
42 200 SLOT_ATTITUDE 1
42 200 SLOT_CONTROL 0
42 200 SLOT_RAW_IMU 0
42 200 SLOT_RC 0
42 200 SYS_COMP_ID 200
42 200 SYS_ID 42
42 200 SYS_IMU_RESET 0
42 200 SYS_SW_VER 2000
42 200 SYS_TYPE 2
42 200 UART_0_BAUD 115200
42 200 UART_1_BAUD 115200
42 200 VEL_DAMP 0.949999988079
42 200 VEL_OFFSET_X 0
42 200 VEL_OFFSET_Y 0
42 200 VEL_OFFSET_Z 0
42 200 VICON_MODE 0
42 200 VICON_TKO_DIST 0.5
42 200 VICON_TKO_TIME 2
42 200 VIS_OUTL_TRESH 0.20000000298
[PIXHAWK%20Quadrotor%20Commands]
QGC_TOOL_WIDGET_ITEMS\1\TYPE=BUTTON
QGC_TOOL_WIDGET_ITEMS\1\QGC_ACTION_BUTTON_DESCRIPTION=CALIBRATE GYRO
QGC_TOOL_WIDGET_ITEMS\1\QGC_ACTION_BUTTON_BUTTONTEXT=Calibrate
QGC_TOOL_WIDGET_ITEMS\1\QGC_ACTION_BUTTON_ACTIONID=17
QGC_TOOL_WIDGET_ITEMS\2\TYPE=BUTTON
QGC_TOOL_WIDGET_ITEMS\2\QGC_ACTION_BUTTON_DESCRIPTION=Record logfile and images
QGC_TOOL_WIDGET_ITEMS\2\QGC_ACTION_BUTTON_BUTTONTEXT=Start
QGC_TOOL_WIDGET_ITEMS\2\QGC_ACTION_BUTTON_ACTIONID=21
QGC_TOOL_WIDGET_ITEMS\3\TYPE=BUTTON
QGC_TOOL_WIDGET_ITEMS\3\QGC_ACTION_BUTTON_DESCRIPTION=Stop recording
QGC_TOOL_WIDGET_ITEMS\3\QGC_ACTION_BUTTON_BUTTONTEXT=Stop
QGC_TOOL_WIDGET_ITEMS\3\QGC_ACTION_BUTTON_ACTIONID=23
QGC_TOOL_WIDGET_ITEMS\size=3
This diff is collapsed.
......@@ -236,6 +236,9 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
emit systemTypeSet(this, type);
}
// FIXME update
//emit armingChanged(uasId, );
QString audiostring = "System " + getUASName();
QString stateAudio = "";
QString modeAudio = "";
......@@ -297,11 +300,11 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
GAudioOutput::instance()->say(audiostring.toLower());
}
if (state.system_status == MAV_STATE_POWEROFF)
{
emit systemRemoved(this);
emit systemRemoved();
}
// if (state.system_status == MAV_STATE_POWEROFF)
// {
// emit systemRemoved(this);
// emit systemRemoved();
// }
}
break;
......
......@@ -358,6 +358,8 @@ signals:
void dropRateChanged(int systemId, float receiveDrop);
/** @brief Robot mode has changed */
void modeChanged(int sysId, QString status, QString description);
/** @brief Robot armed state has changed */
void armingChanged(int sysId, QString armingState);
/** @brief A command has been issued **/
void commandSent(int command);
/** @brief The connection status has changed **/
......
......@@ -633,7 +633,7 @@ void MainWindow::loadCustomWidget(const QString& fileName, bool singleinstance)
void MainWindow::loadCustomWidgetsFromDefaults(const QString& systemType, const QString& autopilotType)
{
QString defaultsDir = qApp->applicationDirPath() + "/files/" + systemType.toLower() + "/" + autopilotType.toLower() + "/widgets/";
QString defaultsDir = qApp->applicationDirPath() + "/files/" + autopilotType.toLower() + "/" + systemType.toLower() + "/widgets/";
QDir widgets(defaultsDir);
QStringList files = widgets.entryList();
......
......@@ -150,8 +150,8 @@ void QGCParamWidget::loadSettings()
void QGCParamWidget::loadParameterInfoCSV(const QString& autopilot, const QString& airframe)
{
QDir appDir = QDir::current();
appDir.cd("files/parameter_tooltips");
QString fileName = QString("MAV_AUTOPILOT_%1-MAV_TYPE_%2.txt").arg(autopilot).arg(airframe);
appDir.cd("files");
QString fileName = QString("/%1/%2/parameter_tooltips/tooltips.txt").arg(autopilot.toLower()).arg(airframe.toLower());
QString filePath = appDir.filePath(fileName);
QFile paramMetaFile(filePath);
......
......@@ -50,6 +50,8 @@ QGCToolBar::QGCToolBar(QWidget *parent) :
// Add MAV widget
symbolButton = new QToolButton(this);
toolBarNameLabel = new QLabel("------", this);
toolBarSafetyLabel = new QLabel("SAFE", this);
toolBarSafetyLabel->setStyleSheet("QLabel { margin: 0px 2px; font: 14px; color: #14C814; }");
toolBarModeLabel = new QLabel("------", this);
toolBarModeLabel->setStyleSheet("QLabel { margin: 0px 2px; font: 14px; color: #3C7B9E; }");
toolBarStateLabel = new QLabel("------", this);
......@@ -70,6 +72,7 @@ QGCToolBar::QGCToolBar(QWidget *parent) :
symbolButton->setStyleSheet("QWidget { background-color: #050508; color: #DDDDDF; background-clip: border; } QToolButton { font-weight: bold; font-size: 12px; border: 0px solid #999999; border-radius: 5px; min-width:22px; max-width: 22px; min-height: 22px; max-height: 22px; padding: 0px; margin: 0px 0px 0px 20px; background-color: none; }");
addWidget(symbolButton);
addWidget(toolBarNameLabel);
addWidget(toolBarSafetyLabel);
addWidget(toolBarModeLabel);
addWidget(toolBarStateLabel);
addWidget(toolBarBatteryBar);
......@@ -151,6 +154,39 @@ void QGCToolBar::logging(bool enabled)
void QGCToolBar::addPerspectiveChangeAction(QAction* action)
{
insertAction(toggleLoggingAction, action);
// Set tab style
QWidget* widget = widgetForAction(action);
widget->setStyleSheet("\
* { font-weight: bold; min-height: 16px; min-width: 24px; \
border-top: 1px solid #BBBBBB; \
border-bottom: 0px; \
border-left: 1px solid #BBBBBB; \
border-right: 1px solid #BBBBBB; \
border-top-left-radius: 5px; \
border-top-right-radius: 5px; \
border-bottom-left-radius: 0px; \
border-bottom-right-radius: 0px; \
max-height: 22px; \
margin-top: 4px; \
margin-left: 2px; \
margin-bottom: 0px; \
margin-right: 2px; \
background-color: #222222; \
} \
*:checked { \
background-color: #000000; \
border-top: 2px solid #379AC3; \
border-bottom: 0px; \
border-left: 2px solid #379AC3; \
border-right: 2px solid #379AC3; \
} \
*:pressed { \
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #bbbbbb, stop: 1 #b0b0b0); \
border-top: 2px solid #379AC3; \
border-bottom: 0px; \
border-left: 2px solid #379AC3; \
border-right: 2px solid #379AC3; }");
}
void QGCToolBar::setActiveUAS(UASInterface* active)
......
......@@ -75,6 +75,7 @@ protected:
UASInterface* mav;
QToolButton* symbolButton;
QLabel* toolBarNameLabel;
QLabel* toolBarSafetyLabel;
QLabel* toolBarModeLabel;
QLabel* toolBarStateLabel;
QLabel* toolBarWpLabel;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment