mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-03-01 18:29:16 +01:00
OP-1149/OP-1150: uncrustify/Cleanup
This commit is contained in:
parent
e599b01806
commit
27c19d7cb1
@ -359,10 +359,10 @@ static void SensorsTask(__attribute__((unused)) void *parameters)
|
||||
accels[1] * accel_scaling * accel_scale[1] - accel_bias[1],
|
||||
accels[2] * accel_scaling * accel_scale[2] - accel_bias[2] };
|
||||
|
||||
if(accel_temp_calibrated){
|
||||
if (accel_temp_calibrated) {
|
||||
float ctemp = accelSensorData.temperature > calibrated_temp_max ? calibrated_temp_max :
|
||||
(accelSensorData.temperature < calibrated_temp_min ? calibrated_temp_min
|
||||
: accelSensorData.temperature );
|
||||
: accelSensorData.temperature);
|
||||
accels_out[0] -= accel_temp_coeff[0] * ctemp;
|
||||
accels_out[1] -= accel_temp_coeff[1] * ctemp;
|
||||
accels_out[2] -= accel_temp_coeff[2] * ctemp;
|
||||
@ -387,12 +387,12 @@ static void SensorsTask(__attribute__((unused)) void *parameters)
|
||||
|
||||
float gyros_out[3] = { gyros[0] * gyro_scaling * gyro_scale[0] - gyro_staticbias[0],
|
||||
gyros[1] * gyro_scaling * gyro_scale[1] - gyro_staticbias[1],
|
||||
gyros[2] * gyro_scaling * gyro_scale[2] - gyro_staticbias[2]};
|
||||
gyros[2] * gyro_scaling * gyro_scale[2] - gyro_staticbias[2] };
|
||||
|
||||
if(gyro_temp_calibrated){
|
||||
if (gyro_temp_calibrated) {
|
||||
float ctemp = gyroSensorData.temperature > calibrated_temp_max ? calibrated_temp_max :
|
||||
(gyroSensorData.temperature < calibrated_temp_min ? calibrated_temp_min
|
||||
: gyroSensorData.temperature );
|
||||
: gyroSensorData.temperature);
|
||||
gyros_out[0] -= gyro_temp_coeff[0] * ctemp;
|
||||
gyros_out[1] -= gyro_temp_coeff[1] * ctemp;
|
||||
gyros_out[2] -= (gyro_temp_coeff[2] + gyro_temp_coeff[3] * ctemp) * ctemp;
|
||||
@ -490,7 +490,6 @@ static void settingsUpdatedCb(__attribute__((unused)) UAVObjEvent *objEv)
|
||||
agcal.gyro_temp_coeff.Z > 1e-9f && agcal.gyro_temp_coeff.Z2 > 1e-9f;
|
||||
|
||||
|
||||
|
||||
AttitudeSettingsData attitudeSettings;
|
||||
AttitudeSettingsGet(&attitudeSettings);
|
||||
|
||||
|
@ -396,7 +396,6 @@ void ThermalCalibrationHelper::calculate()
|
||||
copyResultToSettings();
|
||||
emit calculationCompleted();
|
||||
closeDebugLog();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -439,7 +438,7 @@ void ThermalCalibrationHelper::updateTemp(float temp)
|
||||
qDebug() << "M_gradient " << m_gradient << " Elapsed" << elapsed << " m_initialGradient" << m_initialGradient;
|
||||
// make a rough estimation of the time needed
|
||||
m_targetduration = elapsed * 8;
|
||||
if(m_debugFile.isOpen()){
|
||||
if (m_debugFile.isOpen()) {
|
||||
m_debugStream << "INFO::Trace gradient " << m_gradient << " Elapsed" << elapsed << " m_initialGradient" << m_initialGradient
|
||||
<< " target:" << m_targetduration << endl;
|
||||
}
|
||||
@ -488,14 +487,14 @@ void ThermalCalibrationHelper::disconnectUAVOs()
|
||||
|
||||
void ThermalCalibrationHelper::createDebugLog()
|
||||
{
|
||||
if(m_debugFile.isOpen()){
|
||||
if (m_debugFile.isOpen()) {
|
||||
closeDebugLog();
|
||||
}
|
||||
if(m_tempdir->isValid()){
|
||||
if (m_tempdir->isValid()) {
|
||||
QString filename = QStringLiteral("thcaldebug_%1.txt").arg(QDateTime::currentDateTime().toString("dd.MM.yyyy-hh.mm.ss.zzz"));
|
||||
QDir dir = QDir(m_tempdir->path());
|
||||
m_debugFile.setFileName(dir.filePath(filename));
|
||||
if (!m_debugFile.open(QIODevice::WriteOnly | QIODevice::Text)){
|
||||
if (!m_debugFile.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||
m_debugStream.setDevice(0);
|
||||
return;
|
||||
}
|
||||
@ -509,7 +508,7 @@ void ThermalCalibrationHelper::createDebugLog()
|
||||
|
||||
m_debugStream << "INFO::Hardware";
|
||||
m_debugStream << " type:" << QString().setNum(board.boardType, 16);
|
||||
m_debugStream << " revision:"<<QString().setNum(board.boardRevision, 16);
|
||||
m_debugStream << " revision:" << QString().setNum(board.boardRevision, 16);
|
||||
m_debugStream << " serial:" << QString(utilMngr->getBoardCPUSerial().toHex()) << endl;
|
||||
|
||||
QString uavo = board.uavoHash.toHex();
|
||||
@ -519,13 +518,12 @@ void ThermalCalibrationHelper::createDebugLog()
|
||||
|
||||
m_debugStream << "INFO::gcs tag:" << VersionInfo::tagOrBranch() + VersionInfo::dirty() << " date:" << VersionInfo::dateTime() <<
|
||||
" hash:" << VersionInfo::hash().left(8) << " uavo:" << VersionInfo::uavoHash().left(8) << endl;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void ThermalCalibrationHelper::closeDebugLog()
|
||||
{
|
||||
if(m_debugFile.isOpen()){
|
||||
if (m_debugFile.isOpen()) {
|
||||
m_debugStream.flush();
|
||||
m_debugStream.setDevice(0);
|
||||
m_debugFile.close();
|
||||
|
@ -211,7 +211,6 @@ private:
|
||||
void setMetadataForCalibration(UAVDataObject *uavo);
|
||||
UAVObjectManager *getObjectManager();
|
||||
|
||||
//Q_DISABLE_COPY(ThermalCalibrationHelper)
|
||||
};
|
||||
}
|
||||
#endif // THERMALCALIBRATIONHELPER_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user