Merge branch 'ProDrone-failsafe_tab_pull_request' into development

10.3.x-maintenance
Dominic Clifton 2015-12-14 22:58:01 +01:00
commit fdc87fe581
20 changed files with 1319 additions and 67 deletions

View File

@ -425,9 +425,6 @@
"configurationReceiver": {
"message": "Receiver Mode"
},
"configurationFailsafe": {
"message": "Receiver failsafe"
},
"configurationRSSI": {
"message": "RSSI (Signal Strength)"
},
@ -439,7 +436,7 @@
},
"configurationSerialRXHelp": {
"message": "<strong>Note:</strong> Rememer to configure a Serial Port (via Ports tab) and choose a Serial Receiver Provider when using RX_SERIAL feature."
"message": "<strong>Note:</strong> Remember to configure a Serial Port (via Ports tab) and choose a Serial Receiver Provider when using RX_SERIAL feature."
},
"configurationBoardAlignment": {
@ -481,9 +478,6 @@
"configurationThrottleMaximum": {
"message": "Maximum Throttle"
},
"configurationThrottleFailsafe": {
"message": "Failsafe Throttle"
},
"configurationThrottleMinimumCommand": {
"message": "Minimum Command"
},
@ -1273,6 +1267,84 @@
"message": "The values below change the behaviour of the ANGLE and HORIZON flight modes. Different PID controllers handle the LEVEL values differently. Please check the documentation."
},
"configHelp1": {
"message": "RSSI is a measurement of signal strength and is very handy so you know when your aircraft isw going out of range or if it is suffering RF interference."
"message": "RSSI is a measurement of signal strength and is very handy so you know when your aircraft is going out of range or if it is suffering RF interference."
},
"failsafeFeaturesHelpOld": {
"message": "Failsafe configuration has changed considerably. Use Cleanflight <strong>v1.12.0+</strong> to enable the improved configuration panel."
},
"failsafePaneTitleOld": {
"message": "Receiver failsafe"
},
"failsafeFeatureItemOld": {
"message": "Failsafe settings on RX signal loss"
},
"failsafeThrottleItemOld": {
"message": "Failsafe Throttle"
},
"failsafeFeaturesHelpNew": {
"message": "Failsafe has two stages. <strong>Stage 1</strong> is entered when a flightchannel has an invalid pulse length, the receiver reports failsafe mode or there is no signal from the receiver at all, the channel fallback settings are applied to <span style=\"color: red\">all channels</span> and a short amount of time is provided to allow for recovery. <strong>Stage 2</strong> is entered when the error condition takes longer then the configured guard time while the craft is <span style=\"color: red\">armed</span>, all channels will remain at the applied channel fallback setting unless overruled by the chosen procedure. <br /><strong>Note:</strong> Prior to entering stage 1, channel fallback settings are also applied to individual AUX channels that have invalid pulses."
},
"failsafePulsrangeTitle": {
"message": "Valid Pulse Range Settings"
},
"failsafePulsrangeHelp": {
"message": "Pulses shorter then minimum or longer then maximum are invalid and will trigger application of individual channel fallback settings for AUX channels or entering stage 1 for flightchannels"
},
"failsafeRxMinUsecItem": {
"message": "Minimum length"
},
"failsafeRxMaxUsecItem": {
"message": "Maximum length"
},
"failsafeChannelFallbackSettingsTitle": {
"message": "Channel Fallback Settings"
},
"failsafeChannelFallbackSettingsHelp": {
"message": "These settings are applied to invalid individual AUX channels or to all channels when entering stage 1. <strong>Note:</strong> values are saved in steps of 25usec, so small changes disappear"
},
"failsafeStageTwoSettingsTitle": {
"message": "Stage 2 - Settings"
},
"failsafeFeatureItem": {
"message": "Failsafe Stage 2 enabled"
},
"failsafeFeatureHelp": {
"message": "<strong>Note:</strong> When Stage 2 is DISABLED, the fallback setting <strong>Auto</strong> is used instead of the user settings for all flightchannels (Roll, Pitch, Yaw and Throttle)."
},
"failsafeDelayItem": {
"message": "Guard time for stage 2 activation after signal lost [1 = 0.1 sec.]"
},
"failsafeDelayHelp": {
"message": "Time for stage 1 to wait for recovery"
},
"failsafeThrottleLowItem": {
"message": "Failsafe Throttle Low Delay [1 = 0.1 sec.]"
},
"failsafeThrottleLowHelp": {
"message": "Just disarm the craft instead of executing the selected failsafe procedure when the throttle was low for this amount of time"
},
"failsafeThrottleItem": {
"message": "Throttle value used while landing"
},
"failsafeOffDelayItem": {
"message": "Delay for turning off the Motors during Failsafe [1 = 0.1 sec.]"
},
"failsafeOffDelayHelp": {
"message": "Time to stay in landing mode untill the motors are turned off and the craft is disarmed"
},
"failsafeSubTitle1": {
"message": "Stage 2 - Failsafe Procedure"
},
"failsafeProcedureItemSelect1": {
"message": "Land"
},
"failsafeProcedureItemSelect2": {
"message": "Drop"
},
"failsafeKillSwitchItem": {
"message": "Failsafe Kill Switch (setup Failsafe in Modes Tab)"
},
"failsafeKillSwitchHelp": {
"message": "Set this option to make the failsafe switch, configured in the modes tab, act as a direct kill switch, bypassing the selected failsafe procedure. <strong>Note:</strong> Arming is blocked with the failsafe kill switch in the ON position"
}
}
}

