@@ -281,23 +281,16 @@ bool ConfigFixedWingWidget::setupFrameFixedWing(QString airframeType)
281
281
282
282
UAVDataObject* mixer = dynamic_cast <UAVDataObject*>(getObjectManager ()->getObject (QString (" MixerSettings" )));
283
283
Q_ASSERT (mixer);
284
+ resetMixers (mixer);
284
285
285
286
// ... and compute the matrix:
286
287
// In order to make code a bit nicer, we assume:
287
288
// - Channel dropdowns start with 'None', then 0 to 7
288
289
289
290
// 1. Assign the servo/motor/none for each channel
290
291
291
- int channel;
292
- // disable all
293
- for (channel=0 ; (unsigned int ) channel < VehicleConfig::CHANNEL_NUMELEM; channel++)
294
- {
295
- setMixerType (mixer,channel,VehicleConfig::MIXERTYPE_DISABLED);
296
- resetMixerVector (mixer, channel);
297
- }
298
-
299
292
// motor
300
- channel = m_aircraft->fwEngineChannelBox ->currentIndex ()-1 ;
293
+ int channel = m_aircraft->fwEngineChannelBox ->currentIndex ()-1 ;
301
294
setMixerType (mixer,channel,VehicleConfig::MIXERTYPE_MOTOR);
302
295
setMixerVectorValue (mixer,channel,VehicleConfig::MIXERVECTOR_THROTTLECURVE1, 127 );
303
296
@@ -359,6 +352,7 @@ bool ConfigFixedWingWidget::setupFrameElevon(QString airframeType)
359
352
360
353
UAVDataObject* mixer = dynamic_cast <UAVDataObject*>(getObjectManager ()->getObject (QString (" MixerSettings" )));
361
354
Q_ASSERT (mixer);
355
+ resetMixers (mixer);
362
356
363
357
// Save the curve:
364
358
// ... and compute the matrix:
@@ -367,17 +361,10 @@ bool ConfigFixedWingWidget::setupFrameElevon(QString airframeType)
367
361
368
362
// 1. Assign the servo/motor/none for each channel
369
363
370
- int channel;
371
364
double value;
372
- // disable all
373
- for (channel=0 ; (unsigned int ) channel < VehicleConfig::CHANNEL_NUMELEM; channel++)
374
- {
375
- setMixerType (mixer,channel,VehicleConfig::MIXERTYPE_DISABLED);
376
- resetMixerVector (mixer, channel);
377
- }
378
365
379
366
// motor
380
- channel = m_aircraft->fwEngineChannelBox ->currentIndex ()-1 ;
367
+ int channel = m_aircraft->fwEngineChannelBox ->currentIndex ()-1 ;
381
368
setMixerType (mixer,channel,VehicleConfig::MIXERTYPE_MOTOR);
382
369
setMixerVectorValue (mixer,channel,VehicleConfig::MIXERVECTOR_THROTTLECURVE1, 127 );
383
370
@@ -437,6 +424,7 @@ bool ConfigFixedWingWidget::setupFrameVtail(QString airframeType)
437
424
438
425
UAVDataObject* mixer = dynamic_cast <UAVDataObject*>(getObjectManager ()->getObject (QString (" MixerSettings" )));
439
426
Q_ASSERT (mixer);
427
+ resetMixers (mixer);
440
428
441
429
// Save the curve:
442
430
// ... and compute the matrix:
@@ -445,17 +433,10 @@ bool ConfigFixedWingWidget::setupFrameVtail(QString airframeType)
445
433
446
434
// 1. Assign the servo/motor/none for each channel
447
435
448
- int channel;
449
436
double value;
450
- // disable all
451
- for (channel=0 ; (unsigned int ) channel < VehicleConfig::CHANNEL_NUMELEM; channel++)
452
- {
453
- setMixerType (mixer,channel,VehicleConfig::MIXERTYPE_DISABLED);
454
- resetMixerVector (mixer, channel);
455
- }
456
437
457
438
// motor
458
- channel = m_aircraft->fwEngineChannelBox ->currentIndex ()-1 ;
439
+ int channel = m_aircraft->fwEngineChannelBox ->currentIndex ()-1 ;
459
440
setMixerType (mixer,channel,VehicleConfig::MIXERTYPE_MOTOR);
460
441
setMixerVectorValue (mixer,channel,VehicleConfig::MIXERVECTOR_THROTTLECURVE1, 127 );
461
442
0 commit comments