Example #1
0
    UAVSimulation::UAVSimulation(const DUNE::Math::Matrix& pos, const DUNE::Math::Matrix& vel,
        const double& bank_time_cst, const double& speed_time_cst, const double& alt_time_cst,
        const double& altitude_cmd, const double& airspeed_cmd, const double& bank_cmd):
          //! Simulation type
          m_sim_type("5DOF")
    {
      resetModel();

      //! Vehicle position
      setPosition(pos);

      //! Vehicle velocity vector
      setVelocity(vel);

      //! Vehicle model parameters
      //! - Bank time constant
      m_bank_time_cst = bank_time_cst;
      m_bank_time_cst_f = true;
      //! - Airspeed time constant
      m_speed_time_cst = speed_time_cst;
      m_speed_time_cst_f = true;
      //! - Altitude time constant
      m_alt_time_cst = alt_time_cst;
      m_alt_time_cst_f = true;

      //! Control commands
      //! - Bank
      m_bank_cmd = bank_cmd;
      //! - Airspeed
      m_airspeed_cmd = airspeed_cmd;
      m_airspeed_cmd_ini = true;
      //! - Altitude
      m_altitude_cmd = altitude_cmd;
      m_altitude_cmd_ini = true;
    }
Example #2
0
void BindingModel::selectionChanged(const QList<ModelNode> &selectedNodes)
{
    m_handleDataChanged = false;
    m_selectedModelNodes = selectedNodes;
    resetModel();
    m_handleDataChanged = true;
}
Example #3
0
MainWindow::MainWindow()
{
  setupUi(this);
  tabWidget->setCurrentIndex(0);

  tmpTxtFile = new QTemporaryFile;
  setWindowTitle("Fcitx Table Editor");
  progressBar = new QProgressBar(this);
  progressBar->setWindowModality(Qt::ApplicationModal);
  progressBar->hide();
  statusBar()->addWidget(progressBar);
  connect(&xx, SIGNAL(setProgressRange(int,int)), progressBar, SLOT(setRange(int,int)));
  connect(&xx, SIGNAL(setProgressValue(int)), progressBar, SLOT(setValue(int)));
  connect(this, SIGNAL(setSaveProgressRange(int,int)), progressBar, SLOT(setRange(int,int)));
  connect(this, SIGNAL(setSaveProgressValue(int)), progressBar, SLOT(setValue(int)));

  addWordDict = 0;
  ruleModel = new RuleModel();
  wordModel = new WordModel();
  proxyModel = new FilterProxyModel();
  regType_comboBox->addItem(tr("Regular expression"), QRegExp::RegExp);
  regType_comboBox->addItem(tr("Wildcard"), QRegExp::Wildcard);
  regType_comboBox->addItem(tr("Fixed string"), QRegExp::FixedString);
  regType_comboBox->setCurrentIndex(1);
  resetModel();

  connect(this, SIGNAL(warningHappend(QString,QString)), this, SLOT(popWarning(QString,QString)));
  connect(&openFileWatcher, SIGNAL(finished()), this, SLOT(finishedOpen()));
}
void StatesEditorView::propertiesRemoved(const QList<AbstractProperty>& propertyList)
{
    foreach (const AbstractProperty &property, propertyList) {
        if (property.name() == "states" && property.parentModelNode().isRootNode())
            resetModel();
    }
}
void MetaWindow::createActions(){
	resetAct = new QAction(tr("&Reset"),this);
	resetAct->setShortcut(tr("Ctrl+R"));
	resetAct->setStatusTip(tr("Reset the list to its original state."));
	connect(resetAct, SIGNAL(triggered()), this, SLOT(resetModel()));

	saveAct = new QAction(tr("&Save"),this);
	saveAct->setShortcut(tr("Ctrl+S"));
	saveAct->setStatusTip(tr("Save the current file."));
	connect(saveAct, SIGNAL(triggered()), this, SLOT(saveFile()));

	saveAsAct = new QAction(tr("Save As..."),this);
	saveAsAct->setStatusTip(tr("Save the current file to a specified file name."));
	connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveFileAs()));

	loadAct = new QAction(tr("&Load"),this);
	loadAct->setShortcut(tr("Ctrl+L"));
	loadAct->setStatusTip(tr("Load input file"));
	connect(loadAct, SIGNAL(triggered()), this, SLOT(loadFile()));

	quitAct = new QAction(tr("&Quit"),this);
	quitAct->setShortcut(tr("Ctrl+Q"));
	quitAct->setStatusTip(tr("Quit"));
	connect(quitAct, SIGNAL(triggered()), this, SLOT(close()));

	aboutAct = new QAction(tr("About"),this);
	searchAct = new QAction(tr("Search For Parameter/Parameter List"), this);
	searchAct->setToolTip("Search for a particular Parameter or ParameterList");
	connect(aboutAct, SIGNAL(triggered()), this, SLOT(showAbout()));
	connect(searchAct, SIGNAL(triggered()), this, SLOT(initiateSearch()));
}
int fl_gui::MainWindowController::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0:
            resetModel();
            break;
        case 1:
            loadExample1();
            break;
        case 2:
            loadExample2();
            break;
        case 3:
            loadExample3();
            break;
        case 4:
            showSetupWindow();
            break;
        case 5:
            showTestWindow();
            break;
        default:
            ;
        }
        _id -= 6;
    }
    return _id;
}
 // Don't reload the model if folders are not from current account or a local folder,
 // folders list can be long in some cases.
 foreach (QMailFolderId folderId, ids) {
     QMailFolder folder(folderId);
     if (folderId == QMailFolder::LocalStorageFolderId || folder.parentAccountId() == m_accountId) {
         resetModel();
         return;
     }
 }
