void Datalink::copyData(const Datalink& org, const bool cc) { BaseClass::copyData(org); if (cc) initData(); noRadioMaxRange = org.noRadioMaxRange; radioId = org.radioId; useRadioIdFlg = org.useRadioIdFlg; sendLocal = org.sendLocal; queueForNetwork = org.queueForNetwork; { const Basic::String* p = 0; if (org.radioName != 0) { p = org.radioName->clone(); } setRadioName( p ); setRadio(0); } { const Basic::String* p = 0; if (org.tmName != 0) { p = org.tmName->clone(); } setTrackManagerName( p ); setTrackManager(0); } }
void MainWindow::on_buttonLogo_clicked() { current += 1; current %= 2; setRadio(current); }
//------------------------------------------------------------------------------ // shutdownNotification() -- We're shutting down //------------------------------------------------------------------------------ bool Datalink::shutdownNotification() { clearQueues(); setRadio(0); setTrackManager(0); setTrackManagerName(0); return BaseClass::shutdownNotification(); }
void Datalink::deleteData() { if (inQueue != 0 && outQueue != 0) { clearQueues(); delete inQueue; delete outQueue; inQueue = 0; outQueue = 0; } setRadio(0); setRadioName(0); setTrackManager(0); }
//------------------------------------------------------------------------------ // reset() -- Reset parameters //------------------------------------------------------------------------------ void Datalink::reset() { clearQueues(); // --- // Do we need to find the track manager? // --- if (getTrackManager() == 0 && getTrackManagerName() != 0) { // We have a name of the track manager, but not the track manager itself const char* name = *getTrackManagerName(); // Get the named track manager from the onboard computer Player* ownship = dynamic_cast<Player*>( findContainerByType(typeid(Player)) ); if (ownship != 0) { OnboardComputer* obc = ownship->getOnboardComputer(); if (obc != 0) { setTrackManager(obc->getTrackManagerByName(name)); } } if (getTrackManager() == 0) { // The assigned track manager was not found! //if (isMessageEnabled(MSG_ERROR)) { //std::cerr << "Datalink ERROR -- track manager, " << name << ", was not found!" << std::endl; //} } } // --- // Do we need to find the comm radio? // --- if (getRadio() == 0 && getRadioName() != 0) { // We have a name of the radio, but not the radio itself const char* name = *getRadioName(); // Get the named radio from the component list of radios Player* ownship = dynamic_cast<Player*>( findContainerByType(typeid(Player)) ); if (ownship != 0) { CommRadio* cr = dynamic_cast<CommRadio*>(ownship->getRadioByName(name)); setRadio(cr); } CommRadio* rad = getRadio(); if (rad == 0) { // The assigned radio was not found! if (isMessageEnabled(MSG_ERROR)) { std::cerr << "Datalink ERROR -- radio, " << name << ", was not found!" << std::endl; } } else { rad->setDatalink(this); rad->setReceiverEnabledFlag(true); rad->setTransmitterEnableFlag(true); } } BaseClass::reset(); }
void Datalink::deleteData() { if (inQueue != nullptr && outQueue != nullptr) { clearQueues(); delete inQueue; delete outQueue; inQueue = nullptr; outQueue = nullptr; } setRadio(nullptr); setRadioName(nullptr); setTrackManager(nullptr); setTrackManagerName(nullptr); }
void ShadowCover::step(float dt) { for (int i = 0; i < DDConfig::BATTLE_NUM; i++) { for (int j = 0; j < DDConfig::BATTLE_NUM; j++) { float dir = _cubeAniDir[i*DDConfig::BATTLE_NUM+j]; if (dir == 0.f) continue; AgentPos pos = {j-DDConfig::BATTLE_NUM/2, i-DDConfig::BATTLE_NUM/2}; float oldRadio = getRadio(pos); if (dir < 0 && oldRadio > 0.f){ float newRadio = std::max(0.f, oldRadio - ANI_STEP_PER_SEC*dt); if (newRadio == 0.f) { _cubeAniDir[i*DDConfig::BATTLE_NUM+j] = 0; } setRadio(pos, newRadio); } else if (dir >0 && oldRadio < 1.f) { float newRadio = std::min(1.f, oldRadio + ANI_STEP_PER_SEC*dt); if (newRadio == 1.f) { _cubeAniDir[i*DDConfig::BATTLE_NUM+j] = 0; } setRadio(pos, newRadio); } } } }
void MainWindow::loadSettings(){ isMouseDown = false; iXdeffarace = -1; iYdeffarance = -1; playing = false; playUrls[0] = "http://80.86.106.35:8032/"; //onefm playUrls[1] = "http://93.113.171.27:80/"; //onefm underground siteUrls[0] = "http://www.onefm.ro/"; siteUrls[1] = "http://www.oneundergroundradio.com/"; settings = new QSettings("OneFM", "OneFM"); systemTitle = settings->value("systemTitle", true).toBool(); ui->checkBoxTitleBar->setChecked(systemTitle); if(!systemTitle){ this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowMinimizeButtonHint); ui->topLogoTip->setVisible(true); ui->changeRadioTip->setVisible(true); }else{ this->setWindowFlags(Qt::Window | Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint ); ui->buttonMinimize->setVisible(false); ui->buttonClose->setVisible(false); } volume = settings->value("volume", 50).toInt(); current = settings->value("current", 0).toInt(); setRadio(current); ui->sliderVolume->setValue(volume); ui->buttonTopLogo->installEventFilter(this); ui->buttonLogo->installEventFilter(this); ui->topLogoTip->setVisible(false); ui->changeRadioTip->setVisible(false); }
void ShadowCover::cover(const AgentPos& pos) { setRadio(pos, 1); }
void ShadowCover::reveal(const AgentPos& pos) { setRadio(pos, 0); }
void CCommand::Initialize() { // Set Baud rate setRadio(0); setSquelch(255); setSoundVolume(0); setRadio(1); setSoundVolume(0); setSquelch(255); /* dbgWin->slotSendSerial("G2?"); dbgWin->slotSendSerial("G4?"); dbgWin->slotSendSerial("GE?"); dbgWin->slotSendSerial("GD?"); dbgWin->slotSendSerial("GA0?"); dbgWin->slotSendSerial("GA1?"); dbgWin->slotSendSerial("GA2?"); dbgWin->slotSendSerial("GF?"); */ sleep(1); setUpdateMode(CCommand::eUpdOn); /* NOT NEEDED */ //dbgWin->slotSendSerial("J730000"); setRadio(0); // Noise blanker is off setNoiseBlanker(false); setRadio(1); setNoiseBlanker(false); // Init radio 0 Frequency; setRadio(0); setModulation(CCommand::eWFM); setFilter(CCommand::e230k); setFrequency(106500000); setSquelch(0); setVoiceControl(CCommand::eVSCOff); setIFShift(128); // Init radio 1 Frequency setRadio(1); setModulation(CCommand::eFM); setFilter(CCommand::e15k); setFrequency(145425000); setSquelch(0); setSoundVolume(0); setVoiceControl(CCommand::eVSCOff); setIFShift(128); /* NOT NEEDED */ /* Unknown dbgWin->slotSendSerial("J4200"); dbgWin->slotSendSerial("J4700"); dbgWin->slotSendSerial("J6700"); dbgWin->slotSendSerial("JC400"); dbgWin->slotSendSerial("J7100"); dbgWin->slotSendSerial("J720000"); dbgWin->slotSendSerial("JC000"); */ // Mute radio before restoring values setRadio(0); setSoundMute(true); setSoundVolume(0); /* Unknown dbgWin->slotSendSerial("J8001"); dbgWin->slotSendSerial("J8100"); dbgWin->slotSendSerial("J8200"); dbgWin->slotSendSerial("J8300"); dbgWin->slotSendSerial("JC500"); */ setRadio(0); setSquelch(255); setVoiceControl(CCommand::eVSCOff); setRadio(1); setSquelch(255); setVoiceControl(CCommand::eVSCOff); setRadio(0); setSoundVolume(0); setRadio(1); setSoundVolume(0); setSquelch(255); setRadioMode(CCommand::eBoth); //dbgWin->slotSendSerial("JB000"); setRadio(1); setSquelch(255); setVoiceControl(CCommand::eVSCOff); setRadio(0); setSquelch(1); setVoiceControl(CCommand::eVSCOff); setRadio(1); setVoiceControl(CCommand::eVSCOff); setSquelch(1); setRadio(0); setSoundVolume(60); setSoundMute(false); }