readonlypropertystringfwManualModeDescription:"The pilot has full control of the aircraft, no assistance is provided. "+
"The Main mode switch must always be assigned to a channel in order to fly"
readonlypropertystringmrManualModeDescription:"Centering roll/pitch stick will return the multirotor to a level attitude, but it will continue drifting in the direction it was previously sent. "+
"Altitude is controlled fully by pilot using the Throttle stick. "+
"The Main mode switch must always be assigned to a channel in order to fly"
readonlypropertystringassistModeName:"Assist"
readonlypropertystringassistModeDescription:"If Position Control is placed on a seperate channel from the Main mode channel, an additional 'Assist' mode is added to the Main switch. "+
"In order for the Attitude Control/Position Control switch to be active, the Main switch must be in Assist mode."
readonlypropertystringautoModeName:"Auto"
readonlypropertystringautoModeDescription:"If Loiter is placed on a seperate channel from the Main mode channel, an additional 'Auto' mode is added to the Main switch. "+
"In order for the Mission/Loiter switch to be active, the Main switch must be in Auto mode."
// User is specifying thresholds, do not auto-calculate
return
}
if(modeChannel!=0){
varpositions=3// Manual/Assist/Auto always exist
varloiterOnModeSwitch=modeChannel==loiterChannel
varposCtlOnModeSwitch=modeChannel==posCtlChannel
varacroOnModeSwitch=modeChannel==acroChannel
positions+=loiterOnModeSwitch?1:0
positions+=posCtlOnModeSwitch?1:0
positions+=acroOnModeSwitch?1:0
varincrement=1.0/positions
varcurrentThreshold=0.0
// Make sure we don't re-enter
inRedistribution=true
if(acroOnModeSwitch){
currentThreshold+=increment
rc_acro_th.value=currentThreshold
}
currentThreshold+=increment
rc_assist_th.value=currentThreshold
if(posCtlOnModeSwitch){
currentThreshold+=increment
rc_posctl_th.value=currentThreshold
}
currentThreshold+=increment
rc_auto_th.value=currentThreshold
if(loiterOnModeSwitch){
currentThreshold+=increment
rc_loiter_th.value=currentThreshold
}
inRedistribution=false
}
if(returnChannel!=0){
inRedistribution=true
// If only two positions don't set threshold at midrange. Setting to 0.25
// allows for this channel to work with either two or three position switch
rc_return_th.value=0.25
inRedistribution=false
}
if(offboardChannel!=0){
inRedistribution=true
// If only two positions don't set threshold at midrange. Setting to 0.25
// allows for this channel to work with either two or three position switch
rc_offboard_th.value=0.25
inRedistribution=false
}
if(loiterChannel!=0&&loiterChannel!=modeChannel){
inRedistribution=true
// If only two positions don't set threshold at midrange. Setting to 0.25
// allows for this channel to work with either two or three position switch
rc_loiter_th.value=0.25
inRedistribution=false
}
if(posCtlChannel!=0&posCtlChannel!=modeChannel){
inRedistribution=true
// If only two positions don't set threshold at midrange. Setting to 0.25
// allows for this channel to work with either two or three position switch
rc_posctl_th.value=0.25
inRedistribution=false
}
if(acroChannel!=0&acroChannel!=modeChannel){
inRedistribution=true
// If only two positions don't set threshold at midrange. Setting to 0.25
// allows for this channel to work with either two or three position switch
rc_acro_th.value=0.25
inRedistribution=false
}
}
Column{
ScrollView{
id:scroll
anchors.fill:parent
horizontalScrollBarPolicy:Qt.ScrollBarAlwaysOff
QGCLabel{
text:"FLIGHT MODES CONFIG"
font.pixelSize:ScreenTools.largeFontPixelSize
}
Item{height:20;width:10}// spacer
QGCLabel{
width:parent.width
text:"The Main Mode, Loiter, PostCtl and Acro switches can be assigned to any channel which is not currently being used for attitude control. The Return and Offboard switches must be assigned to their seperate channel. "+
"All channels are displayed below. "+
"You can drag Flight Modes from the Flight Modes section below to a channel and drop it there. You can also drag switches assigned to a channel "+
"to another channel or back to the Unassigned Switches section. The Switch Display section at the very bottom will show you the results of your Flight Mode setup."