mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
CTransponder::setModeAsString
This commit is contained in:
@@ -84,6 +84,53 @@ namespace BlackMisc
|
||||
return m;
|
||||
}
|
||||
|
||||
/*
|
||||
* Mode as readable string
|
||||
*/
|
||||
void CTransponder::setModeAsString(const QString &m)
|
||||
{
|
||||
if (m == "Ident")
|
||||
{
|
||||
this->setTransponderMode(StateIdent);
|
||||
}
|
||||
else if (m == "Standby")
|
||||
{
|
||||
this->setTransponderMode(StateStandby);
|
||||
}
|
||||
else if (m == "Mode C")
|
||||
{
|
||||
this->setTransponderMode(ModeC);
|
||||
}
|
||||
else if (m == "Mode S")
|
||||
{
|
||||
this->setTransponderMode(ModeS);
|
||||
}
|
||||
else if (m == "Mil.Mode 1")
|
||||
{
|
||||
this->setTransponderMode(ModeMil1);
|
||||
}
|
||||
else if (m == "Mil.Mode 2")
|
||||
{
|
||||
this->setTransponderMode(ModeMil2);
|
||||
}
|
||||
else if (m == "Mil.Mode 3")
|
||||
{
|
||||
this->setTransponderMode(ModeMil3);
|
||||
}
|
||||
else if (m == "Mil.Mode 4")
|
||||
{
|
||||
this->setTransponderMode(ModeMil4);
|
||||
}
|
||||
else if (m == "Mil.Mode 5")
|
||||
{
|
||||
this->setTransponderMode(ModeMil5);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw std::range_error("Illegal Transponder Mode");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Formatted transponder code
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user