Esempio n. 1
0
void WaveformPrefs::OnScale(wxCommandEvent &e)
{
   EnableDisableRange();

   // do the common part
   OnControl(e);
}
Esempio n. 2
0
void TControl::timerEvent(QTimerEvent *) {
    if (LastSendControl.elapsed() < 1000) {
        return;
    }
    Space::TControl control;
    emit OnControl(control);
    LastSendControl.restart();
}
Esempio n. 3
0
void TControl::timerEvent(QTimerEvent *) {
    if (LastSendControl.elapsed() < 300) {
        return;
    }
    Space::TControl control;
    control.set_planetfrom(-1);
    control.set_planetto(-1);
    control.set_playername(World->PlayerName.toStdString());
    control.set_energypercent(0);
    emit OnControl(control);
    LastSendControl.restart();
}
Esempio n. 4
0
void SpectrumPrefs::OnWindowSize(wxCommandEvent &evt)
{
   // Restrict choice of zero padding, so that product of window
   // size and padding may not exceed the largest window size.
   wxChoice *const pWindowSizeControl =
      static_cast<wxChoice*>(wxWindow::FindWindowById(ID_WINDOW_SIZE, this));
   int windowSize = 1 <<
      (pWindowSizeControl->GetSelection() + SpectrogramSettings::LogMinWindowSize);
   PopulatePaddingChoices(windowSize);

   // Do the common part
   OnControl(evt);
}
Esempio n. 5
0
void TControl::SpawnShips() {
    if (!World->Power) {
        return;
    }

    if (!World->SelectedTarget.is_initialized()) {
        return;
    }
    if (World->SelectedPlanets.empty()) {
        return;
    }

    Space::TControl control;
    Space::TAttackCommand& attack = *control.mutable_attackcommand();
    for (auto& planet: World->SelectedPlanets) {
        attack.add_planetfrom(planet);
    }
    attack.set_planetto(*World->SelectedTarget);
    attack.set_energypercent(World->Power);
    emit OnControl(control);
    LastSendControl.restart();
}
Esempio n. 6
0
void SpectrumPrefs::OnAlgorithm(wxCommandEvent &evt)
{
   EnableDisableSTFTOnlyControls();
   OnControl(evt);
}