/* Copyright (C) 2013 VATSIM Community / contributors * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "blackmisc/aviomodulator.h" #include "blackmisc/aviocomsystem.h" #include "blackmisc/avionavsystem.h" #include "blackmisc/avioadfsystem.h" #include "blackmisc/blackmiscfreefunctions.h" using BlackMisc::PhysicalQuantities::CFrequency; using BlackMisc::PhysicalQuantities::CFrequencyUnit; namespace BlackMisc { namespace Aviation { /* * Toggle standby <-> active */ template void CModulator::toggleActiveStandby() { CFrequency a = this->m_frequencyActive; this->m_frequencyActive = this->m_frequencyStandby; this->m_frequencyStandby = a; } /* * Register metadata */ template void CModulator::registerMetadata() { qRegisterMetaType(); qDBusRegisterMetaType(); } /* * Equal operator == */ template bool CModulator::operator ==(const CModulator &other) const { if (this == &other) return true; return (this->getName() == other.getName() && this->m_frequencyActive == other.m_frequencyActive && this->m_frequencyStandby == other.m_frequencyStandby); } /* * Equal operator != */ template bool CModulator::operator !=(const CModulator &other) const { return !(other == (*this)); } /* * To DBus */ template void CModulator::marshallToDbus(QDBusArgument &argument) const { this->CAvionicsBase::marshallToDbus(argument); argument << this->m_frequencyActive; argument << this->m_frequencyStandby; argument << this->m_digits; argument << this->m_volumeInput; argument << this->m_volumeOutput; argument << this->m_enabled; } /* * From DBus */ template void CModulator::unmarshallFromDbus(const QDBusArgument &argument) { this->CAvionicsBase::unmarshallFromDbus(argument); argument >> this->m_frequencyActive; argument >> this->m_frequencyStandby; argument >> this->m_digits; argument >> this->m_volumeInput; argument >> this->m_volumeOutput; argument >> this->m_enabled; } /* * Value hash */ template uint CModulator::getValueHash() const { QList hashs; hashs << this->m_frequencyActive.getValueHash(); hashs << this->m_frequencyStandby.getValueHash(); hashs << qHash(this->m_digits); return BlackMisc::calculateHash(hashs, "CModulator"); } // see here for the reason of thess forward instantiations // http://www.parashift.com/c++-faq/separate-template-class-defn-from-decl.html template class CModulator; template class CModulator; template class CModulator; } // namespace } // namespace