public override void Run(UpdateType updateSource) { if ((updateSource & UpdateType.Terminal) != 0) { LOGGER.Clear(); } LOGGER.Debug("src = " + updateSource); // Compute my info bool isNeedUpdate = (updateSource & refreshRate) != 0; if (isNeedUpdate) { UpdateMyInfo(); string tag = updateSource == UpdateType.Terminal ? TAG_ASK_UPDATE_INFO : TAG_ASK_UPDATE_INFO_OPTIONNAL; WriteToChanel(tag, ""); } // Reads all msgs bool isNeedReadMessage = (updateSource & UpdateType.IGC) != 0; if (isNeedReadMessage) { ReadChanelMsgs(); } // Manage antennas if (isNeedUpdate || isNeedReadMessage) { ManageAntennaRange(); SearchForMissing(); } }
public override void Run(UpdateType updateSource) { if ((updateSource & UpdateType.Terminal) != 0) { LOGGER.Clear(); } LOGGER.Debug("updateSource = " + updateSource); bool needSendInfo = false; // Reads all msgs bool isNeedReadMessage = (updateSource & UpdateType.IGC) != 0; if (isNeedReadMessage) { ReadDirectMsgs(); ReadChanelMsgs((msg, tag) => { bool isInfoAsk = tag.Equals(AutoAntennaRelayManager.TAG_ASK_UPDATE_INFO); bool isInfoAskOptionnal = tag.Equals(AutoAntennaRelayManager.TAG_ASK_UPDATE_INFO_OPTIONNAL); if (isInfoAsk || isInfoAskOptionnal) { bool isInfoChanged = UpdateMyInfo(); needSendInfo |= isInfoAsk || (isInfoAskOptionnal && isInfoChanged); } }); } if (needSendInfo) { SendMyInfo(); } }