예제 #1
0
void SvnLogHandler::Process(const wxString& output)
{
    // create new editor and set the output to it
    wxString changeLog (output);
    if(m_compact) {
        // remove non interesting lines
        changeLog = Compact(changeLog);
    }

    ChangeLogPage *page = new ChangeLogPage(GetPlugin()->GetManager()->GetTheApp()->GetTopWindow(), GetPlugin());
    page->SetUrl(m_url);
    page->AppendText( changeLog );
    GetPlugin()->GetManager()->AddPage( page, _("Change Log"), _("Change Log"), wxNullBitmap, true );
}
예제 #2
0
파일: Task.cpp 프로젝트: tsalidis/dune
      //! Start a given plan
      //! @param[in] plan_id name of the plan to execute
      //! @param[in] spec plan specification message if any
      //! @param[in] flags plan control flags
      //! @return false if previously executing maneuver was not stopped
      bool
      startPlan(const std::string& plan_id, const IMC::Message* spec, uint16_t flags)
      {
        bool stopped = stopPlan(true);

        changeMode(IMC::PlanControlState::PCS_INITIALIZING,
                   DTR("plan initializing: ") + plan_id);

        if (!loadPlan(plan_id, spec, true))
          return stopped;

        changeLog(plan_id);

        // Flag the plan as starting
        if (initMode() || execMode())
        {
          if (!stopped)
            m_plan->planStopped();

          m_plan->planStarted();
        }

        dispatch(m_spec);

        if ((flags & IMC::PlanControl::FLG_CALIBRATE) &&
            m_args.do_calib)
        {
          if (!startCalibration())
            return stopped;
        }
        else
        {
          IMC::PlanManeuver* pman = m_plan->loadStartManeuver();
          startManeuver(pman);

          if (execMode())
          {
            onSuccess(m_last_event);
          }
          else
          {
            onFailure(m_last_event);
            return stopped;
          }
        }

        return true;
      }
예제 #3
0
파일: Task.cpp 프로젝트: tsalidis/dune
      //! Change the current plan control state mode
      //! @param[in] s plan control state to switch to
      //! @param[in] event_desc description of the event that motivated the change
      //! @param[in] nid id of the maneuver if any
      //! @param[in] maneuver pointer to maneuver message
      //! @param[in] print true if the messages should be printed to output
      void
      changeMode(IMC::PlanControlState::StateEnum s, const std::string& event_desc,
                 const std::string& nid, const IMC::Message* maneuver, bool print = true)
      {
        double now = Clock::getSinceEpoch();

        if (print)
          war("%s", event_desc.c_str());

        m_last_event = event_desc;

        if (s != m_pcs.state)
        {
          debug(DTR("now in %s state"), DTR(c_state_desc[s]));

          bool was_in_plan = initMode() || execMode();

          m_pcs.state = s;

          bool is_in_plan = initMode() || execMode();

          if (was_in_plan && !is_in_plan)
          {
            m_plan->planStopped();
            changeLog("");
          }
        }

        if (maneuver)
        {
          m_pcs.man_id = nid;
          m_pcs.man_type = maneuver->getId();
        }
        else
        {
          m_pcs.man_id.clear();
          m_pcs.man_type = 0xFFFF;
        }

        m_pcs.setTimeStamp(now);
        dispatch(m_pcs, DF_KEEP_TIME);
      }