Example #8
0
void QCompletionModel::setFiltered(bool filtered)
{
    if (showAll == !filtered)
        return;
    showAll = !filtered;
    resetModel();
}
Example #9
0
void CurvesManagerView::createCurvesSettings()
{
    curvesSettings = new CurvesSettings(this);
    ui->curvesSettingsLayout->addWidget(curvesSettings);
    connect(curvesFiller, SIGNAL(dataWasSetted()), curvesSettings, SLOT(resetView()));
    connect(curvesSettings, SIGNAL(visibilityCurveChanged()), curvesFiller, SLOT(resetModel()));
}
Example #10
0
KNMusicCategoryModel::KNMusicCategoryModel(QObject *parent) :
    QStandardItemModel(parent)
{
    //Set the default no album icon.
    setNoAlbumIcon(KNMusicGlobal::instance()->noAlbumArt());
    //Initial the model.
    resetModel();
}
LS3SelectionDisplayModel::LS3SelectionDisplayModel(LS3Datastore* datastore, QObject* parent):
    QAbstractListModel(parent)
{
    m_datastore=datastore;
    loadData();
    connect(datastore, SIGNAL(selectionChanged(int, bool)), this, SLOT(resetModel()));
    connect(datastore, SIGNAL(massiveSelectionChange()), this, SLOT(resetModel()));
}
Example #12
0
    UAVSimulation::UAVSimulation(const DUNE::Math::Matrix& vel):
        //! Simulation type
        m_sim_type("3DOF")
    {
      resetModel();

      //! Vehicle velocity vector
      setVelocity(vel);
    }
