1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-30 15:52:12 +01:00

OP-1058 uncrustify

This commit is contained in:
Alessio Morale 2013-08-01 01:28:50 +02:00
parent f226b23c24
commit 01d963affd
8 changed files with 56 additions and 57 deletions

View File

@ -358,7 +358,7 @@ static void updateFixedAttitude(float *attitude)
stabDesired.Pitch = attitude[1]; stabDesired.Pitch = attitude[1];
stabDesired.Yaw = attitude[2]; stabDesired.Yaw = attitude[2];
stabDesired.Throttle = attitude[3]; stabDesired.Throttle = attitude[3];
stabDesired.StabilizationMode.fields.Roll = STABILIZATIONDESIRED_STABILIZATIONMODE_ATTITUDE; stabDesired.StabilizationMode.fields.Roll = STABILIZATIONDESIRED_STABILIZATIONMODE_ATTITUDE;
stabDesired.StabilizationMode.fields.Pitch = STABILIZATIONDESIRED_STABILIZATIONMODE_ATTITUDE; stabDesired.StabilizationMode.fields.Pitch = STABILIZATIONDESIRED_STABILIZATIONMODE_ATTITUDE;
stabDesired.StabilizationMode.fields.Yaw = STABILIZATIONDESIRED_STABILIZATIONMODE_RATE; stabDesired.StabilizationMode.fields.Yaw = STABILIZATIONDESIRED_STABILIZATIONMODE_RATE;
StabilizationDesiredSet(&stabDesired); StabilizationDesiredSet(&stabDesired);
@ -494,9 +494,9 @@ static uint8_t updateFixedDesiredAttitude()
speedErrorToPowerCommandComponent; speedErrorToPowerCommandComponent;
// Output internal state to telemetry // Output internal state to telemetry
fixedwingpathfollowerStatus.Error.fields.Power = descentspeedError; fixedwingpathfollowerStatus.Error.fields.Power = descentspeedError;
fixedwingpathfollowerStatus.ErrorInt.fields.Power = powerIntegral; fixedwingpathfollowerStatus.ErrorInt.fields.Power = powerIntegral;
fixedwingpathfollowerStatus.Command.fields.Power = powerCommand; fixedwingpathfollowerStatus.Command.fields.Power = powerCommand;
// set throttle // set throttle
stabDesired.Throttle = bound(fixedwingpathfollowerSettings.ThrottleLimit.fields.Neutral + powerCommand, stabDesired.Throttle = bound(fixedwingpathfollowerSettings.ThrottleLimit.fields.Neutral + powerCommand,
@ -519,7 +519,7 @@ static uint8_t updateFixedDesiredAttitude()
velocityState.Down < 0 && // we ARE going up velocityState.Down < 0 && // we ARE going up
descentspeedDesired > 0 && // we WANT to go down descentspeedDesired > 0 && // we WANT to go down
airspeedError < 0 && // we are too fast already airspeedError < 0 && // we are too fast already
fixedwingpathfollowerSettings.Safetymargins.fields.Highpower > 0.5f) { // alarm switched on fixedwingpathfollowerSettings.Safetymargins.fields.Highpower > 0.5f) { // alarm switched on
fixedwingpathfollowerStatus.Errors.fields.Highpower = 1; fixedwingpathfollowerStatus.Errors.fields.Highpower = 1;
result = 0; result = 0;
} }
@ -547,9 +547,9 @@ static uint8_t updateFixedDesiredAttitude()
+ airspeedErrorInt * fixedwingpathfollowerSettings.SpeedPI.fields.Ki + airspeedErrorInt * fixedwingpathfollowerSettings.SpeedPI.fields.Ki
) + verticalSpeedToPitchCommandComponent; ) + verticalSpeedToPitchCommandComponent;
fixedwingpathfollowerStatus.Error.fields.Speed = airspeedError; fixedwingpathfollowerStatus.Error.fields.Speed = airspeedError;
fixedwingpathfollowerStatus.ErrorInt.fields.Speed = airspeedErrorInt; fixedwingpathfollowerStatus.ErrorInt.fields.Speed = airspeedErrorInt;
fixedwingpathfollowerStatus.Command.fields.Speed = pitchCommand; fixedwingpathfollowerStatus.Command.fields.Speed = pitchCommand;
stabDesired.Pitch = bound(fixedwingpathfollowerSettings.PitchLimit.fields.Neutral + pitchCommand, stabDesired.Pitch = bound(fixedwingpathfollowerSettings.PitchLimit.fields.Neutral + pitchCommand,
fixedwingpathfollowerSettings.PitchLimit.fields.Min, fixedwingpathfollowerSettings.PitchLimit.fields.Min,
@ -561,7 +561,7 @@ static uint8_t updateFixedDesiredAttitude()
velocityState.Down > 0 && // we ARE going down velocityState.Down > 0 && // we ARE going down
descentspeedDesired < 0 && // we WANT to go up descentspeedDesired < 0 && // we WANT to go up
airspeedError < 0 && // we are too fast already airspeedError < 0 && // we are too fast already
fixedwingpathfollowerSettings.Safetymargins.fields.Pitchcontrol > 0.5f) { // alarm switched on fixedwingpathfollowerSettings.Safetymargins.fields.Pitchcontrol > 0.5f) { // alarm switched on
fixedwingpathfollowerStatus.Errors.fields.Pitchcontrol = 1; fixedwingpathfollowerStatus.Errors.fields.Pitchcontrol = 1;
result = 0; result = 0;
} }
@ -614,9 +614,9 @@ static uint8_t updateFixedDesiredAttitude()
courseCommand = (courseError * fixedwingpathfollowerSettings.CoursePI.fields.Kp + courseCommand = (courseError * fixedwingpathfollowerSettings.CoursePI.fields.Kp +
courseIntegral); courseIntegral);
fixedwingpathfollowerStatus.Error.fields.Course = courseError; fixedwingpathfollowerStatus.Error.fields.Course = courseError;
fixedwingpathfollowerStatus.ErrorInt.fields.Course = courseIntegral; fixedwingpathfollowerStatus.ErrorInt.fields.Course = courseIntegral;
fixedwingpathfollowerStatus.Command.fields.Course = courseCommand; fixedwingpathfollowerStatus.Command.fields.Course = courseCommand;
stabDesired.Roll = bound(fixedwingpathfollowerSettings.RollLimit.fields.Neutral + stabDesired.Roll = bound(fixedwingpathfollowerSettings.RollLimit.fields.Neutral +
courseCommand, courseCommand,

View File

@ -686,17 +686,17 @@ static void updateStabilizationDesired(ManualControlCommandData *cmd, ManualCont
} }
// TOOD: Add assumption about order of stabilization desired and manual control stabilization mode fields having same order // TOOD: Add assumption about order of stabilization desired and manual control stabilization mode fields having same order
stabilization.StabilizationMode.fields.Roll = stab_settings[0]; stabilization.StabilizationMode.fields.Roll = stab_settings[0];
stabilization.StabilizationMode.fields.Pitch = stab_settings[1]; stabilization.StabilizationMode.fields.Pitch = stab_settings[1];
stabilization.StabilizationMode.fields.Yaw = stab_settings[2]; stabilization.StabilizationMode.fields.Yaw = stab_settings[2];
stabilization.Roll = stabilization.Roll =
(stab_settings[0] == STABILIZATIONDESIRED_STABILIZATIONMODE_NONE) ? cmd->Roll : (stab_settings[0] == STABILIZATIONDESIRED_STABILIZATIONMODE_NONE) ? cmd->Roll :
(stab_settings[0] == STABILIZATIONDESIRED_STABILIZATIONMODE_RATE) ? cmd->Roll * stabSettings.ManualRate.fields.Roll: (stab_settings[0] == STABILIZATIONDESIRED_STABILIZATIONMODE_RATE) ? cmd->Roll * stabSettings.ManualRate.fields.Roll :
(stab_settings[0] == STABILIZATIONDESIRED_STABILIZATIONMODE_WEAKLEVELING) ? (stab_settings[0] == STABILIZATIONDESIRED_STABILIZATIONMODE_WEAKLEVELING) ?
cmd->Roll * stabSettings.ManualRate.fields.Roll : cmd->Roll * stabSettings.ManualRate.fields.Roll :
(stab_settings[0] == STABILIZATIONDESIRED_STABILIZATIONMODE_ATTITUDE) ? cmd->Roll * stabSettings.RollMax : (stab_settings[0] == STABILIZATIONDESIRED_STABILIZATIONMODE_ATTITUDE) ? cmd->Roll * stabSettings.RollMax :
(stab_settings[0] == STABILIZATIONDESIRED_STABILIZATIONMODE_AXISLOCK) ? cmd->Roll * stabSettings.ManualRate.fields.Roll: (stab_settings[0] == STABILIZATIONDESIRED_STABILIZATIONMODE_AXISLOCK) ? cmd->Roll * stabSettings.ManualRate.fields.Roll :
(stab_settings[0] == STABILIZATIONDESIRED_STABILIZATIONMODE_VIRTUALBAR) ? cmd->Roll : (stab_settings[0] == STABILIZATIONDESIRED_STABILIZATIONMODE_VIRTUALBAR) ? cmd->Roll :
(stab_settings[0] == STABILIZATIONDESIRED_STABILIZATIONMODE_RELAYRATE) ? (stab_settings[0] == STABILIZATIONDESIRED_STABILIZATIONMODE_RELAYRATE) ?
cmd->Roll * stabSettings.ManualRate.fields.Roll : cmd->Roll * stabSettings.ManualRate.fields.Roll :
@ -757,11 +757,11 @@ static void updatePathDesired(__attribute__((unused)) ManualControlCommandData *
pathDesired.Start.fields.North = 0; pathDesired.Start.fields.North = 0;
pathDesired.Start.fields.East = 0; pathDesired.Start.fields.East = 0;
pathDesired.Start.fields.Down = positionState.Down - settings.ReturnToHomeAltitudeOffset; pathDesired.Start.fields.Down = positionState.Down - settings.ReturnToHomeAltitudeOffset;
pathDesired.End.fields.North = 0; pathDesired.End.fields.North = 0;
pathDesired.End.fields.East = 0; pathDesired.End.fields.East = 0;
pathDesired.End.fields.Down = positionState.Down - settings.ReturnToHomeAltitudeOffset; pathDesired.End.fields.Down = positionState.Down - settings.ReturnToHomeAltitudeOffset;
pathDesired.StartingVelocity = 1; pathDesired.StartingVelocity = 1;
pathDesired.EndingVelocity = 0; pathDesired.EndingVelocity = 0;
pathDesired.Mode = PATHDESIRED_MODE_FLYENDPOINT; pathDesired.Mode = PATHDESIRED_MODE_FLYENDPOINT;
PathDesiredSet(&pathDesired); PathDesiredSet(&pathDesired);
} else if (changed) { } else if (changed) {
@ -772,13 +772,13 @@ static void updatePathDesired(__attribute__((unused)) ManualControlCommandData *
PathDesiredData pathDesired; PathDesiredData pathDesired;
PathDesiredGet(&pathDesired); PathDesiredGet(&pathDesired);
pathDesired.Start.fields.North = positionState.North; pathDesired.Start.fields.North = positionState.North;
pathDesired.Start.fields.East = positionState.East; pathDesired.Start.fields.East = positionState.East;
pathDesired.Start.fields.Down = positionState.Down; pathDesired.Start.fields.Down = positionState.Down;
pathDesired.End.fields.North = positionState.North; pathDesired.End.fields.North = positionState.North;
pathDesired.End.fields.East = positionState.East; pathDesired.End.fields.East = positionState.East;
pathDesired.End.fields.Down = positionState.Down; pathDesired.End.fields.Down = positionState.Down;
pathDesired.StartingVelocity = 1; pathDesired.StartingVelocity = 1;
pathDesired.EndingVelocity = 0; pathDesired.EndingVelocity = 0;
pathDesired.Mode = PATHDESIRED_MODE_FLYENDPOINT; pathDesired.Mode = PATHDESIRED_MODE_FLYENDPOINT;
PathDesiredSet(&pathDesired); PathDesiredSet(&pathDesired);
/* Disable this section, until such time as proper discussion can be had about how to implement it for all types of crafts. /* Disable this section, until such time as proper discussion can be had about how to implement it for all types of crafts.
@ -816,11 +816,11 @@ static void updateLandDesired(__attribute__((unused)) ManualControlCommandData *
pathDesired.Start.fields.North = positionState.North; pathDesired.Start.fields.North = positionState.North;
pathDesired.Start.fields.East = positionState.East; pathDesired.Start.fields.East = positionState.East;
pathDesired.Start.fields.Down = positionState.Down; pathDesired.Start.fields.Down = positionState.Down;
pathDesired.End.fields.North = positionState.North; pathDesired.End.fields.North = positionState.North;
pathDesired.End.fields.East = positionState.East; pathDesired.End.fields.East = positionState.East;
pathDesired.End.fields.Down = positionState.Down; pathDesired.End.fields.Down = positionState.Down;
pathDesired.StartingVelocity = 1; pathDesired.StartingVelocity = 1;
pathDesired.EndingVelocity = 0; pathDesired.EndingVelocity = 0;
pathDesired.Mode = PATHDESIRED_MODE_FLYENDPOINT; pathDesired.Mode = PATHDESIRED_MODE_FLYENDPOINT;
} }
pathDesired.End.fields.Down = positionState.Down + 5; pathDesired.End.fields.Down = positionState.Down + 5;

View File

@ -227,9 +227,9 @@ void updatePathDesired(__attribute__((unused)) UAVObjEvent *ev)
WaypointInstGet(waypointActiveData.Index, &waypointData); WaypointInstGet(waypointActiveData.Index, &waypointData);
PathActionInstGet(waypointData.Action, &pathActionData); PathActionInstGet(waypointData.Action, &pathActionData);
pathDesired.End.fields.North = waypointData.Position.fields.North; pathDesired.End.fields.North = waypointData.Position.fields.North;
pathDesired.End.fields.East = waypointData.Position.fields.East; pathDesired.End.fields.East = waypointData.Position.fields.East;
pathDesired.End.fields.Down = waypointData.Position.fields.Down; pathDesired.End.fields.Down = waypointData.Position.fields.Down;
pathDesired.EndingVelocity = waypointData.Velocity; pathDesired.EndingVelocity = waypointData.Velocity;
pathDesired.Mode = pathActionData.Mode; pathDesired.Mode = pathActionData.Mode;
pathDesired.ModeParameters[0] = pathActionData.ModeParameters[0]; pathDesired.ModeParameters[0] = pathActionData.ModeParameters[0];
@ -247,18 +247,18 @@ void updatePathDesired(__attribute__((unused)) UAVObjEvent *ev)
pathDesired.Start[PATHDESIRED_START_EAST] = waypoint.Position[WAYPOINT_POSITION_EAST]; pathDesired.Start[PATHDESIRED_START_EAST] = waypoint.Position[WAYPOINT_POSITION_EAST];
pathDesired.Start[PATHDESIRED_START_DOWN] = waypoint.Position[WAYPOINT_POSITION_DOWN];*/ pathDesired.Start[PATHDESIRED_START_DOWN] = waypoint.Position[WAYPOINT_POSITION_DOWN];*/
pathDesired.Start.fields.North = positionState.North; pathDesired.Start.fields.North = positionState.North;
pathDesired.Start.fields.East = positionState.East; pathDesired.Start.fields.East = positionState.East;
pathDesired.Start.fields.Down = positionState.Down; pathDesired.Start.fields.Down = positionState.Down;
pathDesired.StartingVelocity = pathDesired.EndingVelocity; pathDesired.StartingVelocity = pathDesired.EndingVelocity;
} else { } else {
// Get previous waypoint as start point // Get previous waypoint as start point
WaypointData waypointPrev; WaypointData waypointPrev;
WaypointInstGet(waypointActive.Index - 1, &waypointPrev); WaypointInstGet(waypointActive.Index - 1, &waypointPrev);
pathDesired.Start.fields.North = waypointPrev.Position.fields.North; pathDesired.Start.fields.North = waypointPrev.Position.fields.North;
pathDesired.Start.fields.East = waypointPrev.Position.fields.East; pathDesired.Start.fields.East = waypointPrev.Position.fields.East;
pathDesired.Start.fields.Down = waypointPrev.Position.fields.Down; pathDesired.Start.fields.Down = waypointPrev.Position.fields.Down;
pathDesired.StartingVelocity = waypointPrev.Velocity; pathDesired.StartingVelocity = waypointPrev.Velocity;
} }
PathDesiredSet(&pathDesired); PathDesiredSet(&pathDesired);
} }

