onOldFirmware:showMessage(qsTr("ESC Calibration"),qsTr("QGroundControl cannot perform ESC Calibration with this version of firmware. You will need to upgrade to a newer firmware."),StandardButton.Ok)
onNewerFirmware:showMessage(qsTr("ESC Calibration"),qsTr("QGroundControl cannot perform ESC Calibration with this version of firmware. You will need to upgrade QGroundControl."),StandardButton.Ok)
onBatteryConnected:showMessage(qsTr("ESC Calibration"),qsTr("Performing calibration. This will take a few seconds.."),0)
onCalibrationSuccess:showMessage(qsTr("ESC Calibration"),qsTr("Calibration complete. You can disconnect your battery now if you like."),StandardButton.Ok)
onConnectBattery:showMessage(qsTr("ESC Calibration"),highlightPrefix+qsTr("WARNING: Props must be removed from vehicle prior to performing ESC calibration.")+highlightSuffix+qsTr(" Connect the battery now and calibration will begin."),0)
onDisconnectBattery:showMessage(qsTr("ESC Calibration failed"),qsTr("You must disconnect the battery prior to performing ESC Calibration. Disconnect your battery and try again."),StandardButton.Ok)
}
Component{
id: calcVoltageDividerDlgComponent
QGCViewDialog{
id: calcVoltageDividerDlg
QGCFlickable{
anchors.fill:parent
contentHeight:column.height
contentWidth:column.width
Column{
id: column
width:calcVoltageDividerDlg.width
spacing:ScreenTools.defaultFontPixelHeight
QGCLabel{
width:parent.width
wrapMode:Text.WordWrap
text:"Measure battery voltage using an external voltmeter and enter the value below. Click Calculate to set the new voltage multiplier."
}
functiondrawArrowhead(ctx,x,y,radians)
{
ctx.save();
ctx.beginPath();
ctx.translate(x,y);
ctx.rotate(radians);
ctx.moveTo(0,0);
ctx.lineTo(5,10);
ctx.lineTo(-5,10);
ctx.closePath();
ctx.restore();
ctx.fill();
}
functiondrawLineWithArrow(ctx,x1,y1,x2,y2)
{
ctx.beginPath();
ctx.moveTo(x1,y1);
ctx.lineTo(x2,y2);
ctx.stroke();
varrd=Math.atan((y2-y1)/(x2-x1));
rd+=((x2>x1)?90:-90)*Math.PI/180;
drawArrowhead(ctx,x2,y2,rd);
}
PowerComponentController{
id: controller
factPanel:powerPage.viewPanel
onOldFirmware:showMessage(qsTr("ESC Calibration"),qsTr("QGroundControl cannot perform ESC Calibration with this version of firmware. You will need to upgrade to a newer firmware."),StandardButton.Ok)
onNewerFirmware:showMessage(qsTr("ESC Calibration"),qsTr("QGroundControl cannot perform ESC Calibration with this version of firmware. You will need to upgrade QGroundControl."),StandardButton.Ok)
onBatteryConnected:showMessage(qsTr("ESC Calibration"),qsTr("Performing calibration. This will take a few seconds.."),0)
onCalibrationSuccess:showMessage(qsTr("ESC Calibration"),qsTr("Calibration complete. You can disconnect your battery now if you like."),StandardButton.Ok)
onConnectBattery:showMessage(qsTr("ESC Calibration"),highlightPrefix+qsTr("WARNING: Props must be removed from vehicle prior to performing ESC calibration.")+highlightSuffix+qsTr(" Connect the battery now and calibration will begin."),0)
onDisconnectBattery:showMessage(qsTr("ESC Calibration failed"),qsTr("You must disconnect the battery prior to performing ESC Calibration. Disconnect your battery and try again."),StandardButton.Ok)
}
Component{
id: calcVoltageDividerDlgComponent
QGCViewDialog{
id: calcVoltageDividerDlg
Grid{
columns:2
spacing:ScreenTools.defaultFontPixelHeight/2
verticalItemAlignment:Grid.AlignVCenter
QGCFlickable{
anchors.fill:parent
contentHeight:column.height
contentWidth:column.width
Column{
id: column
width:calcVoltageDividerDlg.width
spacing:ScreenTools.defaultFontPixelHeight
QGCLabel{
text:"Measured voltage:"
width:parent.width
wrapMode:Text.WordWrap
text:"Measure battery voltage using an external voltmeter and enter the value below. Click Calculate to set the new voltage multiplier."
text:"If the battery voltage reported by the vehicle is largely different than the voltage read externally using a voltmeter you can adjust the voltage multiplier value to correct this. "+
"Click the Calculate button for help with calculating a new value."
}
FactTextField{
id: voltMultField
fact:battVoltageDivider
}
QGCLabel{
id: ampPerVoltLabel
text:qsTr("Amps per volt")
}
QGCButton{
id: voltMultCalculateButton
text:"Calculate"
onClicked:showDialog(calcVoltageDividerDlgComponent,qsTr("Calculate Voltage Divider"),powerPage.showDialogDefaultWidth,StandardButton.Close)
}
FactTextField{
id: ampPerVoltField
fact:battAmpsPerVolt
}
Item{width:1;height:1;Layout.columnSpan:2}
QGCButton{
id: ampPerVoltCalculateButton
text:"Calculate"
onClicked:showDialog(calcAmpsPerVoltDlgComponent,qsTr("Calculate Amps per Volt"),powerPage.showDialogDefaultWidth,StandardButton.Close)
}
QGCLabel{
id: voltMultHelp
Layout.columnSpan:batteryGrid.columns
Layout.fillWidth:true
font.pointSize:ScreenTools.smallFontPointSize
wrapMode:Text.WordWrap
text:"If the battery voltage reported by the vehicle is largely different than the voltage read externally using a voltmeter you can adjust the voltage multiplier value to correct this. "+
"Click the Calculate button for help with calculating a new value."
}
Item{width:1;height:1;Layout.columnSpan:2}
QGCLabel{
id: ampPerVoltLabel
text:qsTr("Amps per volt")
}
QGCLabel{
id: ampPerVoltHelp
Layout.columnSpan:batteryGrid.columns
Layout.fillWidth:true
font.pointSize:ScreenTools.smallFontPointSize
wrapMode:Text.WordWrap
text:"If the current draw reported by the vehicle is largely different than the current read externally using a current meter you can adjust the amps per volt value to correct this. "+
"Click the Calculate button for help with calculating a new value."
}
}//Grid
}//Rectangle-Batterysettings
QGCLabel{
text:qsTr("ESC PWM Minimum and Maximum Calibration")
text:qsTr("WARNING: Propellers must be removed from vehicle prior to performing UAVCAN ESC configuration.")
}
QGCLabel{
id: ampPerVoltHelp
Layout.columnSpan:batteryGrid.columns
Layout.fillWidth:true
font.pointSize:ScreenTools.smallFontPointSize
wrapMode:Text.WordWrap
text:"If the current draw reported by the vehicle is largely different than the current read externally using a current meter you can adjust the amps per volt value to correct this. "+
"Click the Calculate button for help with calculating a new value."
}
}//Grid
}//QGCGroupBox-Batterysettings
QGCLabel{
width:parent.width
wrapMode:Text.WordWrap
text:qsTr("ESC parameters will only be accessible in the editor after assignment.")
}
QGCGroupBox{
anchors.left:batteryGroup.left
anchors.right:batteryGroup.right
title:qsTr("ESC PWM Minimum and Maximum Calibration")
QGCLabel{
width:parent.width
wrapMode:Text.WordWrap
text:qsTr("Start the process, then turn each motor into its turn direction, in the order of their motor indices.")
}
ColumnLayout{
anchors.left:parent.left
anchors.right:parent.right
spacing:ScreenTools.defaultFontPixelWidth
QGCButton{
text:qsTr("Start Assignment")
width:ScreenTools.defaultFontPixelWidth*20
onClicked:controller.busConfigureActuators()
}
QGCLabel{
color:qgcPal.warningText
wrapMode:Text.WordWrap
text:qsTr("WARNING: Propellers must be removed from vehicle prior to performing ESC calibration.")
Layout.fillWidth:true
}
QGCLabel{
text:qsTr("You must use USB connection for this operation.")