mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-12 15:25:34 +08:00
Ref T609, renamed to Transmit/Receive for COM sync.
This commit is contained in:
committed by
Mat Sutcliffe
parent
9ba7dfee4d
commit
b60f84244b
@@ -231,7 +231,7 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
|
|
||||||
this->updateIntegratedFlagFromSimulatorContext();
|
this->updateIntegratedFlagFromSimulatorContext();
|
||||||
this->updateActiveCOMUnitLEDs(m_integratedWithSim, com1.isSendEnabled(), com1.isReceiveEnabled(), com2.isSendEnabled(), com2.isReceiveEnabled());
|
this->updateActiveCOMUnitLEDs(m_integratedWithSim, com1.isTransmitEnabled(), com1.isReceiveEnabled(), com2.isTransmitEnabled(), com2.isReceiveEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCockpitComForm::setTransponder(const CTransponder &transponder)
|
void CCockpitComForm::setTransponder(const CTransponder &transponder)
|
||||||
@@ -296,7 +296,7 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCockpitComForm::updateActiveCOMUnitLEDs(bool integratedWithSim, bool com1S, bool com1R, bool com2S, bool com2R)
|
void CCockpitComForm::updateActiveCOMUnitLEDs(bool integratedWithSim, bool com1T, bool com1R, bool com2T, bool com2R)
|
||||||
{
|
{
|
||||||
if (!integratedWithSim)
|
if (!integratedWithSim)
|
||||||
{
|
{
|
||||||
@@ -310,7 +310,7 @@ namespace BlackGui
|
|||||||
ui->led_ComPanelCom1R->setOn(com1R);
|
ui->led_ComPanelCom1R->setOn(com1R);
|
||||||
ui->led_ComPanelCom1S->setOn(com1S);
|
ui->led_ComPanelCom1S->setOn(com1S);
|
||||||
ui->led_ComPanelCom2R->setOn(com2R);
|
ui->led_ComPanelCom2R->setOn(com2R);
|
||||||
ui->led_ComPanelCom2S->setOn(com2S);
|
ui->led_ComPanelCom2T->setOn(com2T);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ namespace BlackGui
|
|||||||
void alignUiElementsHeight();
|
void alignUiElementsHeight();
|
||||||
|
|
||||||
//! Update UI for COM unit
|
//! Update UI for COM unit
|
||||||
void updateActiveCOMUnitLEDs(bool integratedWithSim, bool com1S, bool com1R, bool com2S, bool com2R);
|
void updateActiveCOMUnitLEDs(bool integratedWithSim, bool com1T, bool com1R, bool com2T, bool com2R);
|
||||||
|
|
||||||
//! Update from simulator context
|
//! Update from simulator context
|
||||||
void updateIntegratedFlagFromSimulatorContext();
|
void updateIntegratedFlagFromSimulatorContext();
|
||||||
|
|||||||
@@ -58,33 +58,33 @@ namespace BlackMisc
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class AVIO>
|
template <class AVIO>
|
||||||
int CModulator<AVIO>::getVolumeOutput() const
|
int CModulator<AVIO>::getVolumeReceive() const
|
||||||
{
|
{
|
||||||
return m_volumeOutput;
|
return m_volumeReceive;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class AVIO>
|
template <class AVIO>
|
||||||
int CModulator<AVIO>::getVolumeInput() const
|
int CModulator<AVIO>::getVolumeTransmit() const
|
||||||
{
|
{
|
||||||
return m_volumeInput;
|
return m_volumeTransmit;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class AVIO>
|
template <class AVIO>
|
||||||
void CModulator<AVIO>::setVolumeOutput(int volume)
|
void CModulator<AVIO>::setVolumeReceive(int volume)
|
||||||
{
|
{
|
||||||
m_volumeOutput = volume;
|
m_volumeReceive = volume;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class AVIO>
|
template <class AVIO>
|
||||||
void CModulator<AVIO>::setVolumeInput(int volume)
|
void CModulator<AVIO>::setVolumeTransmit(int volume)
|
||||||
{
|
{
|
||||||
m_volumeInput = volume;
|
m_volumeTransmit = volume;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class AVIO>
|
template <class AVIO>
|
||||||
bool CModulator<AVIO>::isSendEnabled() const
|
bool CModulator<AVIO>::isTransmitEnabled() const
|
||||||
{
|
{
|
||||||
return m_sendEnabled;
|
return m_transmitEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class AVIO>
|
template<class AVIO>
|
||||||
@@ -94,9 +94,9 @@ namespace BlackMisc
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class AVIO>
|
template <class AVIO>
|
||||||
void CModulator<AVIO>::setSendEnabled(bool enable)
|
void CModulator<AVIO>::setTransmitEnabled(bool enable)
|
||||||
{
|
{
|
||||||
m_sendEnabled = enable;
|
m_transmitEnabled = enable;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class AVIO>
|
template<class AVIO>
|
||||||
@@ -120,10 +120,10 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
case IndexActiveFrequency: return this->getFrequencyActive().propertyByIndex(index.copyFrontRemoved());
|
case IndexActiveFrequency: return this->getFrequencyActive().propertyByIndex(index.copyFrontRemoved());
|
||||||
case IndexStandbyFrequency: return this->getFrequencyStandby().propertyByIndex(index.copyFrontRemoved());
|
case IndexStandbyFrequency: return this->getFrequencyStandby().propertyByIndex(index.copyFrontRemoved());
|
||||||
case IndexEnabledSend: return CVariant::from(this->isSendEnabled());
|
case IndexEnabledTransmit: return CVariant::from(this->isTransmitEnabled());
|
||||||
case IndexEnabledReceive: return CVariant::from(this->isReceiveEnabled());
|
case IndexEnabledReceive: return CVariant::from(this->isReceiveEnabled());
|
||||||
case IndexInputVolume: return CVariant::from(this->getVolumeInput());
|
case IndexTransmitVolume: return CVariant::from(this->getVolumeTransmit());
|
||||||
case IndexOutputVolume: return CVariant::from(this->getVolumeOutput());
|
case IndexReceiveVolume: return CVariant::from(this->getVolumeReceive());
|
||||||
default:
|
default:
|
||||||
return CValueObject<CModulator<AVIO>>::propertyByIndex(index);
|
return CValueObject<CModulator<AVIO>>::propertyByIndex(index);
|
||||||
}
|
}
|
||||||
@@ -138,10 +138,10 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
case IndexActiveFrequency: m_frequencyActive.setPropertyByIndex(index.copyFrontRemoved(), variant); break;
|
case IndexActiveFrequency: m_frequencyActive.setPropertyByIndex(index.copyFrontRemoved(), variant); break;
|
||||||
case IndexStandbyFrequency: m_frequencyStandby.setPropertyByIndex(index.copyFrontRemoved(), variant); break;
|
case IndexStandbyFrequency: m_frequencyStandby.setPropertyByIndex(index.copyFrontRemoved(), variant); break;
|
||||||
case IndexEnabledSend: this->setSendEnabled(variant.toBool()); break;
|
case IndexEnabledTransmit: this->setTransmitEnabled(variant.toBool()); break;
|
||||||
case IndexEnabledReceive: this->setReceiveEnabled(variant.toBool()); break;
|
case IndexEnabledReceive: this->setReceiveEnabled(variant.toBool()); break;
|
||||||
case IndexInputVolume: this->setVolumeInput(variant.toInt()); break;
|
case IndexTransmitVolume: this->setVolumeTransmit(variant.toInt()); break;
|
||||||
case IndexOutputVolume: this->setVolumeOutput(variant.toInt()); break;
|
case IndexReceiveVolume: this->setVolumeReceive(variant.toInt()); break;
|
||||||
default:
|
default:
|
||||||
CValueObject<CModulator<AVIO>>::setPropertyByIndex(index, variant);
|
CValueObject<CModulator<AVIO>>::setPropertyByIndex(index, variant);
|
||||||
break;
|
break;
|
||||||
@@ -157,10 +157,10 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
case IndexActiveFrequency: return m_frequencyActive.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.m_frequencyActive);
|
case IndexActiveFrequency: return m_frequencyActive.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.m_frequencyActive);
|
||||||
case IndexStandbyFrequency: return m_frequencyStandby.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.m_frequencyStandby);
|
case IndexStandbyFrequency: return m_frequencyStandby.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.m_frequencyStandby);
|
||||||
case IndexEnabledSend: return Compare::compare(this->isSendEnabled(), compareValue.isSendEnabled());
|
case IndexEnabledTransmit: return Compare::compare(this->isTransmitEnabled(), compareValue.isTransmitEnabled());
|
||||||
case IndexEnabledReceive: return Compare::compare(this->isReceiveEnabled(), compareValue.isReceiveEnabled());
|
case IndexEnabledReceive: return Compare::compare(this->isReceiveEnabled(), compareValue.isReceiveEnabled());
|
||||||
case IndexInputVolume: return Compare::compare(this->getVolumeInput(), compareValue.getVolumeInput());
|
case IndexTransmitVolume: return Compare::compare(this->getVolumeTransmit(), compareValue.getVolumeTransmit());
|
||||||
case IndexOutputVolume: return Compare::compare(this->getVolumeOutput(), compareValue.getVolumeOutput());
|
case IndexReceiveVolume: return Compare::compare(this->getVolumeReceive(), compareValue.getVolumeReceive());
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
Q_ASSERT_X(false, Q_FUNC_INFO, "Compare failed");
|
Q_ASSERT_X(false, Q_FUNC_INFO, "Compare failed");
|
||||||
|
|||||||
@@ -25,11 +25,11 @@ namespace BlackMisc
|
|||||||
//! Column indexes
|
//! Column indexes
|
||||||
enum ColumnIndex
|
enum ColumnIndex
|
||||||
{
|
{
|
||||||
IndexActiveFrequency = BlackMisc::CPropertyIndex::GlobalIndexCModulator,
|
IndexActiveFrequency = CPropertyIndex::GlobalIndexCModulator,
|
||||||
IndexStandbyFrequency,
|
IndexStandbyFrequency,
|
||||||
IndexOutputVolume,
|
IndexReceiveVolume,
|
||||||
IndexInputVolume,
|
IndexTransmitVolume,
|
||||||
IndexEnabledSend,
|
IndexEnabledTransmit,
|
||||||
IndexEnabledReceive
|
IndexEnabledReceive
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -43,28 +43,28 @@ namespace BlackMisc
|
|||||||
BlackMisc::PhysicalQuantities::CFrequency getFrequencyStandby() const;
|
BlackMisc::PhysicalQuantities::CFrequency getFrequencyStandby() const;
|
||||||
|
|
||||||
//! Output volume 0..100
|
//! Output volume 0..100
|
||||||
int getVolumeOutput() const;
|
int getVolumeReceive() const;
|
||||||
|
|
||||||
//! Input volume 0..100
|
//! Input volume 0..100
|
||||||
int getVolumeInput() const;
|
int getVolumeTransmit() const;
|
||||||
|
|
||||||
//! Output volume 0.100
|
//! Output volume 0.100
|
||||||
void setVolumeOutput(int volume);
|
void setVolumeReceive(int volume);
|
||||||
|
|
||||||
//! Input volume 0..100
|
//! Input volume 0..100
|
||||||
void setVolumeInput(int volume);
|
void setVolumeTransmit(int volume);
|
||||||
|
|
||||||
//! Name
|
//! Name
|
||||||
QString getName() const;
|
QString getName() const;
|
||||||
|
|
||||||
//! Enabled?
|
//! Enabled?
|
||||||
bool isSendEnabled() const;
|
bool isTransmitEnabled() const;
|
||||||
|
|
||||||
//! Enabled?
|
//! Enabled?
|
||||||
bool isReceiveEnabled() const;
|
bool isReceiveEnabled() const;
|
||||||
|
|
||||||
//! Enabled?
|
//! Enabled?
|
||||||
void setSendEnabled(bool enable);
|
void setTransmitEnabled(bool enable);
|
||||||
|
|
||||||
//! Enabled?
|
//! Enabled?
|
||||||
void setReceiveEnabled(bool enable);
|
void setReceiveEnabled(bool enable);
|
||||||
@@ -126,12 +126,12 @@ namespace BlackMisc
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_name; //!< name of the unit
|
QString m_name; //!< name of the unit
|
||||||
BlackMisc::PhysicalQuantities::CFrequency m_frequencyActive; //!< active frequency
|
PhysicalQuantities::CFrequency m_frequencyActive; //!< active frequency
|
||||||
BlackMisc::PhysicalQuantities::CFrequency m_frequencyStandby; //!< standby frequency
|
PhysicalQuantities::CFrequency m_frequencyStandby; //!< standby frequency
|
||||||
int m_volumeInput = 0; //!< volume input
|
int m_volumeTransmit = 100; //!< volume transmit/input 0..100
|
||||||
int m_volumeOutput = 0; //!< volume output
|
int m_volumeReceive = 100; //!< volume receive/output 0..100
|
||||||
bool m_sendEnabled = true; //!< is enabled, used e.g. for mute etc.
|
bool m_transmitEnabled = true; //!< is enabled, used e.g. for mute etc.
|
||||||
bool m_receiveEnabled = true; //!< is enabled, used e.g. for mute etc.
|
bool m_receiveEnabled = true; //!< is enabled, used e.g. for mute etc.
|
||||||
|
|
||||||
//! Easy access to derived class (CRTP template parameter)
|
//! Easy access to derived class (CRTP template parameter)
|
||||||
AVIO const *derived() const
|
AVIO const *derived() const
|
||||||
@@ -150,9 +150,9 @@ namespace BlackMisc
|
|||||||
BLACK_METAMEMBER(name),
|
BLACK_METAMEMBER(name),
|
||||||
BLACK_METAMEMBER(frequencyActive),
|
BLACK_METAMEMBER(frequencyActive),
|
||||||
BLACK_METAMEMBER(frequencyStandby),
|
BLACK_METAMEMBER(frequencyStandby),
|
||||||
BLACK_METAMEMBER(volumeInput),
|
BLACK_METAMEMBER(volumeTransmit),
|
||||||
BLACK_METAMEMBER(volumeOutput),
|
BLACK_METAMEMBER(volumeReceive),
|
||||||
BLACK_METAMEMBER(sendEnabled),
|
BLACK_METAMEMBER(transmitEnabled),
|
||||||
BLACK_METAMEMBER(receiveEnabled)
|
BLACK_METAMEMBER(receiveEnabled)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -700,7 +700,7 @@ namespace BlackSimPlugin
|
|||||||
const bool com1Test = dtb(simulatorOwnAircraft.comTest1);
|
const bool com1Test = dtb(simulatorOwnAircraft.comTest1);
|
||||||
const bool com1Transmit = dtb(simulatorOwnAircraft.comTransmit1);
|
const bool com1Transmit = dtb(simulatorOwnAircraft.comTransmit1);
|
||||||
const int com1Status = qRound(simulatorOwnAircraft.comStatus1); // Radio status flag : -1 =Invalid 0 = OK 1 = Does not exist 2 = No electricity 3 = Failed
|
const int com1Status = qRound(simulatorOwnAircraft.comStatus1); // Radio status flag : -1 =Invalid 0 = OK 1 = Does not exist 2 = No electricity 3 = Failed
|
||||||
com1.setSendEnabled(com1Status == 0 && com1Transmit);
|
com1.setTransmitEnabled(com1Status == 0 && com1Transmit);
|
||||||
com1.setReceiveEnabled(com1Status == 0 && (comReceiveAll || com1Transmit));
|
com1.setReceiveEnabled(com1Status == 0 && (comReceiveAll || com1Transmit));
|
||||||
const bool changedCom1 = myAircraft.getCom1System() != com1;
|
const bool changedCom1 = myAircraft.getCom1System() != com1;
|
||||||
m_simCom1 = com1;
|
m_simCom1 = com1;
|
||||||
@@ -711,7 +711,7 @@ namespace BlackSimPlugin
|
|||||||
const bool com2Test = dtb(simulatorOwnAircraft.comTest2);
|
const bool com2Test = dtb(simulatorOwnAircraft.comTest2);
|
||||||
const bool com2Transmit = dtb(simulatorOwnAircraft.comTransmit2);
|
const bool com2Transmit = dtb(simulatorOwnAircraft.comTransmit2);
|
||||||
const int com2Status = qRound(simulatorOwnAircraft.comStatus2); // Radio status flag : -1 =Invalid 0 = OK 1 = Does not exist 2 = No electricity 3 = Failed
|
const int com2Status = qRound(simulatorOwnAircraft.comStatus2); // Radio status flag : -1 =Invalid 0 = OK 1 = Does not exist 2 = No electricity 3 = Failed
|
||||||
com2.setSendEnabled(com2Status == 0 && com2Transmit);
|
com2.setTransmitEnabled(com2Status == 0 && com2Transmit);
|
||||||
com2.setReceiveEnabled(com2Status == 0 && (comReceiveAll || com2Transmit));
|
com2.setReceiveEnabled(com2Status == 0 && (comReceiveAll || com2Transmit));
|
||||||
const bool changedCom2 = myAircraft.getCom2System() != com2;
|
const bool changedCom2 = myAircraft.getCom2System() != com2;
|
||||||
m_simCom2 = com2;
|
m_simCom2 = com2;
|
||||||
|
|||||||
Reference in New Issue
Block a user