void LLPanelGroupTab::handleClickHelp() { // Display the help text. std::string help_text( getHelpText() ); if ( !help_text.empty() ) { LLSD args; args["MESSAGE"] = help_text; LLFloater* parent_floater = gFloaterView->getParentFloater(this); parent_floater->addContextualNotification("GenericAlert",args); } }
//------------------------------------------------------------------------------ // //------------------------------------------------------------------------------ void MyWindow::display() { WindowInertiaCamera::display(); if(!s_pCurRenderer->valid()) { glClearColor(0.5,0.0,0.0,0.0); glClear(GL_COLOR_BUFFER_BIT); swapBuffers(); return; } float dt = (float)m_realtime.getTiming(); // // render the scene // std::string stats; static std::string hudStats = "..."; { nv_helpers::Profiler::FrameHelper helper(g_profiler,sysGetTime(), 2.0, stats); PROFILE_SECTION("display"); s_pCurRenderer->display(m_camera, m_projection); // // additional HUD stuff // WindowInertiaCamera::beginDisplayHUD(); s_helpText -= dt; m_oglTextBig.drawString(5, 5, "('h' for help)", 1, vec4f(0.8,0.8,1.0,0.5f).vec_array); float h = 30; if(s_bStats) h += m_oglTextBig.drawString(5, m_winSz[1]-h, hudStats.c_str(), 0, vec4f(0.8,0.8,1.0,0.5).vec_array); if(s_helpText > 0) { // camera help const char *txt = getHelpText(); h += m_oglTextBig.drawString(5, m_winSz[1]-h, txt, 0, vec4f(0.8,0.8,1.0,s_helpText/HELPDURATION).vec_array); h += m_oglTextBig.drawString(5, m_winSz[1]-h, s_sampleHelp, 0, vec4f(0.8,0.8,1.0,s_helpText/HELPDURATION).vec_array); } WindowInertiaCamera::endDisplayHUD(); { //PROFILE_SECTION("SwapBuffers"); swapBuffers(); } } //PROFILE_SECTION("display"); // // Stats // if (s_bStats && (!stats.empty())) { hudStats = stats; // make a copy for the hud display } }
void LLPanelGroupTab::handleClickHelp() { // Display the help text. std::string help_text( getHelpText() ); if ( !help_text.empty() ) { LLSD args; args["MESSAGE"] = help_text; LLFloater* parent_floater = gFloaterView->getParentFloater(this); LLNotification::Params params(parent_floater->contextualNotification("GenericAlert")); params.substitutions(args); LLNotifications::instance().add(params); } }
void LLPanelGroupTab::handleClickHelp() { // Display the help text. std::string help_text( getHelpText() ); if ( !help_text.empty() ) { LLStringUtil::format_map_t args; args["[MESSAGE]"] = help_text; LLAlertDialog* dialogp = gViewerWindow->alertXml("GenericAlert", args); if (dialogp) { LLFloater* root_floater = gFloaterView->getParentFloater(this);; if (root_floater) { root_floater->addDependentFloater(dialogp); } } } }
void printUsage() { Serial.println(getHelpText()); Serial.println("Usage: dbg thgspk wr"); }
void printUsage() { Serial.println(getHelpText()); Serial.println("Usage: dbg thgspk key <APIKey>"); }
void printUsage() { Serial.println(getHelpText()); Serial.println("Usage: dbg thgspk chid <channelId>"); }
void printUsage() { Serial.println(getHelpText()); Serial.println("Usage: dbg thgspk set <value> [field]"); Serial.println(" field: 1..8, default: 1"); }
void printUsage() { Serial.println(getHelpText()); Serial.println("Usage: dbg wifi con <SSID> <passwd>"); }
void printUsage() { Serial.println(getHelpText()); Serial.println("Usage: dbg wifi dis"); }
int main(int argc, char *argv[]) { QApplication::setGraphicsSystem("raster"); QApplication a(argc, argv); QStringList arguments = a.arguments(); QString used_arguments = ""; /* ARGUMENTS */ if(arguments.contains(ARG_HELP)) { QMessageBox::information(0,"Help",getHelpText()); used_arguments += ARG_HELP; return 0; } /*initialize InitMode depending on the argument QML_UI is default */ CoreEngine::InitMode mode = CoreEngine::QML_UI; QString conf_path = ""; if(arguments.contains(ARG_WEB_UI)) { used_arguments += ARG_WEB_UI; mode = CoreEngine::WEB_UI; /*search for specific config path*/ for (int i = 0; i < arguments.size(); i++) { if(arguments.at(i).contains(ARG_WEB_CONFIG)) { used_arguments += arguments.at(i); conf_path = arguments.at(i); conf_path = conf_path.remove(ARG_WEB_CONFIG); } } } else if(arguments.contains(ARG_QML_UI)) { used_arguments += ARG_QML_UI; mode = CoreEngine::QML_UI; } /*init LogHandler state*/ Base::Log_state log_state = Base::LS_Active; if(arguments.contains(ARG_LOG_STATE_ACTIVE)) { used_arguments += ARG_LOG_STATE_ACTIVE; log_state = Base::LS_Active; } else if(arguments.contains(ARG_LOG_STATE_RESTRICTED)) { used_arguments += ARG_LOG_STATE_RESTRICTED; log_state = Base::LS_Restricted; } else if(arguments.contains(ARG_LOG_STATE_INACTIVE)) { used_arguments += ARG_LOG_STATE_INACTIVE; log_state = Base::LS_Inactive; } /*display size*/ Qt::WindowState windows_state = Qt::WindowNoState; QSize window_size = QSize(SYSTEM_VIEWPORT_WIDTH,SYSTEM_VIEWPORT_HEIGHT); if(arguments.contains(ARG_FULLSCREEN)) { used_arguments += ARG_FULLSCREEN; windows_state = Qt::WindowFullScreen; } /*getting a size if available*/ for (int i = 0; i < arguments.size(); i++) { if(arguments.at(i).contains(ARG_SCREEN_SIZE)) { used_arguments += arguments.at(i); QString size_str = arguments.at(i); QStringList size_list = size_str.remove(ARG_SCREEN_SIZE).split("x"); window_size.setWidth(size_list.at(0).toInt()); window_size.setHeight(size_list.at(1).toInt()); } } /* ARGUMENTS FINISHED */ QIODevice::OpenModeFlag open_mode = QIODevice::Truncate; CoreEngine w(0,mode,log_state,conf_path); w.getLogHandler()->setLoggerState(log_state); w.getLogHandler()->setLoggerWriteMode(open_mode); w.getLogHandler()->writeToSystemLog(QString(SYSTEM_ARG_MSG+used_arguments),LogHandler::SYSTEM); /*call the startup routine*/ w.SystemStartUp(window_size,windows_state); w.show(); return a.exec(); }
//reads options and parameters from command line void TemplateCLI::readParams(int argc, char** argv) throw (iom::exception) { //command line object definition TCLAP::CmdLine cmd(getHelpText(), '=', "2.2.2"); /** * Command line constructor. Defines how the arguments will be * parsed. * \param message - The message to be used in the usage * output. * \param delimiter - The character that is used to separate * the argument flag/name from the value. Defaults to ' ' (space). * \param version - The version number to be used in the * --version switch. * \param helpAndVersion - Whether or not to create the Help and * Version switches. Defaults to true. */ //argument objects definitions //TCLAP::SwitchArg p_highest_resolution("a","all","Generate also the highest resolution.",false); /** * SwitchArg constructor. * \param flag - The one character flag that identifies this * argument on the command line. * \param name - A one word name for the argument. Can be * used as a long flag on the command line. * \param desc - A description of what the argument is for or * does. * \param def - The default value for this Switch. * \param v - An optional visitor. You probably should not * use this unless you have a very good reason. */ TCLAP::SwitchArg p_parallel("","parallel","Does not perform side-effect operations during the merge step. Use this flag when more merge steps are launched in parallel",false); TCLAP::SwitchArg p_isotropic("","isotropic","Generate lowest resolution with voxels as much isotropic as possible. Use this flag when the high resolution image has highy anistropic voxels",false); TCLAP::SwitchArg p_makedirs("","makedirs","Creates the mdata.bin file of the output volume.", false); TCLAP::SwitchArg p_metadata("","metadata","Creates the directory hierarchy.", false); TCLAP::ValueArg<std::string> p_src_root_dir("s","src","Source file / root directory path.",true,"","string"); TCLAP::ValueArg<std::string> p_dst_root_dir("d","dst","Destination root directory path.",false,"","string"); TCLAP::ValueArg<int> p_slice_depth("","depth","Slice depth.",false,-1,"unsigned"); TCLAP::ValueArg<int> p_slice_height("","height","Slice height.",false,-1,"unsigned"); TCLAP::ValueArg<int> p_slice_width("","width","Slice width.",false,-1,"unsigned"); //TCLAP::ValueArg<string> p_src_format("","sfmt","Source format (Stacked/Simple/SimpleRaw/Raw/Tiled/TiledMC).",true,"","string"); string temp = "Source format (\"" + iim::TILED_MC_FORMAT + "\"/\"" + iim::TILED_FORMAT + "\"/\"" + iim::STACKED_FORMAT + "\"/\"" + iim::SIMPLE_FORMAT + "\"/\"" + iim::SIMPLE_RAW_FORMAT + "\"/\"" + iim::RAW_FORMAT + "\"/\"" + iim::TIF3D_FORMAT + "\"/\"" + iim::TILED_TIF3D_FORMAT + "\"/\"" + iim::TILED_MC_TIF3D_FORMAT + "\"/\"" + iim::UNST_TIF3D_FORMAT + "\")"; TCLAP::ValueArg<string> p_src_format("","sfmt",temp.c_str(),true,"","string"); TCLAP::ValueArg<string> p_dst_format("","dfmt","Destination format: (RGB (default)/intensity/graylevel.",false,"RGB","string"); //TCLAP::ValueArg<int> p_n_resolutions("","res","Number of resolutions.",true,2,"unsigned"); TCLAP::ValueArg<std::string> p_resolutions("","resolutions","Resolutions to be produced. Possible values are [[i]...] where i = 0,..,5 and 2^i is the subsampling factor.",false,"0","string"); TCLAP::ValueArg<string> p_halving_method("","halve","Halving method (mean/max, default: mean).",false,"mean","unsigned"); TCLAP::ValueArg<std::string> p_outFmt("f","outFmt","Output format (Tiff2DStck/Vaa3DRaw/Tiff3D/Vaa3DRawMC/Tiff3DMC/Fiji_HDF5, default: Tiff2DStck).",false,"Tiff2DStck","string"); TCLAP::ValueArg<std::string> p_infofile_path("","info","File path of the info log file to be saved.",false,"","string"); TCLAP::SwitchArg p_hide_progress_bar("","noprogressbar","Disables progress bar and estimated time remaining", false); TCLAP::SwitchArg p_verbose("","verbose","set verbosity to maximum level (to be activated ONLY for debugging)"); TCLAP::ValueArg<int> p_V0("","V0","First V vertex (included).",false,-1,"unsigned"); TCLAP::ValueArg<int> p_V1("","V1","Last V vertex (excluded).",false,-1,"unsigned"); TCLAP::ValueArg<int> p_H0("","H0","First H vertex (included).",false,-1,"unsigned"); TCLAP::ValueArg<int> p_H1("","H1","Last H vertex (excluded).",false,-1,"unsigned"); TCLAP::ValueArg<int> p_D0("","D0","First D vertex (included).",false,-1,"unsigned"); TCLAP::ValueArg<int> p_D1("","D1","Last D vertex (excluded).",false,-1,"unsigned"); TCLAP::MultiArg<std::string> p_algo("","algorithm","Forces the use of the given algorithm.",false,"string"); //TCLAP::SwitchArg p_pluginsinfo("p","pluginsinfo","Display plugins informations",false); TCLAP::ValueArg<std::string> p_vol_in_plugin("","volin_plugin",iom::strprintf("Plugin that manages the input volume format/organization. Available plugins are: {%s}. Default is \"%s\".", iom::IOPluginFactory::registeredPlugins().c_str(), vm::VOLUME_INPUT_FORMAT_PLUGIN.c_str()),false,vm::VOLUME_INPUT_FORMAT_PLUGIN,"string"); TCLAP::ValueArg<std::string> p_vol_out_plugin("","volout_plugin",iom::strprintf("Plugin that manages the output volume format/organization. Available plugins are: {%s}. Default is \"%s\".", iom::IOPluginFactory::registeredPlugins().c_str(), vm::VOLUME_OUTPUT_FORMAT_PLUGIN.c_str()),false,vm::VOLUME_OUTPUT_FORMAT_PLUGIN,"string"); TCLAP::ValueArg<std::string> p_im_in_plugin("","imin_plugin",iom::strprintf("Plugin that manages the input image format. Available plugins are: {%s}. Default is \"auto\".", iom::IOPluginFactory::registeredPlugins().c_str()), false, "auto","string"); TCLAP::ValueArg<std::string> p_im_in_plugin_params("","imin_plugin_params","A series of parameters \"param1=val,param2=val,...\" to configure the input image plugin (see --pluginsinfo for the list of accepted parameters)", false, "","string"); TCLAP::ValueArg<std::string> p_im_out_plugin("","imout_plugin",iom::strprintf("Plugin that manages the output image format. Available plugins are: {%s}. Default is \"auto\".", iom::IOPluginFactory::registeredPlugins().c_str()), false, "auto","string"); TCLAP::ValueArg<std::string> p_im_out_plugin_params("","imout_plugin_params","A series of parameters \"param1=val,param2=val,...\" to configure the output image plugin (see --pluginsinfo for the list of accepted parameters)", false, "","string"); //argument objects must be inserted using LIFO policy (last inserted, first shown) cmd.add(p_im_out_plugin_params); cmd.add(p_im_out_plugin); cmd.add(p_im_in_plugin_params); cmd.add(p_im_in_plugin); cmd.add(p_vol_out_plugin); cmd.add(p_vol_in_plugin); //cmd.add(p_pluginsinfo); cmd.add(p_algo); cmd.add(p_metadata); cmd.add(p_makedirs); cmd.add(p_parallel); cmd.add(p_isotropic); cmd.add(p_D1); cmd.add(p_D0); cmd.add(p_H1); cmd.add(p_H0); cmd.add(p_V1); cmd.add(p_V0); cmd.add(p_verbose); cmd.add(p_hide_progress_bar); cmd.add(p_infofile_path); cmd.add(p_outFmt); cmd.add(p_halving_method); //cmd.add(p_highest_resolution); //cmd.add(p_n_resolutions); cmd.add(p_resolutions); cmd.add(p_dst_format); cmd.add(p_src_format); cmd.add(p_slice_width); cmd.add(p_slice_height); cmd.add(p_slice_depth); cmd.add(p_dst_root_dir); cmd.add(p_src_root_dir); // Parse the argv array and catch <TCLAP> exceptions, which are translated into <iim::IOException> exceptions char errMsg[S_STATIC_STRINGS_SIZE]; try{ cmd.parse( argc, argv ); } catch (TCLAP::ArgException &e) { sprintf(errMsg, "%s for arg %s\n", e.error().c_str(), e.argId().c_str()); throw iom::exception(errMsg); } int i; /* Checking parameter consistency */ if ( p_infofile_path.getValue() == "" && p_dst_root_dir.getValue() == "" ) { sprintf(errMsg, "Missing destination directory (option -d)"); throw iom::exception(errMsg); } if ( p_src_format.getValue() != iim::STACKED_FORMAT && p_src_format.getValue() != iim::SIMPLE_FORMAT && p_src_format.getValue() != iim::SIMPLE_RAW_FORMAT && p_src_format.getValue() != iim::RAW_FORMAT && p_src_format.getValue() != iim::TILED_FORMAT && p_src_format.getValue() != iim::TILED_MC_FORMAT && p_src_format.getValue() != iim::TIF3D_FORMAT && p_src_format.getValue() != iim::TILED_TIF3D_FORMAT && p_src_format.getValue() != iim::TILED_MC_TIF3D_FORMAT && p_src_format.getValue() != iim::UNST_TIF3D_FORMAT ) { temp = "Unknown source format!\nAllowed formats are:\n\t\"" + iim::TILED_MC_FORMAT + "\"/\"" + iim::TILED_FORMAT + "\"/\"" + iim::STACKED_FORMAT + "\"/\"" + iim::SIMPLE_FORMAT + "\"/\"" + iim::SIMPLE_RAW_FORMAT + "\"/\"" + iim::RAW_FORMAT + "\"/\"" + iim::TIF3D_FORMAT + "\"/\"" + iim::TILED_TIF3D_FORMAT + "\"/\"" + iim::TILED_MC_TIF3D_FORMAT + "\"/\"" + iim::UNST_TIF3D_FORMAT + "\""; //sprintf(errMsg, "Unknown source format!\nAllowed formats are:\n\tStacked / Simple / SimpeRaw / Raw / Tiled / TiledMC"); sprintf(errMsg, "%s", temp.c_str()); throw iom::exception(errMsg); } if ( p_dst_format.getValue() != "intensity" && p_dst_format.getValue() != "graylevel" && p_dst_format.getValue() != "RGB" ) { sprintf(errMsg, "Unknown destination format!\nAllowed formats are:\n\tintensity / graylevel / RGB"); throw iom::exception(errMsg); } if ( p_halving_method.getValue() != "mean" && p_halving_method.getValue() != "max" ) { sprintf(errMsg, "Unknown halving method!\nAllowed methods are:\n\tmean / max"); throw iom::exception(errMsg); } if ( p_outFmt.getValue() != "Tiff2DStck" && p_outFmt.getValue() != "Vaa3DRaw" && p_outFmt.getValue() != "Tiff3D" && p_outFmt.getValue() != "Vaa3DRawMC" && p_outFmt.getValue() != "Tiff3DMC" && p_outFmt.getValue() != "Fiji_HDF5" ) { sprintf(errMsg, "Unknown output format!\nAllowed formats are:\n\tTiff2DStck / Vaa3DRaw / Vaa3DRawMC / Tiff3D / Tiff3DMC / Fiji_HDF5"); throw iom::exception(errMsg); } if ( p_outFmt.getValue() == "Fiji_HDF5" && (p_makedirs.isSet() || p_metadata.isSet() || p_parallel.isSet()) ) { sprintf(errMsg, "makedirs, parallel, metadata options are not allowed with Fiji_HDF5 output format"); throw iom::exception(errMsg); } //checking that parallel-related options have been correctly selected if(p_makedirs.isSet() && (p_metadata.isSet() || p_parallel.isSet()) ) throw iom::exception("parallel or metadata options cannot be set with makedirs option. See --help for usage."); if(p_parallel.isSet() && p_metadata.isSet() ) throw iom::exception("metadata option cannot be set with parallel option. See --help for usage."); //importing parameters not set yet this->src_root_dir = p_src_root_dir.getValue(); this->dst_root_dir = p_dst_root_dir.getValue(); this->slice_depth = p_slice_depth.getValue(); this->slice_height = p_slice_height.getValue(); this->slice_width = p_slice_width.getValue(); this->src_format = p_src_format.getValue(); this->dst_format = p_dst_format.getValue(); this->metaData = p_metadata.getValue(); this->makeDirs = p_makedirs.getValue(); this->parallel = p_parallel.getValue(); this->isotropic = p_isotropic.getValue(); this->infofile_path = p_infofile_path.getValue(); //the [algorithm] parameter is multi-arguments vector<string> algorithms = p_algo.getValue(); for(int i = 0; i < algorithms.size(); i++) { if(algorithms[i].compare(S_NO_BLENDING_NAME) == 0) this->tm_blending = S_NO_BLENDING; else if(algorithms[i].compare(S_SINUSOIDAL_BLENDING_NAME) == 0) this->tm_blending = S_SINUSOIDAL_BLENDING; else if(algorithms[i].compare(S_SHOW_STACK_MARGIN_NAME) == 0) this->tm_blending = S_SHOW_STACK_MARGIN; else { sprintf(errMsg, "Invalid argument \"%s\" for parameter --%s! Allowed values are:\n-\"%s\"\n-\"%s\"\n", algorithms[i].c_str(), p_algo.getName().c_str(), S_NO_BLENDING_NAME, S_SINUSOIDAL_BLENDING_NAME); throw iom::exception(errMsg); } } //this->pluginsinfo = p_pluginsinfo.getValue(); //importing parameters // vm::VOLUME_INPUT_FORMAT_PLUGIN = p_vol_in_plugin.getValue(); // vm::VOLUME_OUTPUT_FORMAT_PLUGIN = p_vol_out_plugin.getValue(); // 2014-09-29. Alessandro. @ADDED automated selection of IO plugin if not provided. // if(p_im_in_plugin.getValue().compare("auto") == 0) // { // if(vm::VOLUME_INPUT_FORMAT_PLUGIN.compare("TiledXY|2Dseries") == 0) // iom::IMIN_PLUGIN = "tiff2D"; // else if(vm::VOLUME_INPUT_FORMAT_PLUGIN.compare("TiledXY|3Dseries") == 0) // iom::IMIN_PLUGIN = "tiff3D"; // } // else // iom::IMIN_PLUGIN = p_im_in_plugin.getValue(); // iom::IMIN_PLUGIN_PARAMS = p_im_in_plugin_params.getValue(); // 2014-09-29. Alessandro. @ADDED automated selection of IO plugin if not provided. // if(p_im_out_plugin.getValue().compare("auto") == 0) // { // if(p_vol_out_plugin.getValue().compare("TiledXY|2Dseries") == 0) // iom::IMOUT_PLUGIN = "tiff2D"; // else if(p_vol_out_plugin.getValue().compare("TiledXY|3Dseries") == 0) // iom::IMOUT_PLUGIN = "tiff3D"; // } // else // iom::IMOUT_PLUGIN = p_im_in_plugin.getValue(); // iom::IMOUT_PLUGIN_PARAMS = p_im_out_plugin_params.getValue(); //this->resolutions[0] = p_highest_resolution.getValue() ? 1 : 0; //for ( i=1; i<p_n_resolutions.getValue(); i++ ) // this->resolutions[i] = 1; //for ( ; i<S_MAX_MULTIRES; i++ ) // this->resolutions[i] = 0; for(i=0; i<= S_MAX_MULTIRES; i++) { stringstream buf; buf << i; this->resolutions[i] = p_resolutions.getValue().find(buf.str()) != std::string::npos; } if ( p_halving_method.getValue() == "mean" ) this->halving_method = HALVE_BY_MEAN; else if ( p_halving_method.getValue() == "max" ) this->halving_method = HALVE_BY_MAX; this->outFmt = p_outFmt.getValue(); this->show_progress_bar = !p_hide_progress_bar.getValue(); this->V0 = p_V0.getValue(); this->V1 = p_V1.getValue(); this->H0 = p_H0.getValue(); this->H1 = p_H1.getValue(); this->D0 = p_D0.getValue(); this->D1 = p_D1.getValue(); if(p_verbose.getValue()) { terastitcher::DEBUG = terastitcher::LEV_MAX; iim::DEBUG = iim::LEV_MAX; iom::DEBUG = iom::LEV_MAX; } }
void AccessibilityUIElement::helpTextGetterCallback(CppVariant* result) { result->set(getHelpText(accessibilityObject())); }