SnapshotHandler::SnapshotHandler(QObject *parent)
  : QAbstractTableModel(parent),
    m_positionIcon(QIcon(":/debugger/images/location_16.png")),
    m_emptyIcon(QIcon(":/debugger/images/debugger_empty_14.png"))
{
    m_currentIndex = 0;
    connect(theDebuggerAction(OperateByInstruction), SIGNAL(triggered()),
        this, SLOT(resetModel()));
}
Example #14
0
void QgsAttributeTableModel::featuresDeleted( const QgsFeatureIds &fids )
{
  QList<int> rows;

  const auto constFids = fids;
  for ( QgsFeatureId fid : constFids )
  {
    QgsDebugMsgLevel( QStringLiteral( "(%2) fid: %1, size: %3" ).arg( fid ).arg( mFeatureRequest.filterType() ).arg( mIdRowMap.size() ), 4 );

    int row = idToRow( fid );
    if ( row != -1 )
      rows << row;
  }

  std::sort( rows.begin(), rows.end() );

  int lastRow = -1;
  int beginRow = -1;
  int currentRowCount = 0;
  int removedRows = 0;
  bool reset = false;

  const auto constRows = rows;
  for ( int row : constRows )
  {
#if 0
    qDebug() << "Row: " << row << ", begin " << beginRow << ", last " << lastRow << ", current " << currentRowCount << ", removed " << removedRows;
#endif
    if ( lastRow == -1 )
    {
      beginRow = row;
    }

    if ( row != lastRow + 1 && lastRow != -1 )
    {
      if ( rows.count() > 100 && currentRowCount < 10 )
      {
        reset = true;
        break;
      }
      removeRows( beginRow - removedRows, currentRowCount );

      beginRow = row;
      removedRows += currentRowCount;
      currentRowCount = 0;
    }

    currentRowCount++;

    lastRow = row;
  }

  if ( !reset )
    removeRows( beginRow - removedRows, currentRowCount );
  else
    resetModel();
}
Example #15
0
void QCompletionModel::filter(const QStringList& parts)
{
    Q_D(QCompletionModel);
    engine->filter(parts);
    resetModel();

    if (d->model->canFetchMore(engine->curParent))
        d->model->fetchMore(engine->curParent);
}
Example #16
0
void DocumentPropertiesDialog::piRemove ()
{
  const QModelIndex &idx = ui->listViewPI->currentIndex();
  if ( !idx.isValid() )
    return;

  QString key = piKeyByIndex ( idx );
  _pi.remove ( key );
  resetModel ();
}
Example #17
0
StackHandler::StackHandler(QObject *parent)
  : QAbstractTableModel(parent),
    m_positionIcon(QIcon(":/debugger/images/location.svg")),
    m_emptyIcon(QIcon(":/debugger/images/empty.svg"))
{
    m_currentIndex = 0;
    m_canExpand = false;
    connect(theDebuggerAction(OperateByInstruction), SIGNAL(triggered()),
        this, SLOT(resetModel()));
}
Example #18
0
    UAVSimulation::UAVSimulation(const double& alt_time_cst):
        //! Simulation type
        m_sim_type("4DOF_alt")
    {
      resetModel();

      //! Vehicle model parameters
      //! - Altitude time constant
      m_alt_time_cst = alt_time_cst;
      m_alt_time_cst_f = true;
    }
Example #19
0
void DocumentPropertiesDialog::piAdd ()
{
  QString newTarget;
  for ( int i=1; true; i++ ) {
    newTarget = tr("target_%1").arg ( i );
    if ( !_pi.keys().contains( newTarget  ) )
      break;
  }
  _pi.insert ( newTarget, tr("Data") );
  resetModel();
}
void StatesEditorView::modelAttached(Model *model)
{
    if (model == QmlModelView::model())
        return;

    Q_ASSERT(model);
    QmlModelView::modelAttached(model);

    if (m_statesEditorWidget)
        m_statesEditorWidget->setNodeInstanceView(nodeInstanceView());

    resetModel();
}
Example #21
0
    UAVSimulation::UAVSimulation(const DUNE::Math::Matrix& vel, const double& alt_time_cst):
        //! Simulation type
        m_sim_type("4DOF_alt")
    {
      resetModel();

      //! Vehicle velocity vector
      setVelocity(vel);

      //! Vehicle model parameters
      //! - Altitude time constant
      m_alt_time_cst = alt_time_cst;
      m_alt_time_cst_f = true;
    }
Example #22
0
    UAVSimulation::UAVSimulation(const double& bank_time_cst, const double& speed_time_cst):
        //! Simulation type
        m_sim_type("4DOF_bank")
    {
      resetModel();

      //! Vehicle model parameters
      //! - Bank time constant
      m_bank_time_cst = bank_time_cst;
      m_bank_time_cst_f = true;
      //! - Airspeed time constant
      m_speed_time_cst = speed_time_cst;
      m_speed_time_cst_f = true;
    }