예제 #4
0
//Constructors:
ProjectFilenamesDialog::ProjectFilenamesDialog(ftk::ProjectFiles * files, QWidget * parent)
: QDialog(parent)
{
	pFiles = files;

	QString buttonText = tr("Change...");
	int labelWidths = 120;

	QVBoxLayout *masterLayout = new QVBoxLayout;

	/*
	QHBoxLayout *pLayout = new QHBoxLayout;
	projectLabel = new QLabel(tr("Project File: "));
	projectLabel->setFixedWidth(labelWidths);
	projectFile = new QLabel(projfile);
	projectFile->setFrameShadow(QFrame::Sunken);
	projectFile->setFrameShape(QFrame::StyledPanel);
	pLayout->addWidget(projectLabel);
	pLayout->addWidget(projectFile);
	//pLayout->addStretch(5);
	masterLayout->addLayout(pLayout);
	*/

	QHBoxLayout *pathLayout = new QHBoxLayout;
	pathLabel = new QLabel(tr("Project Path: "));
	pathLabel->setFixedWidth(labelWidths);
	inputPath = new QLabel(QString::fromStdString(files->path));
	inputPath->setFrameShadow(QFrame::Sunken);
	inputPath->setFrameShape(QFrame::StyledPanel);
	pathButton = new QPushButton(buttonText);
	pathButton->setVisible(false);
	connect(pathButton, SIGNAL(clicked()), this, SLOT(changePath()));
	pathLayout->addWidget(pathLabel);
	pathLayout->addWidget(inputPath);
	pathLayout->addWidget(pathButton);
	masterLayout->addLayout(pathLayout);

	QHBoxLayout *nLayout = new QHBoxLayout;
	nameLabel = new QLabel(tr("Project Name: "));
	nameLabel->setFixedWidth(labelWidths);
	nameText = new QLabel(QString::fromStdString(files->name));
	nameText->setFrameShadow(QFrame::Sunken);
	nameText->setFrameShape(QFrame::StyledPanel);
	nameButton = new QPushButton(buttonText);
	connect(nameButton, SIGNAL(clicked()), this, SLOT(changeName()));
	nLayout->addWidget(nameLabel);
	nLayout->addWidget(nameText);
	nLayout->addWidget(nameButton);
	masterLayout->addLayout(nLayout);

	//masterLayout->addStretch(5);
	masterLayout->addSpacerItem(new QSpacerItem(labelWidths,5));

	QHBoxLayout *iLayout = new QHBoxLayout;
	inputLabel = new QLabel(tr("Input: "));
	inputLabel->setFixedWidth(labelWidths);
	inputFile = new QLabel(QString::fromStdString(files->input));
	inputFile->setFrameShadow(QFrame::Sunken);
	inputFile->setFrameShape(QFrame::StyledPanel);
	inputButton = new QPushButton(buttonText);
	inputButton->setVisible(false);
	connect(inputButton, SIGNAL(clicked()), this, SLOT(changeInput()));
	iLayout->addWidget(inputLabel);
	iLayout->addWidget(inputFile);
	iLayout->addWidget(inputButton);
	masterLayout->addLayout(iLayout);

	QHBoxLayout *oLayout = new QHBoxLayout;
	outputLabel = new QLabel(tr("Output: "));
	outputLabel->setFixedWidth(labelWidths);
	outputFile = new QLabel(QString::fromStdString(files->output));
	outputFile->setFrameShadow(QFrame::Sunken);
	outputFile->setFrameShape(QFrame::StyledPanel);
	outputButton = new QPushButton(buttonText);
	outputButton->setVisible(false);
	connect(outputButton, SIGNAL(clicked()), this, SLOT(changeOutput()));
	oLayout->addWidget(outputLabel);
	oLayout->addWidget(outputFile);
	oLayout->addWidget(outputButton);
	masterLayout->addLayout(oLayout);

	QHBoxLayout *lLayout = new QHBoxLayout;
	logLabel = new QLabel(tr("Edit Log: "));
	logLabel->setFixedWidth(labelWidths);
	logFile = new QLabel(QString::fromStdString(files->log));
	logFile->setFrameShadow(QFrame::Sunken);
	logFile->setFrameShape(QFrame::StyledPanel);
	logButton = new QPushButton(buttonText);
	logButton->setEnabled(false);					//Cannot change the log file here!!
	logButton->setVisible(false);
	connect(logButton, SIGNAL(clicked()), this, SLOT(changeLog()));
	lLayout->addWidget(logLabel);
	lLayout->addWidget(logFile);
	lLayout->addWidget(logButton);
	masterLayout->addLayout(lLayout);

	QHBoxLayout *dLayout = new QHBoxLayout;
	definitionLabel = new QLabel(tr("Project Definition: "));
	definitionLabel->setFixedWidth(labelWidths);
	definitionFile = new QLabel(QString::fromStdString(files->definition));
	definitionFile->setFrameShadow(QFrame::Sunken);
	definitionFile->setFrameShape(QFrame::StyledPanel);
	definitionButton = new QPushButton(buttonText);
	definitionButton->setVisible(false);
	connect(definitionButton, SIGNAL(clicked()), this, SLOT(changeDefinition()));
	dLayout->addWidget(definitionLabel);
	dLayout->addWidget(definitionFile);
	dLayout->addWidget(definitionButton);
	masterLayout->addLayout(dLayout);

	QHBoxLayout *tLayout = new QHBoxLayout;
	tableLabel = new QLabel(tr("Table: "));
	tableLabel->setFixedWidth(labelWidths);
	tableFile = new QLabel(QString::fromStdString(files->table));
	tableFile->setFrameShadow(QFrame::Sunken);
	tableFile->setFrameShape(QFrame::StyledPanel);
	tableButton = new QPushButton(buttonText);
	tableButton->setVisible(false);
	connect(tableButton, SIGNAL(clicked()), this, SLOT(changeTable()));
	tLayout->addWidget(tableLabel);
	tLayout->addWidget(tableFile);
	tLayout->addWidget(tableButton);
	masterLayout->addLayout(tLayout);

	QHBoxLayout *a_tLayout = new QHBoxLayout;
	adjTablesLabel = new QLabel(tr("Adj_Tables: "));
	adjTablesLabel->setFixedWidth(labelWidths);
	adjTablesFile = new QLabel(QString::fromStdString(files->adjTables));
	adjTablesFile->setFrameShadow(QFrame::Sunken);
	adjTablesFile->setFrameShape(QFrame::StyledPanel);
	adjTablesButton = new QPushButton(buttonText);
	adjTablesButton->setVisible(false);
	connect(adjTablesButton, SIGNAL(clicked()), this, SLOT(changeAdjTables()));
	a_tLayout->addWidget(adjTablesLabel);
	a_tLayout->addWidget(adjTablesFile);
	a_tLayout->addWidget(adjTablesButton);
	masterLayout->addLayout(a_tLayout);

	masterLayout->addStretch(5);

	QHBoxLayout *okLayout = new QHBoxLayout;

	quitButton = new QPushButton(tr("Cancel"));
	connect(quitButton, SIGNAL(clicked()), this, SLOT(reject()));
	okButton = new QPushButton(tr("Done"));
	connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
	okLayout->addStretch(20);
	okLayout->addWidget(quitButton);
	okLayout->addWidget(okButton);
	masterLayout->addLayout(okLayout);

	this->setLayout(masterLayout);

	//this->setupDefaults();
}