示例#1
0
  CancelAction::CancelAction( QWidget* parent )
    : rviz::Panel( parent )
  {
    layout = new QVBoxLayout;

    //Text Box and Add Button to add new topic
    QHBoxLayout* topic_layout = new QHBoxLayout;
    output_topic_editor_ = new QLineEdit;
    //topic_layout->addWidget( output_topic_editor_ );

    add_topic_box_ = new QComboBox;
    initComboBox();
    topic_layout->addWidget( add_topic_box_ );

    QPushButton* add_topic_button_ = new QPushButton("Add Action");
    topic_layout->addWidget( add_topic_button_ );

    layout->addLayout( topic_layout );
    //End of Text Box and Add Button

    m_sigmap = new QSignalMapper(this);

    connect(m_sigmap, SIGNAL(mapped(int)),this, SLOT(OnClickDeleteButton(int)));

    //Button to send cancel topic
    QPushButton* send_topic_button_ = new QPushButton("Cancel Action");
    layout->addWidget( send_topic_button_ );

    setLayout( layout );

    connect( send_topic_button_, SIGNAL( clicked() ), this, SLOT( sendTopic ()));
    connect( add_topic_button_, SIGNAL( clicked() ), this, SLOT( addTopic() ));
  }
示例#2
0
//
// Useful references:
//  - http://pocoproject.org/docs/Poco.Logger.html
//  - http://pocoproject.org/docs/Poco.FileChannel.html
//
//------------------------------------------------------------------------------------
// inspired by the Poco LogRotation sample
ofxLogger::ofxLogger()
{	

	bConsole = true;
	bFile = false;

	bHeader = false;
	bDate = true;
	bTime = true;
	bFrameNum = false;
	bMillis = false;

	splitterChannel = new Poco::SplitterChannel();

	consoleChannel = new Poco::ConsoleChannel();
	fileChannel = new Poco::FileChannel(ofToDataPath("openframeworks.log"));

	// console open, file not opened (added) by default
	splitterChannel->addChannel(consoleChannel);

	Poco::AutoPtr<Poco::Formatter> formatter(new Poco::PatternFormatter("%t"));
	formattingChannel = new Poco::FormattingChannel(formatter, splitterChannel);

	// the root logger has an empty name
	logger = &Poco::Logger::create("", formattingChannel, _convertOfLogLevel(OF_LOG_NOTICE));

	// setup file logger
	fileChannel->setProperty("times", "local");		// use local system time
	fileChannel->setProperty("archive", "number");	// use number suffixs
	fileChannel->setProperty("compress", "false"); 	// don't compress
	fileChannel->setProperty("purgeCount", "10");	// max number of log files

	// add default of topic
	addTopic("of");
}
示例#3
0
inline double *GridmapLocations::get_values(std::string topic){
  if(last_obs_times.find(topic) == last_obs_times.end()){
    addTopic(topic); 
  }
      
  std::map<std::string, double *>::iterator it = last_obs_times.find(topic); 
  assert(it != last_obs_times.end());
  assert(it->second != NULL);
  return it->second; 
}
示例#4
0
         void textInput::draw()
         {
            setColor(Colors::C_NORMAL);

            counter_ = 0;

            addTopic(topic_);

            addValue();
		
            unSetColor(Colors::C_NORMAL);
         }
示例#5
0
         void numberInputWindow::draw()
         {
            setColor(Colors::C_NORMAL);

            counter_ = 0;

            addTopic(topic_);

            addValue();
		
            unSetColor(Colors::C_NORMAL);
         }
int CommandLineHelpModule::run(int argc, char *argv[])
{
    // Add internal topics lazily here.
    addTopic(HelpTopicPointer(new CommandsHelpTopic(*impl_)), false);

    const char *const exportFormats[] = { "rst", "completion" };
    std::string       exportFormat;
    Options           options(NULL, NULL);
    options.addOption(StringOption("export").store(&exportFormat)
                          .enumValue(exportFormats));
    CommandLineParser(&options).parse(&argc, argv);
    if (!exportFormat.empty())
    {
        ModificationCheckingFileOutputRedirector redirector(impl_->outputRedirector_);
        const std::unique_ptr<IHelpExport>       exporter(
                impl_->createExporter(exportFormat, &redirector));
        impl_->exportHelp(exporter.get());
        return 0;
    }

    TextOutputStream      &outputFile = impl_->outputRedirector_->standardOutput();
    TextWriter             writer(&outputFile);
    HelpLinks              links(eHelpOutputFormat_Console);
    initProgramLinks(&links, *impl_);
    CommandLineHelpContext context(&writer, eHelpOutputFormat_Console, &links,
                                   impl_->binaryName_);
    context.setShowHidden(impl_->bHidden_);
    if (impl_->moduleOverride_ != NULL)
    {
        context.setModuleDisplayName(impl_->programContext_.displayName());
        impl_->moduleOverride_->writeHelp(context);
        return 0;
    }
    impl_->context_ = &context;

    HelpManager helpManager(impl_->rootTopic_, context.writerContext());
    try
    {
        for (int i = 1; i < argc; ++i)
        {
            helpManager.enterTopic(argv[i]);
        }
    }
    catch (const InvalidInputError &ex)
    {
        fprintf(stderr, "%s\n", ex.what());
        return 2;
    }
    helpManager.writeCurrentTopic();
    return 0;
}
int CommandLineHelpModule::run(int argc, char *argv[])
{
    // Add internal topics lazily here.
    addTopic(HelpTopicPointer(new CommandsHelpTopic(*impl_)));

    const char *const exportFormats[] = { "rst", "completion" };
    std::string       exportFormat;
    Options           options(NULL, NULL);
    options.addOption(StringOption("export").store(&exportFormat)
                          .enumValue(exportFormats));
    CommandLineParser(&options).parse(&argc, argv);
    if (!exportFormat.empty())
    {
        boost::scoped_ptr<HelpExportInterface> exporter;
        if (exportFormat == "rst")
        {
            exporter.reset(new HelpExportReStructuredText(*impl_));
        }
        else if (exportFormat == "completion")
        {
            exporter.reset(new HelpExportCompletion(*impl_));
        }
        else
        {
            GMX_THROW(NotImplementedError("This help format is not implemented"));
        }
        impl_->exportHelp(exporter.get());
        return 0;
    }

    File &outputFile = impl_->outputRedirector_->standardOutput();
    HelpLinks                                 links(eHelpOutputFormat_Console);
    initProgramLinks(&links, *impl_);
    boost::scoped_ptr<CommandLineHelpContext> context(
            new CommandLineHelpContext(&outputFile,
                                       eHelpOutputFormat_Console, &links));
    context->setShowHidden(impl_->bHidden_);
    if (impl_->moduleOverride_ != NULL)
    {
        context->setModuleDisplayName(impl_->programContext_.displayName());
        impl_->moduleOverride_->writeHelp(*context);
        return 0;
    }
    impl_->context_ = context.get();

    HelpManager helpManager(*impl_->rootTopic_, context->writerContext());
    try
    {
        for (int i = 1; i < argc; ++i)
        {
            helpManager.enterTopic(argv[i]);
        }
    }
    catch (const InvalidInputError &ex)
    {
        fprintf(stderr, "%s\n", ex.what());
        return 2;
    }
    helpManager.writeCurrentTopic();
    return 0;
}