Exemplo n.º 1
0
void SvgView::wheelEvent(QWheelEvent* event)
{
    if(event->delta() > 0)
        mZoomLevel = (mZoomLevel * mZoomFactor);
    else
    {
        if (mZoomLevel > 0.4)
            mZoomLevel = (mZoomLevel / mZoomFactor);
    }

    loadPlan(mPlan);
}
Exemplo n.º 2
0
bool IFFT::init()
{
    if (!_inputSize) {
        qWarning() << "IFFt: Error while loading required fields.";
        _initialized = false;
        return false;
    }
    _realDataSize = 2*(_inputSize - 1);
    _realData = Frame(_realDataSize);
    _complexData = (ComplexSample*)fftw_malloc(sizeof(ComplexSample)*_realDataSize);
    loadPlan();
    _initialized = true;
    return true;

}
Exemplo n.º 3
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    //Init
    isSqlSetted = false;

    //status tips
    ui->actionDataBase_Info->setStatusTip(tr("Set Database Info."));
    ui->actionLogin->setStatusTip(tr("Get Login Dialog."));
    ui->actionExit->setStatusTip(tr("Exit the Window."));
    ui->actionLogout->setStatusTip(tr("Logout the account."));

    //signals and slots
    connect(ui->actionDataBase_Info, SIGNAL(triggered()), this, SLOT(getDBInfo()));
    connect(ui->actionLogin, SIGNAL(triggered()), this, SLOT(login()));
    connect(ui->actionLogout, SIGNAL(triggered()), this, SLOT(reset()));

    connect(ui->infoWidget, SIGNAL(loadProfile()), this, SLOT(loadProfile()));
    connect(ui->infoWidget, SIGNAL(loadScore()), this, SLOT(loadScore()));
    connect(ui->infoWidget, SIGNAL(loadCurriculumSchedule()), this, SLOT(loadCurriculumSchedule()));
    connect(ui->infoWidget, SIGNAL(loadElective()), this, SLOT(loadElective()));
    connect(ui->infoWidget, SIGNAL(loadPlan()), this, SLOT(loadPlan()));
    connect(ui->infoWidget, SIGNAL(loadRecord()), this, SLOT(loadRecord()));
    connect(ui->infoWidget, SIGNAL(chgPwd()), this, SLOT(changePwd()));

//    dbInfo.hostName = "localhost";
//    dbInfo.DBName = "Handin";
//    dbInfo.userName = "******";
//    dbInfo.password = "******";

    //login();

}
Exemplo n.º 4
0
      //! 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;
      }
Exemplo n.º 5
0
      void
      processRequest(const IMC::PlanControl* pc)
      {
        m_reply.setDestination(pc->getSource());
        m_reply.setDestinationEntity(pc->getSourceEntity());
        m_reply.request_id = pc->request_id;
        m_reply.op = pc->op;
        m_reply.plan_id = pc->plan_id;

        inf(DTR("request -- %s (%s)"),
            DTR(c_op_desc[m_reply.op]),
            m_reply.plan_id.c_str());

        if (getEntityState() != IMC::EntityState::ESTA_NORMAL)
        {
          onFailure(DTR("engine not ready: entity state not normal"));
          return;
        }

        switch (pc->op)
        {
          case IMC::PlanControl::PC_START:
            if (!startPlan(pc->plan_id, pc->arg.isNull() ? 0 : pc->arg.get(), pc->flags))
              vehicleRequest(IMC::VehicleCommand::VC_STOP_MANEUVER);
            break;
          case IMC::PlanControl::PC_STOP:
            stopPlan();
            break;
          case IMC::PlanControl::PC_LOAD:
            loadPlan(pc->plan_id, pc->arg.isNull() ? 0 : pc->arg.get(), false);
            break;
          case IMC::PlanControl::PC_GET:
            getPlan();
            break;
          default:
            onFailure(DTR("plan control operation not supported"));
            break;
        }
      }
Exemplo n.º 6
0
void SvgView::reload(void)
{
    if (mPlan)
        loadPlan(mPlan);
}
Exemplo n.º 7
0
void IFFT::setComplexData(ComplexSample *complexData)
{
    _complexData = complexData;
    loadPlan();
}