View File

@ -446,14 +446,14 @@ static void settingsUpdatedCb(__attribute__((unused)) UAVObjEvent *objEv)
AttitudeSettingsGet(&attitudeSettings); AttitudeSettingsGet(&attitudeSettings);
// Indicates not to expend cycles on rotation // Indicates not to expend cycles on rotation
if (attitudeSettings.BoardRotation.fields.Roll== 0 && attitudeSettings.BoardRotation.fields.Pitch == 0 && if (attitudeSettings.BoardRotation.fields.Roll == 0 && attitudeSettings.BoardRotation.fields.Pitch == 0 &&
attitudeSettings.BoardRotation.fields.Yaw == 0) { attitudeSettings.BoardRotation.fields.Yaw == 0) {
rotate = 0; rotate = 0;
} else { } else {
float rotationQuat[4]; float rotationQuat[4];
const float rpy[3] = { attitudeSettings.BoardRotation.fields.Roll, const float rpy[3] = { attitudeSettings.BoardRotation.fields.Roll,
attitudeSettings.BoardRotation.fields.Pitch , attitudeSettings.BoardRotation.fields.Pitch,
attitudeSettings.BoardRotation.fields.Yaw}; attitudeSettings.BoardRotation.fields.Yaw };
RPY2Quaternion(rpy, rotationQuat); RPY2Quaternion(rpy, rotationQuat);
Quaternion2R(rotationQuat, R); Quaternion2R(rotationQuat, R);
rotate = 1; rotate = 1;

View File

@ -70,9 +70,9 @@ int stabilization_relay_rate(float error, float *output, int axis, bool reinit)
// On first run initialize estimates to something reasonable // On first run initialize estimates to something reasonable
if (reinit) { if (reinit) {
rateRelayRunning[axis] = false; rateRelayRunning[axis] = false;
relay.Period.data[axis] = 200; relay.Period.data[axis] = 200;
relay.Gain.data[axis] = 0; relay.Gain.data[axis] = 0;
accum_sin = 0; accum_sin = 0;
accum_cos = 0; accum_cos = 0;
@ -124,9 +124,9 @@ int stabilization_relay_rate(float error, float *output, int axis, bool reinit)
accum_cos = 0; accum_cos = 0;
if (rateRelayRunning[axis] == false) { if (rateRelayRunning[axis] == false) {
rateRelayRunning[axis] = true; rateRelayRunning[axis] = true;
relay.Period.data[axis] = 200; relay.Period.data[axis] = 200;
relay.Gain.data[axis] = 0; relay.Gain.data[axis] = 0;
} else { } else {
// Low pass filter each amplitude and period // Low pass filter each amplitude and period
relay.Gain.data[axis] = relay.Gain.data[axis] * AMPLITUDE_ALPHA + this_gain * (1 - AMPLITUDE_ALPHA); relay.Gain.data[axis] = relay.Gain.data[axis] * AMPLITUDE_ALPHA + this_gain * (1 - AMPLITUDE_ALPHA);

View File

@ -503,7 +503,7 @@ static void SettingsUpdatedCb(__attribute__((unused)) UAVObjEvent *ev)
lowThrottleZeroIntegral = settings.LowThrottleZeroIntegral == STABILIZATIONSETTINGS_LOWTHROTTLEZEROINTEGRAL_TRUE; lowThrottleZeroIntegral = settings.LowThrottleZeroIntegral == STABILIZATIONSETTINGS_LOWTHROTTLEZEROINTEGRAL_TRUE;
// Whether to suppress (zero) the StabilizationDesired output for each axis while disarmed or throttle is low // Whether to suppress (zero) the StabilizationDesired output for each axis while disarmed or throttle is low
lowThrottleZeroAxis[ROLL] = settings.LowThrottleZeroAxis.fields.Roll== STABILIZATIONSETTINGS_LOWTHROTTLEZEROAXIS_TRUE; lowThrottleZeroAxis[ROLL] = settings.LowThrottleZeroAxis.fields.Roll == STABILIZATIONSETTINGS_LOWTHROTTLEZEROAXIS_TRUE;
lowThrottleZeroAxis[PITCH] = settings.LowThrottleZeroAxis.fields.Pitch == STABILIZATIONSETTINGS_LOWTHROTTLEZEROAXIS_TRUE; lowThrottleZeroAxis[PITCH] = settings.LowThrottleZeroAxis.fields.Pitch == STABILIZATIONSETTINGS_LOWTHROTTLEZEROAXIS_TRUE;
lowThrottleZeroAxis[YAW] = settings.LowThrottleZeroAxis.fields.Yaw == STABILIZATIONSETTINGS_LOWTHROTTLEZEROAXIS_TRUE; lowThrottleZeroAxis[YAW] = settings.LowThrottleZeroAxis.fields.Yaw == STABILIZATIONSETTINGS_LOWTHROTTLEZEROAXIS_TRUE;

View File

@ -673,7 +673,7 @@ static void updateVtolDesiredAttitude(bool yaw_attitude)
stabDesired.Throttle = manualControl.Throttle; stabDesired.Throttle = manualControl.Throttle;
} }
stabDesired.StabilizationMode.fields.Roll = STABILIZATIONDESIRED_STABILIZATIONMODE_ATTITUDE; stabDesired.StabilizationMode.fields.Roll = STABILIZATIONDESIRED_STABILIZATIONMODE_ATTITUDE;
stabDesired.StabilizationMode.fields.Pitch = STABILIZATIONDESIRED_STABILIZATIONMODE_ATTITUDE; stabDesired.StabilizationMode.fields.Pitch = STABILIZATIONDESIRED_STABILIZATIONMODE_ATTITUDE;
if (yaw_attitude) { if (yaw_attitude) {
stabDesired.StabilizationMode.fields.Yaw = STABILIZATIONDESIRED_STABILIZATIONMODE_ATTITUDE; stabDesired.StabilizationMode.fields.Yaw = STABILIZATIONDESIRED_STABILIZATIONMODE_ATTITUDE;

View File

@ -125,12 +125,12 @@ bool UAVObjectGeneratorFlight::process_object(ObjectInfo *info)
// Append field // Append field
// Check if it a named set and creates structures accordingly // Check if it a named set and creates structures accordingly
if (info->fields[n]->numElements > 1) { if (info->fields[n]->numElements > 1) {
if(info->fields[n]->elementNames[0].compare(QString("0")) != 0){ if (info->fields[n]->elementNames[0].compare(QString("0")) != 0) {
QString unionTypeName = QString("%1%2Data").arg(info->name).arg(info->fields[n]->name); QString unionTypeName = QString("%1%2Data").arg(info->name).arg(info->fields[n]->name);
QString unionType = QString("typedef union {\n"); QString unionType = QString("typedef union {\n");
unionType.append(QString(" %1 data[%2];\n").arg(type).arg(info->fields[n]->numElements)); unionType.append(QString(" %1 data[%2];\n").arg(type).arg(info->fields[n]->numElements));
unionType.append(QString(" struct __attribute__ ((__packed__)) {\n")); unionType.append(QString(" struct __attribute__ ((__packed__)) {\n"));
for(int f =0; f < info->fields[n]->elementNames.count(); f++){ for (int f = 0; f < info->fields[n]->elementNames.count(); f++) {
unionType.append(QString(" %1 %2;\n").arg(type).arg(info->fields[n]->elementNames[f])); unionType.append(QString(" %1 %2;\n").arg(type).arg(info->fields[n]->elementNames[f]));
} }
unionType.append(QString(" } fields;\n")); unionType.append(QString(" } fields;\n"));
@ -140,10 +140,9 @@ bool UAVObjectGeneratorFlight::process_object(ObjectInfo *info)
fields.append(QString(" %1 %2;\n").arg(unionTypeName) fields.append(QString(" %1 %2;\n").arg(unionTypeName)
.arg(info->fields[n]->name)); .arg(info->fields[n]->name));
} else { } else {
fields.append(QString(" %1 %2[%3];\n").arg(type) fields.append(QString(" %1 %2[%3];\n").arg(type)
.arg(info->fields[n]->name).arg(info->fields[n]->numElements)); .arg(info->fields[n]->name).arg(info->fields[n]->numElements));
} }
} else { } else {
fields.append(QString(" %1 %2;\n").arg(type).arg(info->fields[n]->name)); fields.append(QString(" %1 %2;\n").arg(type).arg(info->fields[n]->name));
@ -227,7 +226,7 @@ bool UAVObjectGeneratorFlight::process_object(ObjectInfo *info)
// Initialize all fields in the array // Initialize all fields in the array
for (int idx = 0; idx < info->fields[n]->numElements; ++idx) { for (int idx = 0; idx < info->fields[n]->numElements; ++idx) {
QString optIdentifier; QString optIdentifier;
if(info->fields[n]->elementNames[0].compare(QString("0")) != 0){ if (info->fields[n]->elementNames[0].compare(QString("0")) != 0) {
optIdentifier = QString(".data"); optIdentifier = QString(".data");
} }