CParticleLinkDialog::CParticleLinkDialog(CSkeletonTreeModel *model, QWidget *parent)
	: QDockWidget(parent)
{
	_ui.setupUi(this);

	qobject_cast<QMainWindow *>(parent)->addDockWidget(Qt::RightDockWidgetArea, this);

	_ui.treeView->setModel(model);

	connect(model, SIGNAL(modelReset()), this, SLOT(resetModel()));
	connect(_ui.linkPushButton, SIGNAL(clicked()), this, SLOT(setLink()));
	connect(_ui.unlinkPushButton, SIGNAL(clicked()), this, SLOT(setUnlink()));
	connect(_ui.treeView, SIGNAL(clicked(QModelIndex)), this, SLOT(clickedItem(QModelIndex)));
}
void StatesEditorView::modelAttached(Model *model)
{
    if (model == AbstractView::model())
        return;

    Q_ASSERT(model);
    AbstractView::modelAttached(model);

    if (m_statesEditorWidget)
        m_statesEditorWidget->setNodeInstanceView(nodeInstanceView());

    checkForApplicationWindow();

    resetModel();
}
Example #25
0
    UAVSimulation::UAVSimulation(const DUNE::Math::Matrix& vel, const double& bank_time_cst, const double& speed_time_cst):
        //! Simulation type
        m_sim_type("4DOF_bank")
    {
      resetModel();

      //! Vehicle velocity vector
      setVelocity(vel);

      //! Vehicle model parameters
      //! - Bank time constant
      m_bank_time_cst = bank_time_cst;
      m_bank_time_cst_f = true;
      //! - Airspeed time constant
      m_speed_time_cst = speed_time_cst;
      m_speed_time_cst_f = true;
    }
Example #26
0
/* self */
void DocumentPropertiesDialog::setDocument ( DocumentXMLNode *doc )
{
  _document = doc;

  if ( !_document ) {
    // TODO: make dialog disabled
    ui->tabWidget->setEnabled ( false );
    ui->buttonBox->setStandardButtons ( QDialogButtonBox::Close );
    return;
  }

  /* fill dialog */
  /* Encoding */
  QString codec_name = QString::fromLatin1 ( _document->codec()->name() );
  int cb_idx = codecs_for_cb.indexOf ( codec_name );
  ui->comboBoxEncoding->setCurrentIndex ( cb_idx );

  /* Version */
  ui->lineEditVersion->setText ( _document->version() );

  /* Indent */
  ui->checkBoxAutoFormatting->setChecked( _document->autoFormatting() );
  int indent = _document->formattingIndent();
  if ( indent < 0 ) {
    ui->radioButtonTabs->setChecked ( true );
    ui->radioButtonSpaces->setChecked ( false );
    ui->spinBoxNumber->setValue ( -indent );
  }
  else {
    ui->radioButtonTabs->setChecked ( false );
    ui->radioButtonSpaces->setChecked ( true );
    ui->spinBoxNumber->setValue ( indent );
  }

  /* Processing Instructions */
  _pi = _document->processingInstructions();
  resetModel ();
}
Example #27
0
void MainWindow::finishedOpen(void)
{
  progressBar->hide();
  resetModel();
  setEnabled(true);
}
void StatesEditorView::modelAboutToBeDetached(Model *model)
{
    AbstractView::modelAboutToBeDetached(model);
    resetModel();
}
void AttachmentListModel::setMessageId(int id)
{
    m_messageId = QMailMessageId(id);
    m_message = QMailMessage(m_messageId);
    resetModel();
}
void StatesEditorView::nodeOrderChanged(const NodeListProperty &listProperty, const ModelNode & /*movedNode*/, int /*oldIndex*/)
{
    if (listProperty.isValid() && listProperty.parentModelNode().isRootNode() && listProperty.name() == "states")
        resetModel();
}