View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="-173 349.9 264.9 95.1" style="enable-background:new -173 349.9 264.9 95.1;" xml:space="preserve">
<style type="text/css">
.st0{fill:#71B221;}
.st1{fill:none;}
.st2{enable-background:new ;}
.st3{fill:none;stroke:#1B171B;stroke-miterlimit:10;}
.st4{fill:#1B171B;}
.st5{fill:#B8B8B9;}
</style>
<g>
<path class="st0" d="M-157.2,418.3c-4.7,0-8.5,3.8-8.5,8.5c0,4.7,5.2,8.6,8.5,11.6c2.7-2.7,8.5-7,8.5-11.6
C-148.7,422.1-152.5,418.3-157.2,418.3z M-153.9,429.9h-1.9v-2.2h-2.9v2.2h-1.9v-6.2h1.9v2.2h2.9v-2.2h1.9V429.9z"/>
<g>
<rect x="16.7" y="382" class="st1" width="67.5" height="13.5"/>
<g class="st2">
<path d="M26.1,387.5c0,1.6-0.4,2.9-1.3,3.8c-0.9,0.9-2.2,1.3-3.9,1.3h-2.8v-10h3.1c1.6,0,2.8,0.4,3.6,1.3S26.1,386,26.1,387.5z
M24.9,387.6c0-1.3-0.3-2.3-1-2.9c-0.7-0.7-1.6-1-2.9-1h-1.7v8h1.4c1.4,0,2.4-0.3,3.1-1C24.5,389.9,24.9,388.9,24.9,387.6z"/>
<path d="M31.6,385c0.3,0,0.6,0,0.9,0.1l-0.2,1.1c-0.3-0.1-0.6-0.1-0.8-0.1c-0.6,0-1.1,0.2-1.6,0.7s-0.6,1.1-0.6,1.8v4h-1.1v-7.5
h0.9l0.1,1.4h0.1c0.3-0.5,0.6-0.9,1-1.1C30.7,385.1,31.1,385,31.6,385z"/>
<path d="M40.3,388.9c0,1.2-0.3,2.2-0.9,2.9c-0.6,0.7-1.5,1-2.5,1c-0.7,0-1.3-0.2-1.8-0.5s-0.9-0.8-1.2-1.4
c-0.3-0.6-0.4-1.3-0.4-2.1c0-1.2,0.3-2.2,0.9-2.9c0.6-0.7,1.5-1,2.5-1c1,0,1.9,0.3,2.5,1C40,386.7,40.3,387.7,40.3,388.9z
M34.6,388.9c0,1,0.2,1.7,0.6,2.2s0.9,0.8,1.7,0.8c0.7,0,1.3-0.2,1.7-0.7c0.4-0.5,0.6-1.2,0.6-2.2c0-1-0.2-1.7-0.6-2.2
c-0.4-0.5-1-0.7-1.7-0.7c-0.7,0-1.3,0.2-1.7,0.7C34.8,387.2,34.6,387.9,34.6,388.9z"/>
<path d="M45.8,392.8c-0.5,0-0.9-0.1-1.3-0.3c-0.4-0.2-0.7-0.5-1-0.8h-0.1c0.1,0.4,0.1,0.9,0.1,1.2v3.1h-1.1v-10.9h0.9l0.2,1h0.1
c0.3-0.4,0.6-0.7,1-0.9c0.4-0.2,0.8-0.3,1.3-0.3c1,0,1.8,0.3,2.3,1s0.8,1.6,0.8,2.9c0,1.2-0.3,2.2-0.8,2.9
C47.5,392.4,46.8,392.8,45.8,392.8z M45.6,386c-0.8,0-1.3,0.2-1.7,0.6s-0.5,1.1-0.5,2v0.3c0,1.1,0.2,1.8,0.5,2.3
c0.4,0.5,0.9,0.7,1.7,0.7c0.6,0,1.2-0.3,1.5-0.8c0.4-0.5,0.5-1.2,0.5-2.2c0-0.9-0.2-1.7-0.5-2.1C46.8,386.2,46.3,386,45.6,386z"
/>
</g>
<line class="st3" x1="-167.8" y1="441.3" x2="87.2" y2="441.3"/>
<polygon points="78.7,432.6 65.4,436.2 74.7,411.2 53.4,439.9 23.4,435.2 42.7,441.2 70.1,441.2 "/>
<g>
<g>
<path class="st0" d="M51.9,428.6c-2.5-0.9-5.1,0-6.7,1.9l-22.1-7.7l-1.3,3.8l22.1,7.7c0,2.5,1.5,4.8,4,5.6
c3.1,1.1,6.6-0.6,7.6-3.7C56.5,433.1,55.1,429.7,51.9,428.6z"/>
<path class="st4" d="M12.9,407.5c-6.8-2.4-14.1-0.1-18.4,5.2l-20.7-7.2c0-2.5-1.6-4.8-4-5.6c-3.1-1.1-6.6,0.6-7.6,3.7
c-1.1,3.1,0.6,6.6,3.7,7.6c2.5,0.9,5.1,0,6.7-1.9l19.8,6.9l30.1,10.5l1.2,0.4C25.5,418.9,21,410.4,12.9,407.5z"/>
</g>
<rect x="-52.9" y="396.3" transform="matrix(0.944 0.3299 -0.3299 0.944 129.5555 32.1182)" class="st5" width="46" height="2.9"/>
<rect x="28.8" y="424.9" transform="matrix(0.944 0.3299 -0.3299 0.944 143.564 6.7675)" class="st5" width="46" height="2.9"/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="-173 349.9 264.9 95.1" style="enable-background:new -173 349.9 264.9 95.1;" xml:space="preserve">
<style type="text/css">
.st0{fill:#71B221;}
.st1{fill:#1B171B;}
.st2{fill:#B8B8B9;}
.st3{fill:none;}
.st4{enable-background:new ;}
.st5{fill:none;stroke:#71B221;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:8,8;}
.st6{fill:none;stroke:#1B171B;stroke-miterlimit:10;}
</style>
<g>
<g>
<g>
<g>
<path class="st0" d="M63.1,374.8c-2.6,0-4.8,1.7-5.7,4H34v4h23.4c0.8,2.3,3,4,5.7,4c3.3,0,6-2.7,6-6
C69.1,377.5,66.4,374.8,63.1,374.8z"/>
<path class="st1" d="M19.2,367.8c-7.2,0-13.3,4.6-15.6,11h-21.9c-0.8-2.3-3-4-5.7-4c-3.3,0-6,2.7-6,6s2.7,6,6,6
c2.6,0,4.8-1.7,5.7-4h21h31.8h1.2C35,374.3,27.9,367.8,19.2,367.8z"/>
</g>
<rect x="-47.3" y="371.3" class="st2" width="46" height="2.9"/>
<rect x="39.2" y="371.3" class="st2" width="46" height="2.9"/>
</g>
<rect x="26.7" y="401.5" class="st3" width="67.5" height="13.5"/>
<g class="st4">
<path d="M28.1,412.1v-10h1.2v8.9h4.4v1.1H28.1z"/>
<path d="M39.8,412.1l-0.2-1.1h-0.1c-0.4,0.5-0.7,0.8-1.1,1c-0.4,0.2-0.8,0.2-1.4,0.2c-0.7,0-1.3-0.2-1.7-0.6
c-0.4-0.4-0.6-0.9-0.6-1.6c0-1.5,1.2-2.3,3.6-2.4l1.3,0v-0.5c0-0.6-0.1-1-0.4-1.3c-0.3-0.3-0.7-0.4-1.2-0.4
c-0.6,0-1.3,0.2-2.1,0.6l-0.3-0.9c0.4-0.2,0.8-0.4,1.2-0.5c0.4-0.1,0.9-0.2,1.3-0.2c0.9,0,1.6,0.2,2,0.6s0.6,1,0.6,1.9v5.1H39.8z
M37.2,411.3c0.7,0,1.3-0.2,1.7-0.6s0.6-0.9,0.6-1.6v-0.7l-1.1,0c-0.9,0-1.6,0.2-2,0.4c-0.4,0.2-0.6,0.6-0.6,1.2
c0,0.4,0.1,0.7,0.4,0.9C36.5,411.2,36.8,411.3,37.2,411.3z"/>
<path d="M48.1,412.1v-4.8c0-0.6-0.1-1.1-0.4-1.4c-0.3-0.3-0.7-0.5-1.3-0.5c-0.8,0-1.4,0.2-1.7,0.6c-0.4,0.4-0.5,1.1-0.5,2.1v3.9
H43v-7.5h0.9l0.2,1h0.1c0.2-0.4,0.6-0.7,1-0.9c0.4-0.2,0.9-0.3,1.4-0.3c0.9,0,1.6,0.2,2,0.7c0.5,0.4,0.7,1.1,0.7,2.1v4.9H48.1z"
/>
<path d="M56.7,411.1L56.7,411.1c-0.6,0.8-1.4,1.1-2.4,1.1c-1,0-1.7-0.3-2.3-1c-0.5-0.7-0.8-1.6-0.8-2.9s0.3-2.2,0.8-2.9
s1.3-1,2.3-1c1,0,1.8,0.4,2.3,1.1h0.1l0-0.5l0-0.5v-3h1.1v10.6h-0.9L56.7,411.1z M54.4,411.3c0.8,0,1.3-0.2,1.7-0.6
c0.3-0.4,0.5-1.1,0.5-2v-0.2c0-1.1-0.2-1.8-0.5-2.3c-0.4-0.5-0.9-0.7-1.7-0.7c-0.7,0-1.2,0.3-1.5,0.8c-0.4,0.5-0.5,1.2-0.5,2.2
c0,1,0.2,1.7,0.5,2.2C53.2,411.1,53.7,411.3,54.4,411.3z"/>
</g>
<g>
<path class="st0" d="M23.1,432.6L23.1,432.6c0.2-0.2,0.3-0.4,0.3-0.7c0-0.6-0.5-1-1-1c-0.3,0-0.6,0.1-0.7,0.3l0,0l-3,3.3l-3-3.3
l0,0c-0.2-0.2-0.5-0.3-0.7-0.3c-0.6,0-1,0.5-1,1c0,0.3,0.1,0.5,0.3,0.7l0,0l3.7,4.1c0.2,0.2,0.5,0.3,0.8,0.3s0.6-0.1,0.8-0.3
L23.1,432.6z"/>
<line class="st5" x1="18.6" y1="392" x2="18.6" y2="430"/>
</g>
<line class="st6" x1="-167.8" y1="441.3" x2="87.2" y2="441.3"/>
</g>
<path class="st0" d="M-157.2,420.1c-4.7,0-8.5,3.8-8.5,8.5c0,4.7,5.2,8.6,8.5,11.6c2.7-2.7,8.5-7,8.5-11.6
C-148.7,423.9-152.5,420.1-157.2,420.1z M-153.9,431.7h-1.9v-2.2h-2.9v2.2h-1.9v-6.2h1.9v2.2h2.9v-2.2h1.9V431.7z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="-173 349.9 264.9 95.1" style="enable-background:new -173 349.9 264.9 95.1;" xml:space="preserve">
<style type="text/css">
.st0{fill:#71B221;}
.st1{fill:#1B171B;}
.st2{fill:#B8B8B9;}
.st3{fill:none;}
.st4{enable-background:new ;}
.st5{fill:none;stroke:#71B221;stroke-width:2;stroke-linecap:round;stroke-miterlimit:10;}
.st6{fill:none;stroke:#1B171B;stroke-miterlimit:10;}
</style>
<g>
<g>
<g>
<g>
<path class="st0" d="M63.1,374.7c-2.6,0-4.8,1.7-5.7,4H34v4h23.4c0.8,2.3,3,4,5.7,4c3.3,0,6-2.7,6-6
C69.1,377.4,66.4,374.7,63.1,374.7z"/>
<path class="st1" d="M19.2,367.7c-7.2,0-13.3,4.6-15.6,11h-21.9c-0.8-2.3-3-4-5.7-4c-3.3,0-6,2.7-6,6c0,3.3,2.7,6,6,6
c2.6,0,4.8-1.7,5.7-4h21h31.8h1.2C35,374.3,27.9,367.7,19.2,367.7z"/>
</g>
<rect x="-47.3" y="371.2" class="st2" width="46" height="2.9"/>
<rect x="39.2" y="371.2" class="st2" width="46" height="2.9"/>
</g>
<rect x="26.7" y="401.5" class="st3" width="67.5" height="13.5"/>
<g class="st4">
<path d="M35.7,412.1h-1.2v-4.7h-5.3v4.7h-1.2v-10h1.2v4.3h5.3v-4.3h1.2V412.1z"/>
<path d="M44.7,408.3c0,1.2-0.3,2.2-0.9,2.9c-0.6,0.7-1.5,1-2.5,1c-0.7,0-1.3-0.2-1.8-0.5s-0.9-0.8-1.2-1.4
c-0.3-0.6-0.4-1.3-0.4-2.1c0-1.2,0.3-2.2,0.9-2.9c0.6-0.7,1.5-1,2.5-1c1,0,1.9,0.3,2.5,1C44.4,406.2,44.7,407.2,44.7,408.3z
M39,408.3c0,1,0.2,1.7,0.6,2.2c0.4,0.5,0.9,0.8,1.7,0.8c0.7,0,1.3-0.2,1.7-0.8c0.4-0.5,0.6-1.2,0.6-2.2c0-1-0.2-1.7-0.6-2.2
c-0.4-0.5-1-0.7-1.7-0.7c-0.7,0-1.3,0.2-1.7,0.7C39.2,406.7,39,407.4,39,408.3z"/>
<path d="M48.4,412.1l-2.8-7.5h1.2l1.6,4.4c0.4,1,0.6,1.7,0.6,2H49c0.1-0.2,0.2-0.7,0.5-1.5c0.3-0.8,0.9-2.4,1.8-5h1.2l-2.8,7.5
H48.4z"/>
<path d="M56.9,412.2c-1.1,0-2-0.3-2.6-1c-0.6-0.7-1-1.6-1-2.8c0-1.2,0.3-2.2,0.9-2.9s1.4-1.1,2.4-1.1c0.9,0,1.7,0.3,2.2,0.9
c0.5,0.6,0.8,1.4,0.8,2.4v0.7h-5.2c0,0.9,0.2,1.5,0.7,2c0.4,0.5,1,0.7,1.8,0.7c0.8,0,1.6-0.2,2.4-0.5v1c-0.4,0.2-0.8,0.3-1.1,0.4
C57.8,412.2,57.4,412.2,56.9,412.2z M56.6,405.4c-0.6,0-1.1,0.2-1.4,0.6c-0.4,0.4-0.6,0.9-0.6,1.6h3.9c0-0.7-0.2-1.3-0.5-1.6
C57.6,405.6,57.2,405.4,56.6,405.4z"/>
<path d="M65,404.5c0.3,0,0.6,0,0.9,0.1l-0.2,1.1c-0.3-0.1-0.6-0.1-0.8-0.1c-0.6,0-1.1,0.2-1.6,0.7s-0.6,1.1-0.6,1.8v4h-1.1v-7.5
h0.9l0.1,1.4h0.1c0.3-0.5,0.6-0.9,1-1.1C64.1,404.6,64.5,404.5,65,404.5z"/>
</g>
<g>
<path class="st0" d="M23.1,432.5L23.1,432.5c0.2-0.2,0.3-0.4,0.3-0.7c0-0.6-0.5-1-1-1c-0.3,0-0.6,0.1-0.7,0.3l0,0l-3,3.3l-3-3.3
l0,0c-0.2-0.2-0.5-0.3-0.7-0.3c-0.6,0-1,0.5-1,1c0,0.3,0.1,0.5,0.3,0.7l0,0l3.7,4.1c0.2,0.2,0.5,0.3,0.8,0.3s0.6-0.1,0.8-0.3
L23.1,432.5z"/>
<path class="st0" d="M14.2,389.2L14.2,389.2c-0.2,0.2-0.3,0.4-0.3,0.7c0,0.6,0.5,1,1,1c0.3,0,0.6-0.1,0.7-0.3l0,0l3-3.3l3,3.3
l0,0c0.2,0.2,0.5,0.3,0.7,0.3c0.6,0,1-0.5,1-1c0-0.3-0.1-0.5-0.3-0.7l0,0l-3.7-4.1c-0.2-0.2-0.5-0.3-0.8-0.3s-0.6,0.1-0.8,0.3
L14.2,389.2z"/>
<line class="st5" x1="18.6" y1="392" x2="18.6" y2="430"/>
</g>
<line class="st6" x1="-167.8" y1="441.2" x2="87.2" y2="441.2"/>
</g>
<path class="st0" d="M-157.2,419.8c-4.7,0-8.5,3.8-8.5,8.5c0,4.7,5.2,8.6,8.5,11.6c2.7-2.7,8.5-7,8.5-11.6
C-148.7,423.6-152.5,419.8-157.2,419.8z M-153.9,431.5h-1.9v-2.2h-2.9v2.2h-1.9v-6.2h1.9v2.2h2.9v-2.2h1.9V431.5z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="-173 349.9 264.9 95.1" style="enable-background:new -173 349.9 264.9 95.1;" xml:space="preserve">
<style type="text/css">
.st0{fill:#71B221;}
.st1{fill:#1B171B;}
.st2{fill:#B8B8B9;}
.st3{fill:none;}
.st4{enable-background:new ;}
.st5{fill:none;stroke:#71B221;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}
.st6{fill:none;stroke:#71B221;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:7.4103,7.4103;}
.st7{fill:none;stroke:#71B221;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:7.7778,7.7778;}
.st8{fill:none;stroke:#1B171B;stroke-miterlimit:10;}
</style>
<g>
<path class="st0" d="M-152.8,414.3L-152.8,414.3c0.2-0.2,0.3-0.4,0.3-0.7c0-0.6-0.5-1-1-1c-0.3,0-0.6,0.1-0.7,0.3l0,0l-3,3.3
l-3-3.3l0,0c-0.2-0.2-0.5-0.3-0.7-0.3c-0.6,0-1,0.5-1,1c0,0.3,0.1,0.5,0.3,0.7l0,0l3.7,4.1c0.2,0.2,0.5,0.3,0.8,0.3
s0.6-0.1,0.8-0.3L-152.8,414.3z"/>
<g>
<g>
<path class="st0" d="M-25.1,375.5c2.6,0,4.8,1.7,5.7,4H4v4h-23.4c-0.8,2.3-3,4-5.7,4c-3.3,0-6-2.7-6-6
C-31.1,378.2-28.4,375.5-25.1,375.5z"/>
<path class="st1" d="M18.7,368.5c7.2,0,13.3,4.6,15.6,11h21.9c0.8-2.3,3-4,5.7-4c3.3,0,6,2.7,6,6s-2.7,6-6,6
c-2.6,0-4.8-1.7-5.7-4h-21H3.4H2.2C3,375.1,10.1,368.5,18.7,368.5z"/>
</g>
<rect x="39.2" y="372" class="st2" width="46" height="2.9"/>
<rect x="-47.3" y="372" class="st2" width="46" height="2.9"/>
</g>
<rect x="-131" y="396.2" class="st3" width="86.5" height="32.1"/>
<g class="st4">
<path d="M-128.5,402.7v4.2h-1.2v-10h2.7c1.2,0,2.1,0.2,2.7,0.7s0.9,1.2,0.9,2.1c0,1.3-0.7,2.2-2,2.7l2.7,4.5h-1.4l-2.4-4.2
L-128.5,402.7L-128.5,402.7z M-128.5,401.7h1.6c0.8,0,1.4-0.2,1.8-0.5s0.6-0.8,0.6-1.5s-0.2-1.1-0.6-1.4s-1-0.4-1.9-0.4h-1.5
V401.7z"/>
<path d="M-118,407c-1.1,0-2-0.3-2.6-1s-1-1.6-1-2.8c0-1.2,0.3-2.2,0.9-2.9s1.4-1.1,2.4-1.1c0.9,0,1.7,0.3,2.2,0.9s0.8,1.4,0.8,2.4
v0.7h-5.2c0,0.9,0.2,1.5,0.7,2s1,0.7,1.8,0.7s1.6-0.2,2.4-0.5v1c-0.4,0.2-0.8,0.3-1.1,0.4C-117.1,407-117.5,407-118,407z
M-118.3,400.2c-0.6,0-1.1,0.2-1.4,0.6s-0.6,0.9-0.6,1.6h3.9c0-0.7-0.2-1.3-0.5-1.6C-117.3,400.4-117.7,400.2-118.3,400.2z"/>
<path d="M-110.9,406.1c0.2,0,0.4,0,0.6,0s0.3-0.1,0.4-0.1v0.9c-0.1,0.1-0.3,0.1-0.5,0.1s-0.5,0.1-0.6,0.1c-1.4,0-2.2-0.8-2.2-2.3
v-4.5h-1.1v-0.5l1.1-0.5l0.5-1.6h0.7v1.7h2.2v0.9h-2.2v4.4c0,0.5,0.1,0.8,0.3,1S-111.3,406.1-110.9,406.1z"/>
<path d="M-107.3,399.4v4.9c0,0.6,0.1,1.1,0.4,1.4s0.7,0.5,1.3,0.5c0.8,0,1.4-0.2,1.7-0.6s0.5-1.1,0.5-2.1v-3.9h1.1v7.5h-0.9
l-0.2-1h-0.1c-0.2,0.4-0.6,0.7-1,0.8s-0.9,0.3-1.4,0.3c-0.9,0-1.6-0.2-2-0.6s-0.7-1.1-0.7-2.1v-4.9h1.3V399.4z"/>
<path d="M-96.4,399.2c0.3,0,0.6,0,0.9,0.1l-0.2,1.1c-0.3-0.1-0.6-0.1-0.8-0.1c-0.6,0-1.1,0.2-1.6,0.7s-0.6,1.1-0.6,1.8v4h-1.1
v-7.5h0.9l0.1,1.4h0.1c0.3-0.5,0.6-0.9,1-1.1S-96.8,399.2-96.4,399.2z"/>
<path d="M-88.9,406.9v-4.8c0-0.6-0.1-1.1-0.4-1.4s-0.7-0.5-1.3-0.5c-0.8,0-1.4,0.2-1.7,0.6s-0.5,1.1-0.5,2.1v3.9h-1.1v-7.5h0.9
l0.2,1h0.1c0.2-0.4,0.6-0.7,1-0.9c0.4-0.2,0.9-0.3,1.4-0.3c0.9,0,1.6,0.2,2,0.7c0.5,0.4,0.7,1.1,0.7,2.1v4.9L-88.9,406.9
L-88.9,406.9z"/>
<path d="M-79.4,406.1c0.2,0,0.4,0,0.6,0s0.3-0.1,0.4-0.1v0.9c-0.1,0.1-0.3,0.1-0.5,0.1s-0.5,0.1-0.6,0.1c-1.4,0-2.2-0.8-2.2-2.3
v-4.5h-1.1v-0.5l1.1-0.5l0.5-1.6h0.7v1.7h2.2v0.9h-2.2v4.4c0,0.5,0.1,0.8,0.3,1S-79.8,406.1-79.4,406.1z"/>
<path d="M-70.4,403.1c0,1.2-0.3,2.2-0.9,2.9c-0.6,0.7-1.5,1-2.5,1c-0.7,0-1.3-0.2-1.8-0.5s-0.9-0.8-1.2-1.4s-0.4-1.3-0.4-2.1
c0-1.2,0.3-2.2,0.9-2.9c0.6-0.7,1.5-1,2.5-1s1.9,0.3,2.5,1S-70.4,401.9-70.4,403.1z M-76.1,403.1c0,1,0.2,1.7,0.6,2.2
s0.9,0.8,1.7,0.8s1.3-0.2,1.7-0.7c0.4-0.5,0.6-1.2,0.6-2.2s-0.2-1.7-0.6-2.2s-1-0.7-1.7-0.7s-1.3,0.2-1.7,0.7
S-76.1,402.1-76.1,403.1z"/>
</g>
<g class="st4">
<path d="M-122.1,423.7h-1.2V419h-5.3v4.7h-1.2v-10h1.2v4.3h5.3v-4.3h1.2C-122.1,413.7-122.1,423.7-122.1,423.7z"/>
<path d="M-113,419.9c0,1.2-0.3,2.2-0.9,2.9c-0.6,0.7-1.5,1-2.5,1c-0.7,0-1.3-0.2-1.8-0.5s-0.9-0.8-1.2-1.4s-0.4-1.3-0.4-2.1
c0-1.2,0.3-2.2,0.9-2.9c0.6-0.7,1.5-1,2.5-1s1.9,0.3,2.5,1S-113,418.7-113,419.9z M-118.7,419.9c0,1,0.2,1.7,0.6,2.2
s0.9,0.8,1.7,0.8s1.3-0.2,1.7-0.7c0.4-0.5,0.6-1.2,0.6-2.2s-0.2-1.7-0.6-2.2s-1-0.7-1.7-0.7s-1.3,0.2-1.7,0.7
S-118.7,418.9-118.7,419.9z"/>
<path d="M-101.5,423.7v-4.9c0-0.6-0.1-1-0.4-1.3s-0.7-0.4-1.2-0.4c-0.7,0-1.2,0.2-1.6,0.6s-0.5,1-0.5,1.9v4.2h-1.1v-4.9
c0-0.6-0.1-1-0.4-1.3s-0.7-0.4-1.2-0.4c-0.7,0-1.2,0.2-1.6,0.6c-0.3,0.4-0.5,1.1-0.5,2.1v3.9h-1.1v-7.5h0.9l0.2,1h0.1
c0.2-0.4,0.5-0.6,0.9-0.9s0.8-0.3,1.3-0.3c1.2,0,1.9,0.4,2.3,1.3h0.1c0.2-0.4,0.5-0.7,1-0.9s0.9-0.3,1.4-0.3
c0.8,0,1.5,0.2,1.9,0.7c0.4,0.4,0.6,1.1,0.6,2.1v4.9h-1.1V423.7z"/>
<path d="M-94.8,423.8c-1.1,0-2-0.3-2.6-1s-1-1.6-1-2.8c0-1.2,0.3-2.2,0.9-2.9s1.4-1.1,2.4-1.1c0.9,0,1.7,0.3,2.2,0.9
s0.8,1.4,0.8,2.4v0.7h-5.2c0,0.9,0.2,1.5,0.7,2s1,0.7,1.8,0.7s1.6-0.2,2.4-0.5v1c-0.4,0.2-0.8,0.3-1.1,0.4
C-93.9,423.8-94.3,423.8-94.8,423.8z M-95.1,417c-0.6,0-1.1,0.2-1.4,0.6s-0.6,0.9-0.6,1.6h3.9c0-0.7-0.2-1.3-0.5-1.6
C-94.1,417.2-94.6,417-95.1,417z"/>
</g>
<g>
<g>
<line class="st5" x1="-52.9" y1="379.2" x2="-56.9" y2="379.2"/>
<line class="st6" x1="-64.3" y1="379.2" x2="-149.6" y2="379.2"/>
<polyline class="st5" points="-153.3,379.2 -157.3,379.2 -157.3,383.2 "/>
<line class="st7" x1="-157.3" y1="391" x2="-157.3" y2="402.6"/>
<line class="st5" x1="-157.3" y1="406.5" x2="-157.3" y2="410.5"/>
</g>
</g>
<line class="st8" x1="-167.8" y1="442" x2="87.2" y2="442"/>
<path class="st0" d="M-157.2,420.6c-4.7,0-8.5,3.8-8.5,8.5s5.2,8.6,8.5,11.6c2.7-2.7,8.5-7,8.5-11.6
C-148.7,424.4-152.5,420.6-157.2,420.6z M-153.9,432.2h-1.9V430h-2.9v2.2h-1.9V426h1.9v2.2h2.9V426h1.9V432.2z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="141.7px" height="141.7px" viewBox="0 0 141.7 141.7" enable-background="new 0 0 141.7 141.7" xml:space="preserve">
<g>
<path fill="#818181" d="M70.9,130l60.9-61.9c0.8-0.8,1.2-1.9,1.1-3h0c-4.2-30.5-30.4-54.1-62-54.1c-31.5,0-57.7,23.5-62,53.8
c0,0,0,0.1,0,0.1c0,0,0,0.1,0,0.1h0c-0.1,1,0.3,2.1,1.1,2.9l42.9,43.8 M79,111.2l14.8-49.6c3.3-4.7,8.7-7.8,14.9-7.8
c7.2,0,13.4,4.2,16.4,10.3L79,111.2z M55.7,62c3.2-4.9,8.8-8.2,15.2-8.2c6.2,0,11.7,3.1,15,7.9l-14.9,50L55.7,62z M16.5,63.8
c3-6,9.1-10.1,16.2-10.1c6.2,0,11.7,3.1,14.9,7.8l15.1,49.4L16.5,63.8z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 844 B

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="141.7px" height="141.7px" viewBox="0 0 141.7 141.7" enable-background="new 0 0 141.7 141.7" xml:space="preserve">
<g>
<path fill="#FFFFFF" d="M70.9,130l60.9-61.9c0.8-0.8,1.2-1.9,1.1-3h0c-4.2-30.5-30.4-54.1-62-54.1c-31.5,0-57.7,23.5-62,53.8
c0,0,0,0.1,0,0.1c0,0,0,0.1,0,0.1h0c-0.1,1,0.3,2.1,1.1,2.9l42.9,43.8 M79,111.2l14.8-49.6c3.3-4.7,8.7-7.8,14.9-7.8
c7.2,0,13.4,4.2,16.4,10.3L79,111.2z M55.7,62c3.2-4.9,8.8-8.2,15.2-8.2c6.2,0,11.7,3.1,15,7.9l-14.9,50L55.7,62z M16.5,63.8
c3-6,9.1-10.1,16.2-10.1c6.2,0,11.7,3.1,14.9,7.8l15.1,49.4L16.5,63.8z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 844 B

View File

@ -99,6 +99,11 @@ function configuration_backup(callback) {
if (semver.gte(CONFIG.apiVersion, "1.14.0")) {
uniqueData.push(MSP_codes.MSP_3D);
}
if (semver.gte(CONFIG.apiVersion, "1.15.0")) {
uniqueData.push(MSP_codes.MSP_RX_CONFIG);
uniqueData.push(MSP_codes.MSP_FAILSAFE_CONFIG);
uniqueData.push(MSP_codes.MSP_RXFAIL_CONFIG);
}
}
update_unique_data_list();
@ -126,6 +131,11 @@ function configuration_backup(callback) {
if (semver.gte(CONFIG.apiVersion, "1.14.0")) {
configuration._3D = jQuery.extend(true, {}, _3D);
}
if (semver.gte(CONFIG.apiVersion, "1.15.0")) {
configuration.RX_CONFIG = jQuery.extend(true, {}, RX_CONFIG);
configuration.FAILSAFE_CONFIG = jQuery.extend(true, {}, FAILSAFE_CONFIG);
configuration.RXFAIL_CONFIG = jQuery.extend(true, [], RXFAIL_CONFIG);
}
save();
}
@ -507,6 +517,52 @@ function configuration_restore(callback) {
appliedMigrationsCount++;
}
if (compareVersions(migratedVersion, '0.66.0') && !compareVersions(configuration.apiVersion, '1.15.0')) {
// api 1.15 exposes RX_CONFIG, FAILSAFE_CONFIG and RXFAIL_CONFIG configuration
if (configuration.RX_CONFIG == undefined) {
configuration.RX_CONFIG = {
serialrx_provider: 0,
spektrum_sat_bind: 0,
midrc: 1500,
mincheck: 1100,
maxcheck: 1900,
rx_min_usec: 885,
rx_max_usec: 2115
};
}
if (configuration.FAILSAFE_CONFIG == undefined) {
configuration.FAILSAFE_CONFIG = {
failsafe_delay: 10,
failsafe_off_delay: 200,
failsafe_throttle: 1000,
failsafe_kill_switch: 0,
failsafe_throttle_low_delay: 100,
failsafe_procedure: 0
};
}
if (configuration.RXFAIL_CONFIG == undefined) {
configuration.RXFAIL_CONFIG = [
{mode: 0, value: 1500},
{mode: 0, value: 1500},
{mode: 0, value: 1500},
{mode: 0, value: 875}
];
for (var i = 0; i < 14; i++) {
var rxfailChannel = {
mode: 1,
value: 1500
};
configuration.RXFAIL_CONFIG.push(rxfailChannel);
}
}
appliedMigrationsCount++;
}
if (appliedMigrationsCount > 0) {
GUI.log(chrome.i18n.getMessage('configMigrationSuccessful', [appliedMigrationsCount]));
}
@ -617,6 +673,11 @@ function configuration_restore(callback) {
if (semver.gte(CONFIG.apiVersion, "1.14.0")) {
uniqueData.push(MSP_codes.MSP_SET_3D);
}
if (semver.gte(CONFIG.apiVersion, "1.15.0")) {
uniqueData.push(MSP_codes.MSP_SET_RX_CONFIG);
uniqueData.push(MSP_codes.MSP_SET_FAILSAFE_CONFIG);
uniqueData.push(MSP_codes.MSP_SET_RXFAIL_CONFIG);
}
}
function load_objects() {
@ -628,6 +689,9 @@ function configuration_restore(callback) {
ARMING_CONFIG = configuration.ARMING_CONFIG;
FC_CONFIG = configuration.FC_CONFIG;
_3D = configuration._3D;
RX_CONFIG = configuration.RX_CONFIG;
FAILSAFE_CONFIG = configuration.FAILSAFE_CONFIG;
RXFAIL_CONFIG = configuration.RXFAIL_CONFIG;
}
function send_unique_data_item() {
@ -676,4 +740,4 @@ function configuration_restore(callback) {
upload();
}
}
}

View File

@ -178,3 +178,24 @@ var DATAFLASH = {
totalSize: 0,
usedSize: 0
};
var RX_CONFIG = {
serialrx_provider: 0,
maxcheck: 0,
midrc: 0,
mincheck: 0,
spektrum_sat_bind: 0,
rx_min_usec: 0,
rx_max_usec: 0
};
var FAILSAFE_CONFIG = {
failsafe_delay: 0,
failsafe_off_delay: 0,
failsafe_throttle: 0,
failsafe_kill_switch: 0,
failsafe_throttle_low_delay: 0,
failsafe_procedure: 0
};
var RXFAIL_CONFIG = [];

View File

@ -18,6 +18,7 @@ var GUI_control = function () {
'help'
];
this.defaultAllowedTabsWhenConnected = [
'failsafe',
'adjustments',
'auxiliary',
'cli',

102
js/msp.js
View File

@ -13,6 +13,8 @@ var MSP_codes = {
MSP_SET_CHANNEL_FORWARDING: 33,
MSP_MODE_RANGES: 34,
MSP_SET_MODE_RANGE: 35,
MSP_RX_CONFIG: 44,
MSP_SET_RX_CONFIG: 45,
MSP_LED_STRIP_CONFIG: 48,
MSP_SET_LED_STRIP_CONFIG: 49,
MSP_ADJUSTMENT_RANGES: 52,
@ -29,6 +31,10 @@ var MSP_codes = {
MSP_DATAFLASH_ERASE: 72,
MSP_LOOP_TIME: 73,
MSP_SET_LOOP_TIME: 74,
MSP_FAILSAFE_CONFIG: 75,
MSP_SET_FAILSAFE_CONFIG: 76,
MSP_RXFAIL_CONFIG: 77,
MSP_SET_RXFAIL_CONFIG: 78,
// Multiwii MSP commands
MSP_IDENT: 100,
@ -755,6 +761,7 @@ var MSP = {
ADJUSTMENT_RANGES.push(adjustmentRange);
}
break;
case MSP_codes.MSP_CHANNEL_FORWARDING:
for (var i = 0; i < data.byteLength && i < SERVO_CONFIG.length; i ++) {
var channelIndex = data.getUint8(i);
@ -766,6 +773,56 @@ var MSP = {
}
break;
case MSP_codes.MSP_RX_CONFIG:
var offset = 0;
RX_CONFIG.serialrx_provider = data.getUint8(offset, 1);
offset++;
RX_CONFIG.maxcheck = data.getUint16(offset, 1);
offset += 2;
RX_CONFIG.midrc = data.getUint16(offset, 1);
offset += 2;
RX_CONFIG.mincheck = data.getUint16(offset, 1);
offset += 2;
RX_CONFIG.spektrum_sat_bind = data.getUint8(offset, 1);
offset++;
RX_CONFIG.rx_min_usec = data.getUint16(offset, 1);
offset += 2;
RX_CONFIG.rx_max_usec = data.getUint16(offset, 1);
offset += 2;
break;
case MSP_codes.MSP_FAILSAFE_CONFIG:
var offset = 0;
FAILSAFE_CONFIG.failsafe_delay = data.getUint8(offset, 1);
offset++;
FAILSAFE_CONFIG.failsafe_off_delay = data.getUint8(offset, 1);
offset++;
FAILSAFE_CONFIG.failsafe_throttle = data.getUint16(offset, 1);
offset += 2;
FAILSAFE_CONFIG.failsafe_kill_switch = data.getUint8(offset, 1);
offset++;
FAILSAFE_CONFIG.failsafe_throttle_low_delay = data.getUint16(offset, 1);
offset += 2;
FAILSAFE_CONFIG.failsafe_procedure = data.getUint8(offset, 1);
offset++;
break;
case MSP_codes.MSP_RXFAIL_CONFIG:
RXFAIL_CONFIG = []; // empty the array as new data is coming in
var channelCount = data.byteLength / 3;
var offset = 0;
for (var i = 0; offset < data.byteLength && i < channelCount; i++, offset++) {
var rxfailChannel = {
mode: data.getUint8(offset++, 1),
value: data.getUint16(offset++, 1)
};
RXFAIL_CONFIG.push(rxfailChannel);
}
break;
case MSP_codes.MSP_LED_STRIP_CONFIG:
LED_STRIP = [];
@ -848,7 +905,15 @@ var MSP = {
case MSP_codes.MSP_SET_ARMING_CONFIG:
console.log('Arming config saved');
break;
case MSP_codes.MSP_SET_RX_CONFIG:
console.log('Rx config saved');
break;
case MSP_codes.MSP_SET_RXFAIL_CONFIG:
console.log('Rxfail config saved');
break;
case MSP_codes.MSP_SET_FAILSAFE_CONFIG:
console.log('Failsafe config saved');
break;
default:
console.log('Unknown code detected: ' + code);
} else {
@ -1090,6 +1155,41 @@ MSP.crunch = function (code) {
buffer.push(Math.round(MISC.vbatmaxcellvoltage * 10));
buffer.push(Math.round(MISC.vbatwarningcellvoltage * 10));
break;
case MSP_codes.MSP_SET_RX_CONFIG:
buffer.push(RX_CONFIG.serialrx_provider);
buffer.push(lowByte(RX_CONFIG.maxcheck));
buffer.push(highByte(RX_CONFIG.maxcheck));
buffer.push(lowByte(RX_CONFIG.midrc));
buffer.push(highByte(RX_CONFIG.midrc));
buffer.push(lowByte(RX_CONFIG.mincheck));
buffer.push(highByte(RX_CONFIG.mincheck));
buffer.push(RX_CONFIG.spektrum_sat_bind);
buffer.push(lowByte(RX_CONFIG.rx_min_usec));
buffer.push(highByte(RX_CONFIG.rx_min_usec));
buffer.push(lowByte(RX_CONFIG.rx_max_usec));
buffer.push(highByte(RX_CONFIG.rx_max_usec));
break;
case MSP_codes.MSP_SET_FAILSAFE_CONFIG:
buffer.push(FAILSAFE_CONFIG.failsafe_delay);
buffer.push(FAILSAFE_CONFIG.failsafe_off_delay);
buffer.push(lowByte(FAILSAFE_CONFIG.failsafe_throttle));
buffer.push(highByte(FAILSAFE_CONFIG.failsafe_throttle));
buffer.push(FAILSAFE_CONFIG.failsafe_kill_switch);
buffer.push(lowByte(FAILSAFE_CONFIG.failsafe_throttle_low_delay));
buffer.push(highByte(FAILSAFE_CONFIG.failsafe_throttle_low_delay));
buffer.push(FAILSAFE_CONFIG.failsafe_procedure);
break;
case MSP_codes.MSP_SET_RXFAIL_CONFIG:
for (var i = 0; i < RXFAIL_CONFIG.length; i++) {
buffer.push(RXFAIL_CONFIG[i].mode);
buffer.push(lowByte(RXFAIL_CONFIG[i].value));
buffer.push(highByte(RXFAIL_CONFIG[i].value));
}
break;
case MSP_codes.MSP_SET_CHANNEL_FORWARDING:
for (var i = 0; i < SERVO_CONFIG.length; i++) {
var out = SERVO_CONFIG[i].indexOfChannelToForward;

View File

@ -722,6 +722,13 @@ li.active .ic_flasher {
}
/* SPARE Tab-Icons */
.ic_failsafe {
background-image: url(images/icons/cf_icon_failsafe_grey.svg);
}
li.active .ic_failsafe {
background-image: url(images/icons/cf_icon_failsafe_white.svg);
}
.ic_backup {
background-image: url(images/icons/cf_icon_backup_grey.svg);
}
@ -1300,7 +1307,7 @@ dialog {
}
/* fixing padding for all Tabs*/
.tab-setup, .tab-landing, .tab-adjustments, .tab-auxiliary, .tab-cli, .tab-configuration, .tab-dataflash,
.tab-setup, .tab-landing, .tab-adjustments, .tab-auxiliary, .tab-cli, .tab-configuration, .tab-failsafe, .tab-dataflash,
.tab-firmware_flasher, .tab-gps, .tab-help, .tab-led-strip, .tab-logging, .tab-modes, .tab-motors, .tab-pid_tuning,
.tab-ports, .tab-receiver, .tab-sensors, .tab-servos {
height: 100%;
@ -1369,7 +1376,7 @@ dialog {
/* lets see if we really need this? */
}
.tab-setup, .tab-landing, .tab-adjustments, .tab-auxiliary, .tab-cli, .tab-configuration, .tab-dataflash,
.tab-setup, .tab-landing, .tab-adjustments, .tab-auxiliary, .tab-cli, .tab-configuration, .tab-failsafe, .tab-dataflash,
.tab-firmware_flasher, .tab-gps, .tab-help, .tab-led-strip, .tab-logging, .tab-modes, .tab-motors,
.tab-pid_tuning, .tab-ports, .tab-receiver, .tab-sensors, .tab-servos {

View File

@ -25,6 +25,7 @@
<link type="text/css" rel="stylesheet" href="./tabs/firmware_flasher.css" media="all" />
<link type="text/css" rel="stylesheet" href="./tabs/adjustments.css" media="all" />
<link type="text/css" rel="stylesheet" href="./tabs/auxiliary.css" media="all" />
<link type="text/css" rel="stylesheet" href="./tabs/failsafe.css" media="all" />
<link type="text/css" rel="stylesheet" href="./css/opensans_webfontkit/fonts.css" media="all" />
<link type="text/css" rel="stylesheet" href="./css/dropdown-lists/css/style_lists.css" media="all" />
<link type="text/css" rel="stylesheet" href="./js/libraries/switchery/switchery.css" media="all" />
@ -75,6 +76,7 @@
<script type="text/javascript" src="./tabs/logging.js"></script>
<script type="text/javascript" src="./tabs/dataflash.js"></script>
<script type="text/javascript" src="./tabs/firmware_flasher.js"></script>
<script type="text/javascript" src="./tabs/failsafe.js"></script>
<title></title>
</head>
<body>
@ -161,36 +163,26 @@
<div class="tab_container">
<div id="tabs">
<ul class="mode-disconnected">
<li class="tab_landing"><a href="#" i18n="tabLanding" class="tabicon ic_welcome"
title="Welcome"></a></li>
<li class="tab_help"><a href="#" i18n="tabHelp" class="tabicon ic_help"
title="Documentation & Support"></a></li>
<li class="tab_firmware_flasher"><a href="#" i18n="tabFirmwareFlasher"
class="tabicon ic_flasher" title="Firmware Flasher"></a></li>
<li class="tab_landing"><a href="#" i18n="tabLanding" class="tabicon ic_welcome" title="Welcome"></a></li>
<li class="tab_help"><a href="#" i18n="tabHelp" class="tabicon ic_help" title="Documentation &amp; Support"></a></li>
<li class="tab_firmware_flasher"><a href="#" i18n="tabFirmwareFlasher" class="tabicon ic_flasher" title="Firmware Flasher"></a></li>
</ul>
<ul class="mode-connected">
<li class="tab_setup"><a href="#" i18n="tabSetup" class="tabicon ic_setup" title="Setup"></a></li>
<li class="tab_ports"><a href="#" i18n="tabPorts" class="tabicon ic_ports" title="Ports"></a></li>
<li class="tab_configuration"><a href="#" i18n="tabConfiguration" class="tabicon ic_config"
title="Configuration"></a></li>
<li class="tab_pid_tuning"><a href="#" i18n="tabPidTuning" class="tabicon ic_pid"
title="PID Tuning"></a></li>
<li class="tab_configuration"><a href="#" i18n="tabConfiguration" class="tabicon ic_config" title="Configuration"></a></li>
<li class="tab_failsafe"><a href="#" class="tabicon ic_failsafe" title="Failsafe">Failsafe</a></li>
<li class="tab_pid_tuning"><a href="#" i18n="tabPidTuning" class="tabicon ic_pid" title="PID Tuning"></a></li>
<li class="tab_receiver"><a href="#" i18n="tabReceiver" class="tabicon ic_rx" title="Receiver"></a></li>
<li class="tab_auxiliary"><a href="#" i18n="tabAuxiliary" class="tabicon ic_modes"
title="Modes"></a></li>
<li class="tab_adjustments"><a href="#" i18n="tabAdjustments" class="tabicon ic_adjust"
title="Adjustments"></a></li>
<li class="tab_auxiliary"><a href="#" i18n="tabAuxiliary" class="tabicon ic_modes" title="Modes"></a></li>
<li class="tab_adjustments"><a href="#" i18n="tabAdjustments" class="tabicon ic_adjust" title="Adjustments"></a></li>
<li class="tab_servos"><a href="#" i18n="tabServos" class="tabicon ic_servo" title="Servos"></a></li>
<li class="tab_gps"><a href="#" i18n="tabGPS" class="tabicon ic_gps" title="GPS"></a></li>
<li class="tab_motors"><a href="#" i18n="tabMotorTesting" class="tabicon ic_motor"
title="Motors"></a></li>
<li class="tab_led_strip"><a href="#" i18n="tabLedStrip" class="tabicon ic_led"
title="LED Strip"></a></li>
<li class="tab_sensors"><a href="#" i18n="tabRawSensorData" class="tabicon ic_sensors"
title="Sensors"></a></li>
<li class="tab_motors"><a href="#" i18n="tabMotorTesting" class="tabicon ic_motor" title="Motors"></a></li>
<li class="tab_led_strip"><a href="#" i18n="tabLedStrip" class="tabicon ic_led" title="LED Strip"></a></li>
<li class="tab_sensors"><a href="#" i18n="tabRawSensorData" class="tabicon ic_sensors" title="Sensors"></a></li>
<li class="tab_logging"><a href="#" i18n="tabLogging" class="tabicon ic_log" title="Logging"></a></li>
<li class="tab_dataflash"><a href="#" i18n="tabDataflash" class="tabicon ic_data"
title="Dataflash"></a></li>
<li class="tab_dataflash"><a href="#" i18n="tabDataflash" class="tabicon ic_data" title="Dataflash"></a></li>
<li class="tab_cli"><a href="#" i18n="tabCLI" class="tabicon ic_cli" title="CLI"></a></li>
<!-- spare icons
<li class=""><a href="#"class="tabicon ic_mission">Mission (spare icon)</a></li>

View File

@ -126,7 +126,9 @@ $(document).ready(function () {
case 'led_strip':
TABS.led_strip.initialize(content_ready);
break;
case 'failsafe':
TABS.failsafe.initialize(content_ready);
break;
case 'setup':
TABS.setup.initialize(content_ready);
break;

View File

@ -262,14 +262,17 @@
.tab-configuration .gps .gui_box, .tab-configuration .other .gui_box {
min-height: 355px;
float: left;
margin-bottom: 0px;
margin-bottom: 10px;
}
.tab-configuration .current .gui_box {
min-height: 230px;
float: left;
}
.tab-configuration .rxprovider {
min-height: 214px;
}
.tab-configuration .current td:nth-child(2) {
width: 30px;
}
@ -359,7 +362,6 @@
float: left;
}
.tab-configuration .current .gui_box {
min-height: 230px;
float: left;
}
}

View File

@ -159,7 +159,7 @@
</table>
</div>
</div>
<div class="gui_box grey">
<div class="gui_box grey rxprovider">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="configurationSerialRX"></div>
</div>
@ -169,35 +169,11 @@
<p i18n="configurationSerialRXHelp"></p>
</div>
</div>
<select class="serialRX" size="4">
<select class="serialRX" size="8">
<!-- list generated here -->
</select>
</div>
</div>
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="configurationFailsafe"></div>
</div>
<div class="spacer_box">
<table cellpadding="0" cellspacing="0">
<thead>
<tr>
<th i18n="configurationFeatureEnabled"></th>
<th i18n="configurationFeatureDescription"></th>
<th i18n="configurationFeatureName"></th>
</tr>
</thead>
<tbody class="features rxFailsafe">
<!-- table generated here -->
</tbody>
</table>
<div class="number">
<label> <input type="number" name="failsafe_throttle" min="0" max="2000" /> <span
i18n="configurationThrottleFailsafe"></span>
</label>
</div>
</div>
</div>
</div>
<div class="rightWrapper current voltage">
<div class="gui_box grey">

View File

@ -318,7 +318,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
$('input[name="minthrottle"]').val(MISC.minthrottle);
$('input[name="midthrottle"]').val(MISC.midrc);
$('input[name="maxthrottle"]').val(MISC.maxthrottle);
$('input[name="failsafe_throttle"]').val(MISC.failsafe_throttle);
$('input[name="mincommand"]').val(MISC.mincommand);
// fill battery
@ -405,7 +404,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
MISC.minthrottle = parseInt($('input[name="minthrottle"]').val());
MISC.midrc = parseInt($('input[name="midthrottle"]').val());
MISC.maxthrottle = parseInt($('input[name="maxthrottle"]').val());
MISC.failsafe_throttle = parseInt($('input[name="failsafe_throttle"]').val());
MISC.mincommand = parseInt($('input[name="mincommand"]').val());
MISC.vbatmincellvoltage = parseFloat($('input[name="mincellvoltage"]').val());

222
tabs/failsafe.css Normal file
View File

@ -0,0 +1,222 @@
.tab-failsafe {
position: relative;
}
.tab-failsafe .leftWrapper {
float: left;
width: calc(50% - 20px);
}
.tab-failsafe .rightWrapper {
float: left;
width: calc(50% - 0px);
margin: 0 0 0 20px;
}
.tab-failsafe .number {
margin-bottom: 5px;
clear: left;
}
.tab-failsafe .number input {
width: 50px;
padding-left: 3px;
height: 20px;
line-height: 20px;
text-align: left;
border: 1px solid silver;
border-radius: 3px;
margin-right: 11px;
font-size: 12px;
font-weight: normal;
}
.tab-failsafe .number input.disabled {
width: 43px;
padding: 0px 5px;
background-color: #ececec;
}
.tab-failsafe .number span {
margin-left: 0px;
}
.tab-failsafe .checkbox {
float: left;
width: 100%;
margin-bottom: 6px;
padding-bottom: 5px;
border-bottom: 1px solid #ddd;
margin-top: 0px;
}
.tab-failsafe .subline {
float:left;
width:100%;
font-size: 13px;
margin-top:15px;
margin-bottom:5px;
}
.tab-failsafe .radioarea {
float:left;
width:100%;
border-radius:5px;
background-color:#ededed;
margin-bottom:0px;
margin-top:5px;
height: 150px;
}
.tab-failsafe .radiobuttons {
float: left;
width: 50%;
margin-top: 38px;
margin-left: 15px;
font-size: 12px;
font-family: 'open_sansregular', Arial;
}
.tab-failsafe .radiobuttons input {
margin-right: 8px;
margin-bottom: 10px;
}
.tab-failsafe .proceduresettings {
padding:10px;
margin-top: 75px;
}
.tab-failsafe .radiobuttons label {
float: left;
width:130px;
margin-top: -2px;
}
.tab-failsafe .pro1 {
background-image:url(../images/icons/cf_failsafe_procedure1.svg);
background-position: top right 10px;
background-size: 200px;
background-repeat:no-repeat;
}
.tab-failsafe .pro2 {
background-image:url(../images/icons/cf_failsafe_procedure2.svg);
background-position: top right 10px;
background-size: 200px;
background-repeat:no-repeat;
}
.tab-failsafe .pro3 {
background-image:url(../images/icons/cf_failsafe_procedure3.svg);
background-position: top right 10px;
background-size: 200px;
background-repeat:no-repeat;
}
.tab-failsafe .pro4 {
background-image:url(../images/icons/cf_failsafe_procedure4.svg);
background-position: top right 10px;
background-size: 200px;
background-repeat:no-repeat;
}
.tab-failsafe .spacer_box .helpicon {
margin-top:3px;
margin-right:0px;
}
.tab-failsafe .checkbox:last-child {
border-bottom: none;
}
.tab-failsafe .freelabel {
margin-left: 10px;
position: relative;
}
.tab-failsafe input {
float: left;
}
.tab-failsafe span {
margin: 0px
}
.tab-failsafe .spacer_box {
padding-bottom: 10px;
float: left;
width: calc(100% - 20px);
}
.tab-failsafe .number {
padding-bottom: 5px;
border-bottom: 1px solid #ddd;
width: 100%;
float: left;
}
.tab-failsafe .number:last-child {
border-bottom: none;
padding-bottom: 0px;
margin-bottom: 0px;
}
.tab-failsafe .gui_box_titlebar {
margin-bottom: 0px;
}
.tab-failsafe .numberspacer {
float: left;
width: 65px;
height: 21px;
}
.tab-failsafe .gui_box {
font-style: normal;
font-family: 'open_sanssemibold', Arial;
margin-bottom: 15px;
float: left;
}
.tab-failsafe .gui_box span {
font-style: normal;
font-family: 'open_sansregular', Arial;
line-height: 19px;
color: #7d7d7d;
font-size: 11px;
}
.tab-failsafe .stage1 .number input {
float:right;
margin-right:0px;
}
.tab-failsafe .stage1 select {
float:left;
width: 95%;
height: 22px;
margin: 0px;
border: 1px solid silver;
}
.tab-failsafe .modename {
background-color: #828885;
border-radius: 3px;
border: 1px solid #686c6a;
color: #fff !important;
font-weight:normal;
font-family: 'open_sanssemibold', Arial;
padding-left: 3px;
padding-right:3px;
margin-right:3px;
}
.tab-failsafe .channelname {
margin-right:3px;
}
@media only screen and (max-width: 1055px) , only screen and (max-device-width: 1055px) {
}

151
tabs/failsafe.html Normal file
View File

@ -0,0 +1,151 @@
<div class="tab-failsafe toolbar_fixed_bottom">
<div class="content_wrapper">
<div class="tab_title">Failsafe</div>
<div class="cf_doc_version_bt">
<a id="button-documentation" href="https://github.com/cleanflight/cleanflight/releases" target="_blank"></a>
</div>
<div class="note newpane" style="margin-bottom: 20px;">
<div class="note_spacer">
<p i18n="failsafeFeaturesHelpNew"></p>
</p>
</div>
</div>
<div class="note oldpane" style="margin-bottom: 20px;">
<div class="note_spacer">
<p i18n="failsafeFeaturesHelpOld"></p>
</p>
</div>
</div>
<div class="leftWrapper">
<div class="gui_box grey oldpane">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="failsafePaneTitleOld"></div>
</div>
<div class="spacer_box">
<div class="checkbox">
<div class="numberspacer" >
<input type="checkbox" name="failsafe_feature" class="feature toggle rxFailsafe" id="failsafe_feature" />
</div>
<label for="failsafe_feature"><span i18n="failsafeFeatureItemOld"></span>
</label>
</div>
<div class="number">
<label> <input type="number" name="failsafe_throttle_old" min="0" max="2000" /> <span
i18n="failsafeThrottleItemOld"></span>
</label>
</div>
</div>
</div>
<div class="gui_box grey newpane">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="failsafePulsrangeTitle"></div>
<div class="helpicon cf_tip">
<div class="cf_tooltiptext" style="display:none;" i18n="failsafePulsrangeHelp"></div>
</div>
</div>
<div class="spacer_box">
<div class="number">
<label> <input type="number" name="rx_min_usec" min="750" max="2250" /> <span
i18n="failsafeRxMinUsecItem"></span>
</label>
</div>
<div class="number">
<label> <input type="number" name="rx_max_usec" min="750" max="2250" /> <span
i18n="failsafeRxMaxUsecItem"></span>
</label>
</div>
</div>
</div>
<div class="gui_box grey stage1 newpane">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="failsafeChannelFallbackSettingsTitle"></div>
<div class="helpicon cf_tip">
<div class="cf_tooltiptext" style="display:none;" i18n="failsafeChannelFallbackSettingsHelp"></div>
</div>
</div>
<div class="spacer_box">
<div class="activechannellist">
<!-- list generated here -->
</div>
</div>
</div>
</div>
<div class="rightWrapper">
<div class="gui_box grey newpane" style="margin-bottom:0px;">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="failsafeStageTwoSettingsTitle"></div>
</div>
<div class="spacer_box" style="padding-bottom:7px;">
<div class="checkbox">
<div class="numberspacer" >
<input type="checkbox" name="failsafe_feature_new" class="feature toggle rxFailsafe" id="failsafe_feature_new" />
</div>
<label for="failsafe_feature_new"><span i18n="failsafeFeatureItem"></span>
</label>
<div class="helpicon cf_tip">
<div class="cf_tooltiptext" style="display:none;" i18n="failsafeFeatureHelp"></div>
</div>
</div>
<div class="checkbox stage2">
<div class="numberspacer" >
<input type="checkbox" name="failsafe_kill_switch" class="toggle" id="failsafe_kill_switch" />
</div>
<label for="failsafe_kill_switch"><span i18n="failsafeKillSwitchItem"></span>
</label>
<div class="helpicon cf_tip">
<div class="cf_tooltiptext" style="display:none;" i18n="failsafeKillSwitchHelp"></div>
</div>
</div>
<div class="number stage2">
<label> <input type="number" name="failsafe_delay" min="0" max="2000" /> <span
i18n="failsafeDelayItem"></span>
</label>
<div class="helpicon cf_tip">
<div class="cf_tooltiptext" style="display:none;"i18n="failsafeDelayHelp"></div>
</div>
</div>
<div class="number stage2">
<label> <input type="number" name="failsafe_throttle_low_delay" min="0" max="2000" /> <span
i18n="failsafeThrottleLowItem"></span>
</label>
<div class="helpicon cf_tip">
<div class="cf_tooltiptext" style="display:none;" i18n="failsafeThrottleLowHelp"></div>
</div>
</div>
<!-- radio buttons -->
<div class="subline stage2" i18n="failsafeSubTitle1"></div>
<div class="radioarea pro1 stage2" style="height:90px;">
<div class="radiobuttons"><input class="procedure" id="drop" name="group1" type="radio"/>
<label for="drop" i18n="failsafeProcedureItemSelect2"></label>
</div>
</div>
<div class="radioarea pro2 stage2">
<div class="radiobuttons"><input class="procedure" id="land" name="group1" type="radio" checked/>
<label for="land" i18n="failsafeProcedureItemSelect1"></label>
</div>
<div class="proceduresettings">
<div class="number">
<label> <input type="number" name="failsafe_throttle" min="0" max="2000" /> <span
i18n="failsafeThrottleItem"></span>
</label>
</div>
<div class="number">
<label> <input type="number" name="failsafe_off_delay" min="0" max="2000" /> <span
i18n="failsafeOffDelayItem"></span>
</label>
<div class="helpicon cf_tip">
<div class="cf_tooltiptext" style="display:none;" i18n="failsafeOffDelayHelp"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="content_toolbar">
<div class="btn save_btn">
<a class="save" href="#" i18n="configurationButtonSave"></a>
</div>
</div>
</div>

382
tabs/failsafe.js Normal file
View File

@ -0,0 +1,382 @@
'use strict';
TABS.failsafe = {};
TABS.failsafe.initialize = function (callback, scrollPosition) {
var self = this;
if (GUI.active_tab != 'failsafe') {
GUI.active_tab = 'failsafe';
googleAnalytics.sendAppView('Failsafe');
}
function load_rx_config() {
MSP.send_message(MSP_codes.MSP_RX_CONFIG, false, false, load_failssafe_config);
}
function load_failssafe_config() {
MSP.send_message(MSP_codes.MSP_FAILSAFE_CONFIG, false, false, load_rxfail_config);
}
function load_rxfail_config() {
MSP.send_message(MSP_codes.MSP_RXFAIL_CONFIG, false, false, get_box_names);
}
function get_box_names() {
MSP.send_message(MSP_codes.MSP_BOXNAMES, false, false, get_mode_ranges);
}
function get_mode_ranges() {
MSP.send_message(MSP_codes.MSP_MODE_RANGES, false, false, get_box_ids);
}
function get_box_ids() {
MSP.send_message(MSP_codes.MSP_BOXIDS, false, false, get_rc_data);
}
function get_rc_data() {
MSP.send_message(MSP_codes.MSP_RC, false, false, load_config);
}
// BEGIN Support for pre API version 1.15.0
function load_config() {
MSP.send_message(MSP_codes.MSP_BF_CONFIG, false, false, load_misc);
}
function load_misc() {
MSP.send_message(MSP_codes.MSP_MISC, false, false, load_html);
}
// END (Support for pre API version 1.15.0
function load_html() {
$('#content').load("./tabs/failsafe.html", process_html);
}
var apiVersionGte1_15_0 = semver.gte(CONFIG.apiVersion, "1.15.0");
// Uncomment next line for testing older functionality on newer API version
//apiVersionGte1_15_0 = false;
if(apiVersionGte1_15_0) {
MSP.send_message(MSP_codes.MSP_IDENT, false, false, load_rx_config);
} else {
MSP.send_message(MSP_codes.MSP_IDENT, false, false, load_config);
}
function process_html() {
var failsafeFeature;
// translate to user-selected language
localize();
// Conditionally hide the old or the new control pane's
if(apiVersionGte1_15_0) {
var oldPane = $('div.oldpane');
oldPane.prop("disabled", true);
oldPane.hide();
} else {
var newPane = $('div.newpane');
newPane.prop("disabled", true);
newPane.hide();
}
if(apiVersionGte1_15_0) {
// generate labels for assigned aux modes
var auxAssignment = [],
i,
element;
for (var channelIndex = 0; channelIndex < RC.active_channels - 4; channelIndex++) {
auxAssignment.push("");
}
for (var modeIndex = 0; modeIndex < AUX_CONFIG.length; modeIndex++) {
var modeId = AUX_CONFIG_IDS[modeIndex];
// scan mode ranges to find assignments
for (var modeRangeIndex = 0; modeRangeIndex < MODE_RANGES.length; modeRangeIndex++) {
var modeRange = MODE_RANGES[modeRangeIndex];
if (modeRange.id != modeId) {
continue;
}
var range = modeRange.range;
if (!(range.start < range.end)) {
continue; // invalid!
}
auxAssignment[modeRange.auxChannelIndex] += "<span class=\"modename\">" + AUX_CONFIG[modeIndex] + "</span>";
}
}
// generate full channel list
var channelNames = [
chrome.i18n.getMessage('controlAxisRoll'),
chrome.i18n.getMessage('controlAxisPitch'),
chrome.i18n.getMessage('controlAxisYaw'),
chrome.i18n.getMessage('controlAxisThrottle')
],
fullChannels_e = $('div.activechannellist'),
aux_index = 1,
aux_assignment_index = 0;
for (i = 0; i < RXFAIL_CONFIG.length; i++) {
if (i < channelNames.length) {
fullChannels_e.append('\
<div class="number">\
<div style="width:60%; float:left;">\
<span>' + channelNames[i] + '</span>\
</div>\
<div class="cf_tip" style="width:25%; float:left;">\
<div class="cf_tooltiptext" style="display:none;"><strong>Auto</strong> means Roll, Pitch and Yaw to center and Throttle low. <strong>Hold</strong> means maintain the last good value received.</div>\
<select class="aux_set" id="' + i + '">\
<option value="0">Auto</option>\
<option value="1">Hold</option>\
</select>\
</div>\
<div style="width:15%; float:left;"><input type="number" name="aux_value" min="750" max="2250" id="' + i + '"/></div>\
</div>\
');
} else {
fullChannels_e.append('\
<div class="number">\
<div style="width:60%; float:left; padding-top: 2px;">\
<span class="channelname">' + chrome.i18n.getMessage("controlAxisAux" + (aux_index++)) + '</span>\
' + auxAssignment[aux_assignment_index++] + '\
</div>\
<div class="cf_tip" style="width:25%; float:left;">\
<div class="cf_tooltiptext" style="display:none;"><strong>Hold</strong> means maintain the last good value received. <strong>Set</strong> means the value given here will be used. </div>\
<select class="aux_set" id="' + i + '">\
<option value="1">Hold</option>\
<option value="2">Set</option>\
</select>\
</div>\
<div style="width:15%; float:left;"><input type="number" name="aux_value" min="750" max="2250" id="' + i + '"/></div>\
</div>\
');
}
}
var channel_mode_array = [];
$('.number', fullChannels_e).each(function () {
channel_mode_array.push($('select.aux_set' , this));
});
var channel_value_array = [];
$('.number', fullChannels_e).each(function () {
channel_value_array.push($('input[name="aux_value"]' , this));
});
var channelMode = $('select.aux_set');
var channelValue = $('input[name="aux_value"]');
// UI hooks
channelMode.change(function () {
var currentMode = parseInt($(this).val());
var i = parseInt($(this).prop("id"));
RXFAIL_CONFIG[i].mode = currentMode;
if (currentMode == 2) {
channel_value_array[i].prop("disabled", false);
channel_value_array[i].show();
} else {
channel_value_array[i].prop("disabled", true);
channel_value_array[i].hide();
}
});
// UI hooks
channelValue.change(function () {
var i = parseInt($(this).prop("id"));
RXFAIL_CONFIG[i].value = parseInt($(this).val());
});
// for some odd reason chrome 38+ changes scroll according to the touched select element
// i am guessing this is a bug, since this wasn't happening on 37
// code below is a temporary fix, which we will be able to remove in the future (hopefully)
$('#content').scrollTop((scrollPosition) ? scrollPosition : 0);
// fill stage 1 Valid Pulse Range Settings
$('input[name="rx_min_usec"]').val(RX_CONFIG.rx_min_usec);
$('input[name="rx_max_usec"]').val(RX_CONFIG.rx_max_usec);
// fill fallback settings (mode and value) for all channels
for (i = 0; i < RXFAIL_CONFIG.length; i++) {
channel_value_array[i].val(RXFAIL_CONFIG[i].value);
channel_mode_array[i].val(RXFAIL_CONFIG[i].mode);
channel_mode_array[i].change();
}
// fill stage 2 fields
failsafeFeature = $('input[name="failsafe_feature_new"]');
failsafeFeature.change(function () {
if ($(this).is(':checked')) {
$('div.stage2').show();
} else {
$('div.stage2').hide();
}
});
failsafeFeature.prop('checked', bit_check(BF_CONFIG.features, 8));
failsafeFeature.change();
$('input[name="failsafe_throttle"]').val(FAILSAFE_CONFIG.failsafe_throttle);
$('input[name="failsafe_off_delay"]').val(FAILSAFE_CONFIG.failsafe_off_delay);
$('input[name="failsafe_throttle_low_delay"]').val(FAILSAFE_CONFIG.failsafe_throttle_low_delay);
$('input[name="failsafe_delay"]').val(FAILSAFE_CONFIG.failsafe_delay);
// set stage 2 failsafe procedure
$('input[type="radio"].procedure').change(function () {
var element = $(this),
checked = element.is(':checked'),
id = element.attr('id');
switch(id) {
case 'drop':
if (checked) {
$('input[name="failsafe_throttle"]').prop("disabled", true);
$('input[name="failsafe_off_delay"]').prop("disabled", true);
}
break;
case 'land':
if (checked) {
$('input[name="failsafe_throttle"]').prop("disabled", false);
$('input[name="failsafe_off_delay"]').prop("disabled", false);
}
break;
}
});
switch(FAILSAFE_CONFIG.failsafe_procedure) {
default:
case 0:
element = $('input[id="land"]') ;
element.prop('checked', true);
element.change();
break;
case 1:
element = $('input[id="drop"]');
element.prop('checked', true);
element.change();
break;
}
// set stage 2 kill switch option
$('input[name="failsafe_kill_switch"]').prop('checked', FAILSAFE_CONFIG.failsafe_kill_switch);
} else {
// set FAILSAFE feature option (pre API 1.15.0)
failsafeFeature = $('input[name="failsafe_feature"]');
failsafeFeature.prop('checked', bit_check(BF_CONFIG.features, 8));
// fill failsafe_throttle field (pre API 1.15.0)
$('input[name="failsafe_throttle_old"]').val(MISC.failsafe_throttle);
}
$('a.save').click(function () {
// gather data that doesn't have automatic change event bound
if(apiVersionGte1_15_0) {
RX_CONFIG.rx_min_usec = parseInt($('input[name="rx_min_usec"]').val());
RX_CONFIG.rx_max_usec = parseInt($('input[name="rx_max_usec"]').val());
// get FAILSAFE feature option (>= API 1.15.0)
if ($('input[name="failsafe_feature_new"]').is(':checked')) {
BF_CONFIG.features = bit_set(BF_CONFIG.features, 8);
} else {
BF_CONFIG.features = bit_clear(BF_CONFIG.features, 8);
}
FAILSAFE_CONFIG.failsafe_throttle = parseInt($('input[name="failsafe_throttle"]').val());
FAILSAFE_CONFIG.failsafe_off_delay = parseInt($('input[name="failsafe_off_delay"]').val());
FAILSAFE_CONFIG.failsafe_throttle_low_delay = parseInt($('input[name="failsafe_throttle_low_delay"]').val());
FAILSAFE_CONFIG.failsafe_delay = parseInt($('input[name="failsafe_delay"]').val());
if( $('input[id="land"]').is(':checked')) {
FAILSAFE_CONFIG.failsafe_procedure = 0;
} else if( $('input[id="drop"]').is(':checked')) {
FAILSAFE_CONFIG.failsafe_procedure = 1;
}
FAILSAFE_CONFIG.failsafe_kill_switch = $('input[name="failsafe_kill_switch"]').is(':checked') ? 1 : 0;
} else {
// get FAILSAFE feature option (pre API 1.15.0)
if ($('input[name="failsafe_feature"]').is(':checked')) {
BF_CONFIG.features = bit_set(BF_CONFIG.features, 8);
} else {
BF_CONFIG.features = bit_clear(BF_CONFIG.features, 8);
}
// get failsafe_throttle field value (pre API 1.15.0)
MISC.failsafe_throttle = parseInt($('input[name="failsafe_throttle_old"]').val());
}
function save_failssafe_config() {
MSP.send_message(MSP_codes.MSP_SET_FAILSAFE_CONFIG, MSP.crunch(MSP_codes.MSP_SET_FAILSAFE_CONFIG), false, save_rxfail_config);
}
function save_rxfail_config() {
MSP.send_message(MSP_codes.MSP_SET_RXFAIL_CONFIG, MSP.crunch(MSP_codes.MSP_SET_RXFAIL_CONFIG), false, save_bf_config);
}
function save_bf_config() {
MSP.send_message(MSP_codes.MSP_SET_BF_CONFIG, MSP.crunch(MSP_codes.MSP_SET_BF_CONFIG), false, save_to_eeprom);
}
// BEGIN pre API 1.15.0 save functions
function save_misc() {
MSP.send_message(MSP_codes.MSP_SET_MISC, MSP.crunch(MSP_codes.MSP_SET_MISC), false, save_to_eeprom);
}
// END pre API 1.15.0 save functions
function save_to_eeprom() {
MSP.send_message(MSP_codes.MSP_EEPROM_WRITE, false, false, reboot);
}
function reboot() {
GUI.log(chrome.i18n.getMessage('configurationEepromSaved'));
GUI.tab_switch_cleanup(function() {
MSP.send_message(MSP_codes.MSP_SET_REBOOT, false, false, reinitialize);
});
}
function reinitialize() {
GUI.log(chrome.i18n.getMessage('deviceRebooting'));
if (BOARD.find_board_definition(CONFIG.boardIdentifier).vcp) { // VCP-based flight controls may crash old drivers, we catch and reconnect
$('a.connect').click();
GUI.timeout_add('start_connection',function start_connection() {
$('a.connect').click();
},2000);
} else {
GUI.timeout_add('waiting_for_bootup', function waiting_for_bootup() {
MSP.send_message(MSP_codes.MSP_IDENT, false, false, function () {
GUI.log(chrome.i18n.getMessage('deviceReady'));
TABS.failsafe.initialize(false, $('#content').scrollTop());
});
},1500); // 1500 ms seems to be just the right amount of delay to prevent data request timeouts
}
}
if(apiVersionGte1_15_0) {
MSP.send_message(MSP_codes.MSP_SET_RX_CONFIG, MSP.crunch(MSP_codes.MSP_SET_RX_CONFIG), false, save_failssafe_config);
} else {
MSP.send_message(MSP_codes.MSP_SET_BF_CONFIG, MSP.crunch(MSP_codes.MSP_SET_BF_CONFIG), false, save_misc);
}
});
// status data pulled via separate timer with static speed
GUI.interval_add('status_pull', function status_pull() {
MSP.send_message(MSP_codes.MSP_STATUS);
}, 250, true);
GUI.content_ready(callback);
}
};
TABS.failsafe.cleanup = function (callback) {
if (callback) callback();
};