コード例 #1
0
ファイル: Cmd.cpp プロジェクト: linuxdeepin/deepin-boot-maker
Result SynExec(const QString &exec, const QString &param, const QString &execPipeIn)
{
    Result ret = runApp(exec, param, execPipeIn);
    qDebug() << "call:" << exec + " " + param << "with:" << execPipeIn ;
    qDebug() << "resut:" << ret.isSuccess() << ret.errmsg();
    return ret;
}
コード例 #2
0
ファイル: Cmd.cpp プロジェクト: linuxdeepin/deepin-boot-maker
Result SynExec(const QString &exec, const QStringList &args)
{
    Result ret = runApp(exec, args);
    qDebug() << "call:" << exec << args ;
    qDebug() << "resut:" << ret.isSuccess() << ret.errmsg();
    return ret;
}
コード例 #3
0
ファイル: mainwindow.cpp プロジェクト: egaburov/likwid-fe
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow),
    plotArea(new Ui::PlotArea)
{
    ui->setupUi(this);
    this->setWindowTitle("likwid-fe");
    connect(ui->selectAppButton, SIGNAL(clicked()), this, SLOT(selectApp()));
    connect(ui->runAppButton, SIGNAL(clicked()), this, SLOT(runApp()));

    /* create render area */
}
コード例 #4
0
void QX::launch_clicked()
{
    int sel = GetClickedId();
    if (sel<0) return;

    DesktopEntry entry = scanner->entries[sel];
    QString appname = entry.file;

    ProfileManager *mngr = new ProfileManager();
    AppProfile prof = mngr->GetAppProfile(appname);
    delete mngr;

#ifdef QTOPIA
    if (prof.antiDim)
    {
        powerConstraint = QtopiaApplication::Disable;
    }
    else if (prof.antiSuspend)
    {
        powerConstraint = QtopiaApplication::DisableSuspend;
    }

    if (prof.gps)
        gpsPower("1");
#endif

    if (prof.init != "")
        system(prof.init.toUtf8().data());

    //if (prof.qvga) { }

    QString cmd = entry.exec;

    if ((prof.wm) || (prof.kbd))
    {
        QString script = "/tmp/.QX_app_launcher.sh";
        QFile f(script);
        if (f.open(QIODevice::WriteOnly))
        {
            f.write("matchbox-window-manager &\n");
            f.write("sleep 5\n");
            if (prof.kbd)
                f.write("matchbox-keyboard &\n");
            f.write(entry.exec.toUtf8());
            f.close();
        }
        cmd = "sh " + script;
    }

    QString applabel = "<b>"+entry.name+"</b><br/>"+entry.exec;
    runApp(cmd, applabel, prof.rotate);
}
コード例 #5
0
ファイル: main.cpp プロジェクト: MatzJB/pipeline
int main(int argc, char *argv[])
{
  // initialize GLUT, set window size and display mode, create the main window
  glutInit( &argc, argv );
  glutSetOption( GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_CONTINUE_EXECUTION );

  options::options_description od("Usage: GLUTMinimal");
  od.add_options()
    ( "filename", options::value<std::string>()->default_value("cubes"), "file to load" )
    ( "effectlibrary", options::value<std::string>(), "effectlibrary to load for replacements" )
    ( "replace", options::value< std::vector<std::string> >()->composing()->multitoken(), "file to load" )
    ( "stereo", "enable stereo" )
//always on     ( "continuous", "enable continuous rendering" )
    ( "headlight", "add a headlight to the camera" )
    ( "statistics", "show statistics of scene" )
    ( "combineVertexAttributes", "combine all vertexattribute into a single buffer" )
    ( "frames", options::value<int>()->default_value(-1), "benchmark a specific number of frames. The exit code returns the frames per second." )
    ( "duration", options::value<double>()->default_value(0.0), "benchmark for a specific duration. The exit code returns the frames per second." )
    ( "renderengine", options::value<std::string>()->default_value("Bindless"), "choose a renderengine from this list: VBO|VAB|VBOVAO|Bindless|BindlessVAO|DisplayList" )
    ( "shadermanager", options::value<std::string>()->default_value("rixfx:shaderbufferload"), "rixfx:uniform|rixfx:ubo140|rixfx:ssbo140|rixfx:shaderbufferload" )
    ( "cullingengine", options::value<std::string>()->default_value("cpu"), "auto|cpu|cuda|gl_compute")
    ( "culling", options::value<bool>()->default_value(true), "enable/disable culling")
    ( "autoclipplanes", options::value<bool>()->default_value(true), "enable/disable autoclipplane")
    ( "help", "show help")
    ;

#if 0
  // not yet implemented
  std::cout << "During execution hit 's' for screenshot and 'x' to toggle stereo" << std::endl;
  std::cout << "Stereo screenshots will be saved as side/side png with filename 'stereo.pns'." << std::endl;
  std::cout << "They can be viewed with the 3D Vision Photo Viewer." << std::endl;
#endif

  int result = -1;
  try
  {
    options::variables_map opts;
    options::store( options::parse_command_line( argc, argv, od ), opts );

    if ( dp::util::fileExists( "GLUTMinimal.cfg" ) )
    {
      options::store( options::parse_config_file<char>( "GLUTMinimal.cfg", od), opts);
    }

    options::notify( opts );

    if ( !opts["help"].empty() )
    {
      std::cout << od << std::endl;
    }

    result = runApp( opts );
  }
  catch ( options::unknown_option e )
  {
    std::cerr << "Unknown option: " << e.get_option_name() << ". ";
    std::cout << od << std::endl;
    std::cerr << "Press enter to continue." << std::endl;
    std::string line;
    getline( std::cin, line );
  }
  return result;
}
コード例 #6
0
ファイル: main.cpp プロジェクト: AlexBeach/CGG
//------------------------------------------------------------------------------------------------------------------------------------
/// main  \o/
//------------------------------------------------------------------------------------------------------------------------------------
int main()
{
	// just run the app.... 
	return runApp();
}
コード例 #7
0
ファイル: main.cpp プロジェクト: raedwulf/pipeline
int main(int argc, char *argv[])
{
#if defined(DP_OS_WINDOWS)
  SetProcessAffinityMask( GetCurrentProcess(), 1 << 4 );
#endif

  // initialize GLUT, set window size and display mode, create the main window
  glutInit( &argc, argv );
  glutSetOption( GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_CONTINUE_EXECUTION );
  
  options::options_description od("Usage: TerrainRendering");
  od.add_options()
    ( "heightmap", options::value<std::string>(), "height map to use" )
    ( "texturemap", options::value<std::string>(), "texture map to use" )
    ( "resolution", options::value<std::vector<float> >()->multitoken(), "resolution of the height map (--resolution x y height)" )
    ( "offset", options::value<std::vector<float> >()->multitoken(), "offset of the height map in the world space (--offset x y z)" )
    ( "stereo", "enable stereo" )
    ( "continuous", "enable continuous rendering" )
    ( "headlight", "add a headlight to the camera" )
    ( "frames", options::value<int>()->default_value(-1), "benchmark a specific number of frames. The exit code returns the frames per second." )
    ( "duration", options::value<double>()->default_value(0.0), "benchmark for a specific duration. The exit code returns the frames per second." )
    ( "renderengine", options::value<std::string>()->default_value("Bindless"), "choose a renderengine from this list: VBO|VAB|VBOVAO|Bindless|BindlessVAO|DisplayList" )
    ( "shadermanager", options::value<std::string>()->default_value("rixfx:shaderbufferload"), "rixfx:uniform|rixfx:ubo140|rixfx:ssbo140|rixfx:shaderbufferload" )
    ( "autoclipplanes", options::value<bool>()->default_value(true), "enable/disable autoclipplane")
    ( "help", "show help")
    ;

#if 0
  // not yet implemented
  std::cout << "During execution hit 's' for screenshot and 'x' to toggle stereo" << std::endl;
  std::cout << "Stereo screenshots will be saved as side/side png with filename 'stereo.pns'." << std::endl;
  std::cout << "They can be viewed with the 3D Vision Photo Viewer." << std::endl;
#endif

  int result = -1;
  try
  {
    options::variables_map opts;
    options::store( options::parse_command_line( argc, argv, od ), opts );

    if ( dp::util::fileExists( "TerrainRendering.cfg" ) )
    {
      options::store( options::parse_config_file<char>( "TerrainRendering.cfg", od), opts);
    }

    options::notify( opts );

    if ( !opts["help"].empty() )
    {
      std::cout << od << std::endl;
    }

    result = runApp( opts );
  }
  catch ( options::unknown_option e )
  {
    std::cerr << "Unknown option: " << e.get_option_name() << ". ";
    std::cout << od << std::endl;
    std::cerr << "Press enter to continue." << std::endl;
    std::string line;
    getline( std::cin, line );
  }

  return result;
}
コード例 #8
0
void CFileBrowser::on_runButton_clicked(){ runApp(); }
コード例 #9
0
void QX::okClicked()
{
    //if (screen == QX::ScreenMain)
    runApp(lineEdit->text(), lineEdit->text(), false);
}
コード例 #10
0
ファイル: main.cpp プロジェクト: raedwulf/pipeline
int main(int argc, char *argv[])
{
  options::options_description od("Usage: QtMinimal");

  od.add_options()
    ( "autoclipplanes", options::value<bool>()->default_value(true), "enable/disable autoclipplane")
    ( "combineVertexAttributes", "combine all vertexattribute into a single buffer" )
    ( "continuous", "enable continuous rendering" )
    ( "culling", options::value<bool>()->default_value(true), "enable/disable culling")
    ( "cullingengine", options::value<std::string>()->default_value("auto"), "auto|cpu|cuda|gl_compute")
    ( "depthPass", options::value<bool>()->default_value(false), "enable depth pass rendering" )
    ( "duration", options::value<double>()->default_value(0.0), "benchmark for a specific duration. The exit code returns the frames per second." )
    ( "effectlibrary", options::value<std::string>(), "effectlibrary to load for replacements" )
    ( "environment", options::value<std::string>(), "environment texture" )
    ( "filename", options::value<std::string>()->default_value("cubes"), "file to load" )
    ( "frames", options::value<unsigned int>()->default_value(~0), "benchmark a specific number of frames. The exit code returns the frames per second." )
    ( "fullscreen", "start in full screen mode" )
    ( "generateTangentSpace", "generate tangents and binormals" )
    ( "generateTexCoords", options::value<std::string>(), "choose texture coordinate from this list: cylindrical|planar|spherical" )
    ( "gridClone", options::value<bool>()->default_value(true), "enable/disable cloning of the node to grid" )
    ( "gridSize", options::value< std::vector<unsigned int> >()->composing()->multitoken(), "three-dimensional replication of the scene: x y z" )
    ( "gridSpacing", options::value< std::vector<float> >()->composing()->multitoken(), "three-dimensional spacing of the scene: x y z" )
    ( "headlight", "add a headlight to the camera" )
    ( "help", "show help")
    ( "maximized", "show window maximized" )
    ( "multiSample", options::value<unsigned int>()->default_value(0), "AntiAliasing with that number of color/z/stencil samples" )
    ( "multiSampleCoverage", options::value<unsigned int>()->default_value(0), "AntiAliasing with that number of coverage samples" )
    ( "optionsFile", options::value<std::string>(), "file to load (additional) options from" )
    ( "orbit", options::value<float>(), "orbit around the scene by that many degrees per frame" )
    ( "renderengine", options::value<std::string>()->default_value("Bindless"), "choose a renderengine from this list: VBO|VAB|BVAB|VBOVAO|Bindless|BindlessVAO" )
    ( "replace", options::value< std::vector<std::string> >()->composing()->multitoken(), "file to load" )
    ( "replaceAll", options::value<std::string>(), "EffectData to replace all EffectData in the scene" )
    ( "shadermanager", options::value<std::string>()->default_value("rixfx:shaderbufferload"), "rixfx:uniform|rixfx:ubo140|rixfx:ssbo140|rixfx:shaderbufferload" )
    ( "statistics", "show statistics of scene" )
    ( "stereo", "enable stereo" )
    ( "transparency", options::value<std::string>()->default_value("OITClosestList"), "choose transparency mode from list: none|OITAll|OITClosestArray|OITClosestList|SB" )
    ( "windowSize", options::value< std::vector<unsigned int> >()->composing()->multitoken(), "Window size: x y" )
    ( "zoom", options::value<float>(), "zoom in with values less than one, zoom out with values greater one" )
    ;

  int result = -1;
  try
  {
    options::variables_map opts;
    options::store( options::parse_command_line( argc, argv, od ), opts );

    if ( !opts["optionsFile"].empty() )
    {
      std::string optionsFile = opts["optionsFile"].as<std::string>();
      if ( dp::util::fileExists( optionsFile ) )
      {
         // Load the file and tokenize it
        std::ifstream ifs( optionsFile.c_str() );
        if ( ifs )
        {
          // Read the whole file into a string
          std::stringstream ss;
          ss << ifs.rdbuf();

          // Split the file content
          boost::char_separator<char> sep( " \n\r" );
          std::string ResponsefileContents( ss.str() );
          boost::tokenizer<boost::char_separator<char>> tok( ResponsefileContents, sep );
          std::vector<std::string> args;
          copy( tok.begin(), tok.end(), back_inserter( args ) );

          // Parse the file and store the options
          options::store( options::command_line_parser( args ).options( od ).run(), opts );
        }
        else
        {
          std::cout << "Could not open options file <" << optionsFile << ">!" << std::endl;
          return 1;
        }
      }
      else
      {
        std::cout << "Could not find options file <" << optionsFile << ">!" << std::endl;
      }
    }

    options::notify( opts );

    if ( !opts["help"].empty() )
    {
      std::cout << od << std::endl;
    }

    result = runApp( argc, argv, opts );
  }
  catch ( options::unknown_option e )
  {
    std::cerr << "Unknown option: " << e.get_option_name() << ". ";
    std::cout << od << std::endl;
    std::cerr << "Press enter to continue." << std::endl;
    std::string line;
    getline( std::cin, line );
  }

  return result;
}
コード例 #11
0
ファイル: main.cpp プロジェクト: 4leavedclover/userland
int main(int argc, char **argv)
{
   // Parse command line options/arguments.
   VIDTEX_PARAMS_T params = {0};
   int rc;
   int status = 0;

   opterr = 0;

   while ((rc = getopt(argc, argv, "d:iuvy")) != -1)
   {
      switch (rc)
      {
      case 'd':
         params.duration_ms = atoi(optarg);
         break;

      case 'i':
         params.opts |= VIDTEX_OPT_IMG_PER_FRAME;
         break;

      case 'y':
         params.opts |= VIDTEX_OPT_Y_TEXTURE;
         break;

      case 'u':
         params.opts |= VIDTEX_OPT_U_TEXTURE;
         break;

      case 'v':
         params.opts |= VIDTEX_OPT_V_TEXTURE;
         break;

      default:
         usage(argv[0]);
         return 2;
      }
   }

   if (optind < argc - 1)
   {
      usage(argv[0]);
      return 2;
   }

   if (optind < argc)
   {
      strncpy(params.uri, argv[optind], sizeof(params.uri) - 1);
      params.uri[sizeof(params.uri) - 1] = '\0';
   }

   // Init vcos logging.
   vcos_log_set_level(VCOS_LOG_CATEGORY, VCOS_LOG_INFO);
   vcos_log_register("vidtex", VCOS_LOG_CATEGORY);

   // Run video-on-texture application in a separate thread.
#ifdef __ANDROID__
   status = Launcher::runApp("vidtex", launch_vidtex, &params, sizeof(params));
#else
   status = runApp("vidtex", launch_vidtex, &params, sizeof(params));
#endif
   return (status == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}
コード例 #12
0
ファイル: qkuiapplication.cpp プロジェクト: koloboid/qk-cpp
int QkUiApplication::exec()
{
    QTimer::singleShot(0, this, SLOT(runApp()));
    return QApplication::exec();
}