void ConfigStabilizationWidget::swapBankAndCurrent(int bank) { UAVObject *fromStabBankObject = getStabBankObject(m_currentStabSettingsBank); UAVObject *toStabBankObject = getStabBankObject(bank); if (fromStabBankObject && toStabBankObject) { quint8 fromStabBankObjectData[fromStabBankObject->getNumBytes()]; quint8 toStabBankObjectData[toStabBankObject->getNumBytes()]; fromStabBankObject->pack(fromStabBankObjectData); toStabBankObject->pack(toStabBankObjectData); toStabBankObject->unpack(fromStabBankObjectData); fromStabBankObject->unpack(toStabBankObjectData); } }
void ConfigStabilizationWidget::copyFromBankToBank(int fromBank, int toBank) { UAVObject *fromStabBankObject = getStabBankObject(fromBank); UAVObject *toStabBankObject = getStabBankObject(toBank); if (fromStabBankObject && toStabBankObject) { quint8 data[fromStabBankObject->getNumBytes()]; fromStabBankObject->pack(data); toStabBankObject->unpack(data); } }
void ConfigStabilizationWidget::copyCurrentStabBank() { UAVObject *fromStabBankObject = getStabBankObject(m_currentStabSettingsBank); if (fromStabBankObject) { quint8 fromStabBankObjectData[fromStabBankObject->getNumBytes()]; fromStabBankObject->pack(fromStabBankObjectData); for (int i = 0; i < m_stabSettingsBankCount; i++) { if (i != m_currentStabSettingsBank) { UAVObject *toStabBankObject = getStabBankObject(i); if (toStabBankObject) { toStabBankObject->unpack(fromStabBankObjectData); } } } } }