コード例 #1
0
DialogTrailingDots::DialogTrailingDots(ATCSettings *settings, QWidget *parent) :
    ATCDialog(parent, "Trailing Dots", 230, 100),
    uiInner(new Ui::DialogTrailingDots),
    settings(settings)
{
    uiInner->setupUi(this);
    windowSetup();

    uiInner->spinBoxCount->setValue(settings->TRAILING_COUNT);
}
コード例 #2
0
DialogActiveRunways::DialogActiveRunways(ATCAirspace *airspace, ATCActiveRunways *activeRunways, QWidget *parent) :
    ATCDialog(parent, "Active Runways", 600, 650),
    airspace(airspace),
    activeRunways(activeRunways),
    uiInner(new Ui::DialogActiveRunways)
{
    uiInner->setupUi(this);
    windowSetup();

    dialogSetup();
    fillModel();
}
コード例 #3
0
ファイル: dialogleaders.cpp プロジェクト: ignmiz/ATC_Console
DialogLeaders::DialogLeaders(ATCSettings *settings, QWidget *parent) :
    ATCDialog(parent, "Leader Lines", 230, 100),
    uiInner(new Ui::DialogLeaders),
    settings(settings)
{
    uiInner->setupUi(this);
    windowSetup();

    uiInner->spinBoxLength->setValue(settings->TAG_LEADER_LENGTH);

    if(settings->TAG_LEADER_UNIT == ATC::LeaderNM)
    {
        setActiveNM();
    }
    else
    {
        setActiveMIN();
    }
}
コード例 #4
0
ファイル: main.cpp プロジェクト: btheobald/compa2
int main(void) {
  // Setup window and give pointer
  GLFWwindow* window = windowSetup();

  // Create objects
  render renderMain;
  shared sharedMain;

  // Create access pointers
  render* renderAP = &renderMain;
  shared* sharedAP = &sharedMain;

  setupDefaultScenario(renderAP, sharedAP);

  setupGUI(window, renderAP);

  // Create simulation thread
  std::thread simThread(startup, sharedAP);

  // Main Runtime Loop
  while(!glfwWindowShouldClose(window)) {
    // Clear screen before drawing
    glClear(GL_COLOR_BUFFER_BIT);

    sharedAP->updateControl(renderAP->getControl());

    if(renderAP->getPaused()) {
      updateBody(renderAP); // Update body storage from interface
      // Send update to shared
      sharedAP->updateBodies(renderAP->getBodies());
    } else {
      updateUI(renderAP); // Update interface from body store
      // Get update from shared
      renderAP->updateBodies(sharedAP->getBodies());
    }

    // Wake sim thread
    sharedAP->simWait.notify_all();

    // Render scene
    renderAP->drawScene();

    // Apply camera transform and scale
    applyCamera();

    // Draw GUI
    TwDraw();

    // Display is double buffered to prevent screen tearing
    // Swap display buffers
    glfwSwapBuffers(window);
    // Poll and process events
    glfwPollEvents();
  }

  // Unpause and Exit, direct to shared
  sharedAP->setPaused(0);
  sharedAP->setExit(1);

  // Repeat sim wait notify until exit is acknowleged, directly check shared
  while(sharedAP->getExit()) {
    sharedAP->simWait.notify_all();
  }

  // Program exit
  simThread.join();

  // Terminate Libraries
  glfwDestroyWindow(window);
  glfwTerminate();

  #ifdef EXITNOTE
    std::cerr << "Main Exit" << std::endl;
  #endif

  return 0;
}