mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-29 14:52:12 +01:00
uavobjectparser: fix alignment of field init in generated code
Change from spaces to <TAB> to match the formatting in the template. No functional changes, just whitespace. git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1451 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
1cdaf2ecdc
commit
679f59f19d
@ -80,70 +80,70 @@ static void setDefaults(UAVObjHandle obj, uint16_t instId)
|
||||
// Initialize object fields to their default values
|
||||
UAVObjGetInstanceData(obj, instId, &data);
|
||||
memset(&data, 0, sizeof(ActuatorSettingsData));
|
||||
data.FixedWingRoll1 = 8;
|
||||
data.FixedWingRoll2 = 8;
|
||||
data.FixedWingPitch1 = 8;
|
||||
data.FixedWingPitch2 = 8;
|
||||
data.FixedWingYaw = 8;
|
||||
data.FixedWingThrottle = 8;
|
||||
data.VTOLMotorN = 8;
|
||||
data.VTOLMotorNE = 8;
|
||||
data.VTOLMotorE = 8;
|
||||
data.VTOLMotorSE = 8;
|
||||
data.VTOLMotorS = 8;
|
||||
data.VTOLMotorSW = 8;
|
||||
data.VTOLMotorW = 8;
|
||||
data.VTOLMotorNW = 8;
|
||||
data.CCPMYawStabilizationInManualMode = 0;
|
||||
data.CCPMFlybarless = 0;
|
||||
data.CCPMThrottleCurve[0] = 0;
|
||||
data.CCPMThrottleCurve[1] = 0;
|
||||
data.CCPMThrottleCurve[2] = 0;
|
||||
data.CCPMThrottleCurve[3] = 0;
|
||||
data.CCPMThrottleCurve[4] = 0;
|
||||
data.CCPMPitchCurve[0] = 0;
|
||||
data.CCPMPitchCurve[1] = 0;
|
||||
data.CCPMPitchCurve[2] = 0;
|
||||
data.CCPMPitchCurve[3] = 0;
|
||||
data.CCPMPitchCurve[4] = 0;
|
||||
data.CCPMCollectiveConstant = 0.5;
|
||||
data.CCPMCorrectionAngle = 0;
|
||||
data.CCPMAngleW = 0;
|
||||
data.CCPMAngleX = 60;
|
||||
data.CCPMAngleY = 180;
|
||||
data.CCPMAngleZ = 300;
|
||||
data.CCPMServoW = 8;
|
||||
data.CCPMServoX = 8;
|
||||
data.CCPMServoY = 8;
|
||||
data.CCPMServoZ = 8;
|
||||
data.CCPMThrottle = 8;
|
||||
data.CCPMTailRotor = 8;
|
||||
data.ChannelUpdateFreq[0] = 50;
|
||||
data.ChannelUpdateFreq[1] = 50;
|
||||
data.ChannelMax[0] = 2000;
|
||||
data.ChannelMax[1] = 2000;
|
||||
data.ChannelMax[2] = 2000;
|
||||
data.ChannelMax[3] = 2000;
|
||||
data.ChannelMax[4] = 2000;
|
||||
data.ChannelMax[5] = 2000;
|
||||
data.ChannelMax[6] = 2000;
|
||||
data.ChannelMax[7] = 2000;
|
||||
data.ChannelNeutral[0] = 1500;
|
||||
data.ChannelNeutral[1] = 1500;
|
||||
data.ChannelNeutral[2] = 1500;
|
||||
data.ChannelNeutral[3] = 1500;
|
||||
data.ChannelNeutral[4] = 1500;
|
||||
data.ChannelNeutral[5] = 1500;
|
||||
data.ChannelNeutral[6] = 1500;
|
||||
data.ChannelNeutral[7] = 1500;
|
||||
data.ChannelMin[0] = 1000;
|
||||
data.ChannelMin[1] = 1000;
|
||||
data.ChannelMin[2] = 1000;
|
||||
data.ChannelMin[3] = 1000;
|
||||
data.ChannelMin[4] = 1000;
|
||||
data.ChannelMin[5] = 1000;
|
||||
data.ChannelMin[6] = 1000;
|
||||
data.ChannelMin[7] = 1000;
|
||||
data.FixedWingRoll1 = 8;
|
||||
data.FixedWingRoll2 = 8;
|
||||
data.FixedWingPitch1 = 8;
|
||||
data.FixedWingPitch2 = 8;
|
||||
data.FixedWingYaw = 8;
|
||||
data.FixedWingThrottle = 8;
|
||||
data.VTOLMotorN = 8;
|
||||
data.VTOLMotorNE = 8;
|
||||
data.VTOLMotorE = 8;
|
||||
data.VTOLMotorSE = 8;
|
||||
data.VTOLMotorS = 8;
|
||||
data.VTOLMotorSW = 8;
|
||||
data.VTOLMotorW = 8;
|
||||
data.VTOLMotorNW = 8;
|
||||
data.CCPMYawStabilizationInManualMode = 0;
|
||||
data.CCPMFlybarless = 0;
|
||||
data.CCPMThrottleCurve[0] = 0;
|
||||
data.CCPMThrottleCurve[1] = 0;
|
||||
data.CCPMThrottleCurve[2] = 0;
|
||||
data.CCPMThrottleCurve[3] = 0;
|
||||
data.CCPMThrottleCurve[4] = 0;
|
||||
data.CCPMPitchCurve[0] = 0;
|
||||
data.CCPMPitchCurve[1] = 0;
|
||||
data.CCPMPitchCurve[2] = 0;
|
||||
data.CCPMPitchCurve[3] = 0;
|
||||
data.CCPMPitchCurve[4] = 0;
|
||||
data.CCPMCollectiveConstant = 0.5;
|
||||
data.CCPMCorrectionAngle = 0;
|
||||
data.CCPMAngleW = 0;
|
||||
data.CCPMAngleX = 60;
|
||||
data.CCPMAngleY = 180;
|
||||
data.CCPMAngleZ = 300;
|
||||
data.CCPMServoW = 8;
|
||||
data.CCPMServoX = 8;
|
||||
data.CCPMServoY = 8;
|
||||
data.CCPMServoZ = 8;
|
||||
data.CCPMThrottle = 8;
|
||||
data.CCPMTailRotor = 8;
|
||||
data.ChannelUpdateFreq[0] = 50;
|
||||
data.ChannelUpdateFreq[1] = 50;
|
||||
data.ChannelMax[0] = 2000;
|
||||
data.ChannelMax[1] = 2000;
|
||||
data.ChannelMax[2] = 2000;
|
||||
data.ChannelMax[3] = 2000;
|
||||
data.ChannelMax[4] = 2000;
|
||||
data.ChannelMax[5] = 2000;
|
||||
data.ChannelMax[6] = 2000;
|
||||
data.ChannelMax[7] = 2000;
|
||||
data.ChannelNeutral[0] = 1500;
|
||||
data.ChannelNeutral[1] = 1500;
|
||||
data.ChannelNeutral[2] = 1500;
|
||||
data.ChannelNeutral[3] = 1500;
|
||||
data.ChannelNeutral[4] = 1500;
|
||||
data.ChannelNeutral[5] = 1500;
|
||||
data.ChannelNeutral[6] = 1500;
|
||||
data.ChannelNeutral[7] = 1500;
|
||||
data.ChannelMin[0] = 1000;
|
||||
data.ChannelMin[1] = 1000;
|
||||
data.ChannelMin[2] = 1000;
|
||||
data.ChannelMin[3] = 1000;
|
||||
data.ChannelMin[4] = 1000;
|
||||
data.ChannelMin[5] = 1000;
|
||||
data.ChannelMin[6] = 1000;
|
||||
data.ChannelMin[7] = 1000;
|
||||
|
||||
UAVObjSetInstanceData(obj, instId, &data);
|
||||
|
||||
|
@ -80,31 +80,31 @@ static void setDefaults(UAVObjHandle obj, uint16_t instId)
|
||||
// Initialize object fields to their default values
|
||||
UAVObjGetInstanceData(obj, instId, &data);
|
||||
memset(&data, 0, sizeof(AHRSCalibrationData));
|
||||
data.measure_var = 0;
|
||||
data.accel_bias[0] = -2048;
|
||||
data.accel_bias[1] = -2048;
|
||||
data.accel_bias[2] = -2048;
|
||||
data.accel_scale[0] = 0.012;
|
||||
data.accel_scale[1] = 0.012;
|
||||
data.accel_scale[2] = 0.012;
|
||||
data.accel_var[0] = 5e-05;
|
||||
data.accel_var[1] = 5e-05;
|
||||
data.accel_var[2] = 5e-05;
|
||||
data.gyro_bias[0] = -1675;
|
||||
data.gyro_bias[1] = -1675;
|
||||
data.gyro_bias[2] = -1675;
|
||||
data.gyro_scale[0] = -0.007;
|
||||
data.gyro_scale[1] = -0.007;
|
||||
data.gyro_scale[2] = -0.007;
|
||||
data.gyro_var[0] = 0.0001;
|
||||
data.gyro_var[1] = 0.0001;
|
||||
data.gyro_var[2] = 0.0001;
|
||||
data.mag_bias[0] = 0;
|
||||
data.mag_bias[1] = 0;
|
||||
data.mag_bias[2] = 0;
|
||||
data.mag_var[0] = 5e-05;
|
||||
data.mag_var[1] = 5e-05;
|
||||
data.mag_var[2] = 5e-05;
|
||||
data.measure_var = 0;
|
||||
data.accel_bias[0] = -2048;
|
||||
data.accel_bias[1] = -2048;
|
||||
data.accel_bias[2] = -2048;
|
||||
data.accel_scale[0] = 0.012;
|
||||
data.accel_scale[1] = 0.012;
|
||||
data.accel_scale[2] = 0.012;
|
||||
data.accel_var[0] = 5e-05;
|
||||
data.accel_var[1] = 5e-05;
|
||||
data.accel_var[2] = 5e-05;
|
||||
data.gyro_bias[0] = -1675;
|
||||
data.gyro_bias[1] = -1675;
|
||||
data.gyro_bias[2] = -1675;
|
||||
data.gyro_scale[0] = -0.007;
|
||||
data.gyro_scale[1] = -0.007;
|
||||
data.gyro_scale[2] = -0.007;
|
||||
data.gyro_var[0] = 0.0001;
|
||||
data.gyro_var[1] = 0.0001;
|
||||
data.gyro_var[2] = 0.0001;
|
||||
data.mag_bias[0] = 0;
|
||||
data.mag_bias[1] = 0;
|
||||
data.mag_bias[2] = 0;
|
||||
data.mag_var[0] = 5e-05;
|
||||
data.mag_var[1] = 5e-05;
|
||||
data.mag_var[2] = 5e-05;
|
||||
|
||||
UAVObjSetInstanceData(obj, instId, &data);
|
||||
|
||||
|
@ -80,10 +80,10 @@ static void setDefaults(UAVObjHandle obj, uint16_t instId)
|
||||
// Initialize object fields to their default values
|
||||
UAVObjGetInstanceData(obj, instId, &data);
|
||||
memset(&data, 0, sizeof(AHRSSettingsData));
|
||||
data.Algorithm = 1;
|
||||
data.UpdateRaw = 0;
|
||||
data.UpdateFiltered = 1;
|
||||
data.UpdatePeriod = 20;
|
||||
data.Algorithm = 1;
|
||||
data.UpdateRaw = 0;
|
||||
data.UpdateFiltered = 1;
|
||||
data.UpdatePeriod = 20;
|
||||
|
||||
UAVObjSetInstanceData(obj, instId, &data);
|
||||
|
||||
|
@ -80,9 +80,9 @@ static void setDefaults(UAVObjHandle obj, uint16_t instId)
|
||||
// Initialize object fields to their default values
|
||||
UAVObjGetInstanceData(obj, instId, &data);
|
||||
memset(&data, 0, sizeof(ExampleSettingsData));
|
||||
data.UpdatePeriod = 10;
|
||||
data.StepSize = 1;
|
||||
data.StepDirection = 0;
|
||||
data.UpdatePeriod = 10;
|
||||
data.StepSize = 1;
|
||||
data.StepDirection = 0;
|
||||
|
||||
UAVObjSetInstanceData(obj, instId, &data);
|
||||
|
||||
|
@ -80,25 +80,25 @@ static void setDefaults(UAVObjHandle obj, uint16_t instId)
|
||||
// Initialize object fields to their default values
|
||||
UAVObjGetInstanceData(obj, instId, &data);
|
||||
memset(&data, 0, sizeof(HomeLocationData));
|
||||
data.Set = 0;
|
||||
data.Latitude = 0;
|
||||
data.Longitude = 0;
|
||||
data.Altitude = 0;
|
||||
data.ECEF[0] = 0;
|
||||
data.ECEF[1] = 0;
|
||||
data.ECEF[2] = 0;
|
||||
data.RNE[0] = 0;
|
||||
data.RNE[1] = 0;
|
||||
data.RNE[2] = 0;
|
||||
data.RNE[3] = 0;
|
||||
data.RNE[4] = 0;
|
||||
data.RNE[5] = 0;
|
||||
data.RNE[6] = 0;
|
||||
data.RNE[7] = 0;
|
||||
data.RNE[8] = 0;
|
||||
data.Be[0] = 0;
|
||||
data.Be[1] = 0;
|
||||
data.Be[2] = 0;
|
||||
data.Set = 0;
|
||||
data.Latitude = 0;
|
||||
data.Longitude = 0;
|
||||
data.Altitude = 0;
|
||||
data.ECEF[0] = 0;
|
||||
data.ECEF[1] = 0;
|
||||
data.ECEF[2] = 0;
|
||||
data.RNE[0] = 0;
|
||||
data.RNE[1] = 0;
|
||||
data.RNE[2] = 0;
|
||||
data.RNE[3] = 0;
|
||||
data.RNE[4] = 0;
|
||||
data.RNE[5] = 0;
|
||||
data.RNE[6] = 0;
|
||||
data.RNE[7] = 0;
|
||||
data.RNE[8] = 0;
|
||||
data.Be[0] = 0;
|
||||
data.Be[1] = 0;
|
||||
data.Be[2] = 0;
|
||||
|
||||
UAVObjSetInstanceData(obj, instId, &data);
|
||||
|
||||
|
@ -80,36 +80,36 @@ static void setDefaults(UAVObjHandle obj, uint16_t instId)
|
||||
// Initialize object fields to their default values
|
||||
UAVObjGetInstanceData(obj, instId, &data);
|
||||
memset(&data, 0, sizeof(ManualControlSettingsData));
|
||||
data.InputMode = 0;
|
||||
data.Roll = 0;
|
||||
data.Pitch = 1;
|
||||
data.Yaw = 2;
|
||||
data.Throttle = 3;
|
||||
data.FlightMode = 4;
|
||||
data.ChannelMax[0] = 2000;
|
||||
data.ChannelMax[1] = 2000;
|
||||
data.ChannelMax[2] = 2000;
|
||||
data.ChannelMax[3] = 2000;
|
||||
data.ChannelMax[4] = 2000;
|
||||
data.ChannelMax[5] = 2000;
|
||||
data.ChannelMax[6] = 2000;
|
||||
data.ChannelMax[7] = 2000;
|
||||
data.ChannelNeutral[0] = 1500;
|
||||
data.ChannelNeutral[1] = 1500;
|
||||
data.ChannelNeutral[2] = 1500;
|
||||
data.ChannelNeutral[3] = 1500;
|
||||
data.ChannelNeutral[4] = 1500;
|
||||
data.ChannelNeutral[5] = 1500;
|
||||
data.ChannelNeutral[6] = 1500;
|
||||
data.ChannelNeutral[7] = 1500;
|
||||
data.ChannelMin[0] = 1000;
|
||||
data.ChannelMin[1] = 1000;
|
||||
data.ChannelMin[2] = 1000;
|
||||
data.ChannelMin[3] = 1000;
|
||||
data.ChannelMin[4] = 1000;
|
||||
data.ChannelMin[5] = 1000;
|
||||
data.ChannelMin[6] = 1000;
|
||||
data.ChannelMin[7] = 1000;
|
||||
data.InputMode = 0;
|
||||
data.Roll = 0;
|
||||
data.Pitch = 1;
|
||||
data.Yaw = 2;
|
||||
data.Throttle = 3;
|
||||
data.FlightMode = 4;
|
||||
data.ChannelMax[0] = 2000;
|
||||
data.ChannelMax[1] = 2000;
|
||||
data.ChannelMax[2] = 2000;
|
||||
data.ChannelMax[3] = 2000;
|
||||
data.ChannelMax[4] = 2000;
|
||||
data.ChannelMax[5] = 2000;
|
||||
data.ChannelMax[6] = 2000;
|
||||
data.ChannelMax[7] = 2000;
|
||||
data.ChannelNeutral[0] = 1500;
|
||||
data.ChannelNeutral[1] = 1500;
|
||||
data.ChannelNeutral[2] = 1500;
|
||||
data.ChannelNeutral[3] = 1500;
|
||||
data.ChannelNeutral[4] = 1500;
|
||||
data.ChannelNeutral[5] = 1500;
|
||||
data.ChannelNeutral[6] = 1500;
|
||||
data.ChannelNeutral[7] = 1500;
|
||||
data.ChannelMin[0] = 1000;
|
||||
data.ChannelMin[1] = 1000;
|
||||
data.ChannelMin[2] = 1000;
|
||||
data.ChannelMin[3] = 1000;
|
||||
data.ChannelMin[4] = 1000;
|
||||
data.ChannelMin[5] = 1000;
|
||||
data.ChannelMin[6] = 1000;
|
||||
data.ChannelMin[7] = 1000;
|
||||
|
||||
UAVObjSetInstanceData(obj, instId, &data);
|
||||
|
||||
|
@ -80,14 +80,14 @@ static void setDefaults(UAVObjHandle obj, uint16_t instId)
|
||||
// Initialize object fields to their default values
|
||||
UAVObjGetInstanceData(obj, instId, &data);
|
||||
memset(&data, 0, sizeof(NavigationSettingsData));
|
||||
data.UpdatePeriod = 100;
|
||||
data.AccelerationMax = 35;
|
||||
data.SpeedMax = 300;
|
||||
data.SpeedSafe = 100;
|
||||
data.SpeedMin = 70;
|
||||
data.SettleTime = 12;
|
||||
data.TurnSpeedFactor = 0.1;
|
||||
data.StabilizationForceFactor = 4;
|
||||
data.UpdatePeriod = 100;
|
||||
data.AccelerationMax = 35;
|
||||
data.SpeedMax = 300;
|
||||
data.SpeedSafe = 100;
|
||||
data.SpeedMin = 70;
|
||||
data.SettleTime = 12;
|
||||
data.TurnSpeedFactor = 0.1;
|
||||
data.StabilizationForceFactor = 4;
|
||||
|
||||
UAVObjSetInstanceData(obj, instId, &data);
|
||||
|
||||
|
@ -80,19 +80,19 @@ static void setDefaults(UAVObjHandle obj, uint16_t instId)
|
||||
// Initialize object fields to their default values
|
||||
UAVObjGetInstanceData(obj, instId, &data);
|
||||
memset(&data, 0, sizeof(StabilizationSettingsData));
|
||||
data.UpdatePeriod = 10;
|
||||
data.RollMax = 35;
|
||||
data.PitchMax = 35;
|
||||
data.ThrottleMax = 1;
|
||||
data.PitchKp = 0.04;
|
||||
data.PitchKi = 4e-06;
|
||||
data.PitchKd = 0.01;
|
||||
data.RollKp = 0.02;
|
||||
data.RollKi = 4e-06;
|
||||
data.RollKd = 0.01;
|
||||
data.YawKp = 0.04;
|
||||
data.YawKi = 4e-06;
|
||||
data.YawKd = 0.01;
|
||||
data.UpdatePeriod = 10;
|
||||
data.RollMax = 35;
|
||||
data.PitchMax = 35;
|
||||
data.ThrottleMax = 1;
|
||||
data.PitchKp = 0.04;
|
||||
data.PitchKi = 4e-06;
|
||||
data.PitchKd = 0.01;
|
||||
data.RollKp = 0.02;
|
||||
data.RollKi = 4e-06;
|
||||
data.RollKd = 0.01;
|
||||
data.YawKp = 0.04;
|
||||
data.YawKi = 4e-06;
|
||||
data.YawKd = 0.01;
|
||||
|
||||
UAVObjSetInstanceData(obj, instId, &data);
|
||||
|
||||
|
@ -80,7 +80,7 @@ static void setDefaults(UAVObjHandle obj, uint16_t instId)
|
||||
// Initialize object fields to their default values
|
||||
UAVObjGetInstanceData(obj, instId, &data);
|
||||
memset(&data, 0, sizeof(SystemSettingsData));
|
||||
data.AirframeType = 0;
|
||||
data.AirframeType = 0;
|
||||
|
||||
UAVObjSetInstanceData(obj, instId, &data);
|
||||
|
||||
|
@ -80,7 +80,7 @@ static void setDefaults(UAVObjHandle obj, uint16_t instId)
|
||||
// Initialize object fields to their default values
|
||||
UAVObjGetInstanceData(obj, instId, &data);
|
||||
memset(&data, 0, sizeof(TelemetrySettingsData));
|
||||
data.Speed = 2;
|
||||
data.Speed = 2;
|
||||
|
||||
UAVObjSetInstanceData(obj, instId, &data);
|
||||
|
||||
|
@ -783,19 +783,19 @@ bool UAVObjectParser::generateFlightObject(int objIndex, const QString& template
|
||||
{
|
||||
if ( info->fields[n]->type == FIELDTYPE_ENUM )
|
||||
{
|
||||
initfields.append( QString(" data.%1 = %2;\n")
|
||||
initfields.append( QString("\tdata.%1 = %2;\n")
|
||||
.arg( info->fields[n]->name )
|
||||
.arg( info->fields[n]->options.indexOf( info->fields[n]->defaultValue ) ) );
|
||||
}
|
||||
else if ( info->fields[n]->type == FIELDTYPE_FLOAT32 )
|
||||
{
|
||||
initfields.append( QString(" data.%1 = %2;\n")
|
||||
initfields.append( QString("\tdata.%1 = %2;\n")
|
||||
.arg( info->fields[n]->name )
|
||||
.arg( info->fields[n]->defaultValue.toFloat() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
initfields.append( QString(" data.%1 = %2;\n")
|
||||
initfields.append( QString("\tdata.%1 = %2;\n")
|
||||
.arg( info->fields[n]->name )
|
||||
.arg( info->fields[n]->defaultValue.toInt() ) );
|
||||
}
|
||||
@ -807,21 +807,21 @@ bool UAVObjectParser::generateFlightObject(int objIndex, const QString& template
|
||||
{
|
||||
if ( info->fields[n]->type == FIELDTYPE_ENUM )
|
||||
{
|
||||
initfields.append( QString(" data.%1[%2] = %3;\n")
|
||||
initfields.append( QString("\tdata.%1[%2] = %3;\n")
|
||||
.arg( info->fields[n]->name )
|
||||
.arg( idx )
|
||||
.arg( info->fields[n]->options.indexOf( info->fields[n]->defaultValue ) ) );
|
||||
}
|
||||
else if ( info->fields[n]->type == FIELDTYPE_FLOAT32 )
|
||||
{
|
||||
initfields.append( QString(" data.%1[%2] = %3;\n")
|
||||
initfields.append( QString("\tdata.%1[%2] = %3;\n")
|
||||
.arg( info->fields[n]->name )
|
||||
.arg( idx )
|
||||
.arg( info->fields[n]->defaultValue.toFloat() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
initfields.append( QString(" data.%1[%2] = %3;\n")
|
||||
initfields.append( QString("\tdata.%1[%2] = %3;\n")
|
||||
.arg( info->fields[n]->name )
|
||||
.arg( idx )
|
||||
.arg( info->fields[n]->defaultValue.toInt() ) );
|
||||
|
Loading…
x
Reference in New Issue
Block a user