コード例 #1
0
ファイル: BioRadarModules.cpp プロジェクト: hadzim/fit-mbot
	void BioRadarPositionTask::onDataReady(TBS::Robo::RoboCan::DataMessage & msg) {
		Position p;
		TBS::Robo::RoboCan::RoboCanMessageData::UShort2 val = msg.getData(0).getUSHORT2();
		p.position = val.short1;
		p.isError = val.short2 != 1;
		PositionChanged(this, p);
	}
コード例 #2
0
ファイル: BioRadarModules.cpp プロジェクト: hadzim/fit-mbot
	void BioRadarTouchTask::onDataReady(TBS::Robo::RoboCan::DataMessage & msg) {
		try {
			Positions p;

			TBS::Robo::RoboCan::RoboCanMessageData::UChar4 val = msg.getData(0).getUCHAR4();

			p.p1.touch = val.uchar1 ? true : false;
			p.p2.touch = val.uchar2 ? true : false;
			p.p3.touch = val.uchar3 ? true : false;
			p.p4.touch = val.uchar4 ? true : false;

			p.p1.distance = msg.getData(1).getUSHORT2().short1;
			p.p2.distance = msg.getData(1).getUSHORT2().short2;

			p.p3.distance = msg.getData(2).getUSHORT2().short1;
			p.p4.distance = msg.getData(2).getUSHORT2().short2;

			PositionChanged(this, p);

		} catch (Poco::Exception & e){
			std::cout << "err: " << e.displayText() << std::endl;
		} catch (std::exception & e){
			std::cout << "err: " << e.what() << std::endl;
		} catch (...){
			std::cout << "err: ??" << std::endl;
		}
	}
コード例 #3
0
ファイル: Echo.cpp プロジェクト: kode54/Cog
void Echo::Resume()
{
	m_isResumed = true;
	m_sampleRate = m_SndFile.GetSampleRate();
	RecalculateEchoParams();
	PositionChanged();
}
コード例 #4
0
MusicPlayer::MusicPlayer(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MusicPlayer)
{
    ui->setupUi(this);

    Player = new QMediaPlayer(this);
    PlayList = new QMediaPlaylist;

    connect(Player,SIGNAL(positionChanged(qint64)),this,SLOT(PositionChanged(qint64)));
    connect(ui->LengthSlider,SIGNAL(sliderMoved(int)),this,SLOT(SetPosition(int)));
    connect(Player,SIGNAL(durationChanged(qint64)),this,SLOT(DurationChanged(qint64)));
    connect(Player,SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)),this,SLOT(StatusChanged(QMediaPlayer::MediaStatus)));
    connect(ui->VolumeSlider,SIGNAL(valueChanged(int)),this,SLOT(SetVolume(int)));

    connect(ui->button_start,SIGNAL(released()),this,SLOT(Play()));
    connect(ui->button_stop,SIGNAL(released()),this,SLOT(Stop()));

    connect(ui->button_next,SIGNAL(released()),this,SLOT(Next()));
    connect(ui->button_prev,SIGNAL(released()),this,SLOT(Prev()));

    connect(ui->button_add,SIGNAL(released()),this,SLOT(Add()));
    connect(ui->button_remove,SIGNAL(released()),this,SLOT(Remove()));

    connect(ui->playlist,SIGNAL(doubleClicked(QModelIndex)),this,SLOT(PlaySelected(QModelIndex)));

    connect(ui->actionSave,SIGNAL(triggered()),this,SLOT(SavePlayList()));
    connect(ui->actionLoad,SIGNAL(triggered()),this,SLOT(OpenPlayList()));

    Player->setPlaylist(PlayList);

    ui->VolumeSlider->setRange(0,100);
    ui->VolumeSlider->setValue(100);
}
コード例 #5
0
ファイル: CORNMENT.CPP プロジェクト: jimmccurdy/ArchiveGit
BOOL COrnament::UpdateNeeded(void)
{
	CPropertyState* pState = UpdateState();

	return
		CPropertyObject::UpdateNeeded()
	|| SizeChanged(pState)
	|| PositionChanged(pState);
}
コード例 #6
0
ファイル: scenenode.cpp プロジェクト: xabufr/pixelwars
void SceneNode::SetAbsolutePosition(const sf::Vector2f& pos)
{
    m_relative.position=m_absolute.position=pos;
    if(m_parent)
    {
        m_relative.position.x-=m_parent->m_absolute.position.x;
        m_relative.position.y-=m_parent->m_absolute.position.y;
    }
    PositionChanged();
}
コード例 #7
0
ファイル: scenenode.cpp プロジェクト: xabufr/pixelwars
void SceneNode::SetRelativePosition(const sf::Vector2f& pos)
{
    m_relative.position=pos;
    m_absolute.position=pos;
    if(m_parent)
    {
        sf::Transform trans;
        trans.rotate(m_parent->m_absolute.rotation);
        m_absolute.position.x=m_parent->m_absolute.position.x+trans.transformPoint(m_relative.position).x;
        m_absolute.position.y=m_parent->m_absolute.position.y+trans.transformPoint(m_relative.position).y;
    }
    PositionChanged();
}
コード例 #8
0
ファイル: tProgressBar.cpp プロジェクト: dulton/53_hero
void tProgressBar::mousePressEvent( QMouseEvent* pEvent )
{
    if( pEvent->button() == Qt::LeftButton )
    {
        QPoint p = pEvent->pos();
        float ratio = p.x() / (float)width();

        m_Scrubbing = true;

        emit PositionChanged( ratio );
    }
    else
    {
        QWidget::mousePressEvent( pEvent );
    }
}
コード例 #9
0
ファイル: tProgressBar.cpp プロジェクト: dulton/53_hero
void tProgressBar::mouseMoveEvent( QMouseEvent* pEvent )
{
    if( pEvent->buttons() == Qt::LeftButton ) // check buttons(), not button()
    {
        if( m_Scrubbing == false )
            return;

        QPoint p = pEvent->pos();
        float ratio = p.x() / (float)width();

        emit PositionChanged( ratio );
    }
    else
    {
        QWidget::mouseMoveEvent( pEvent );
    }
}
コード例 #10
0
void
TransportControlGroup::_UpdatePosition()
{
	if (fSeekSlider != NULL)
		PositionChanged(fSeekSlider->Value());
}
コード例 #11
0
// -----------------------------------------------------------------------------
// CTestTitlePane::DoPositionChanged
// -----------------------------------------------------------------------------
//
void CTestTitlePane::DoPositionChanged() 
    {
    PositionChanged();
    }
コード例 #12
0
void RoadPositionSystem::Update(float dt) {
    for(auto o : Objects()) {
        PositionChanged(o);
    }
}
コード例 #13
0
DataSetValuesView::DataSetValuesView(DataSetValues* dsv) : WorkspaceDockWidget(dsv,dsv->GetName()), m_bufferValues(dsv), m_loading(false)
{
   setAcceptDrops(true);

   SetupKeyboardShortcuts();

   m_table = new QTableView();
   m_tableModel = new DataSetValuesViewTableModel(dsv);
   m_table->setModel(m_tableModel);
   m_table->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

   m_scroll = new BigScrollbar(this, Qt::Vertical);

   QFont fixedFont("Monospace");
   fixedFont.setStyleHint(QFont::TypeWriter);
   m_table->setFont(fixedFont);

   m_valueColumns = new QComboBox();
   for (int i = 1; i <=16; ++i)
   {
      m_valueColumns->addItem(QString::number(i),i);
   }

   m_valueFormat = new QComboBox();
   m_valueFormat->addItem(tr("Value"),DataSetValues::DISPLAY_FORMAT_VALUE);
   m_valueFormat->addItem(tr("Hex"),DataSetValues::DISPLAY_FORMAT_HEX);
   m_valueFormat->addItem(tr("Octal"),DataSetValues::DISPLAY_FORMAT_OCT);

   m_valueDataType = new QComboBox();
   m_valueDataType->addItem(tr("uint8"),TERBIT_UINT8);
   m_valueDataType->addItem(tr("uint16"),TERBIT_UINT16);
   m_valueDataType->addItem(tr("uint32"),TERBIT_UINT32);
   m_valueDataType->addItem(tr("uint64"),TERBIT_UINT64);
   m_valueDataType->addItem(tr("int8"),TERBIT_INT8);
   m_valueDataType->addItem(tr("int16"),TERBIT_INT16);
   m_valueDataType->addItem(tr("int32"),TERBIT_INT32);
   m_valueDataType->addItem(tr("int64"),TERBIT_INT64);
   m_valueDataType->addItem(tr("float"),TERBIT_FLOAT);
   m_valueDataType->addItem(tr("double"),TERBIT_DOUBLE);

   m_indexFormat = new QComboBox();
   m_indexFormat->addItem(tr("Value"),DataSetValues::DISPLAY_FORMAT_VALUE);
   m_indexFormat->addItem(tr("Hex"),DataSetValues::DISPLAY_FORMAT_HEX);
   m_indexFormat->addItem(tr("Octal"),DataSetValues::DISPLAY_FORMAT_OCT);

   m_gotoIndex = new QLineEdit();

   m_refresh = new QPushButton(tr("Refresh"));

   QVBoxLayout* l = new QVBoxLayout();

   QHBoxLayout* settingsLayout = new QHBoxLayout();
   settingsLayout->addWidget(new QLabel(tr("Index")));
   settingsLayout->addWidget(new QLabel(tr("Format")));
   settingsLayout->addWidget(m_indexFormat);
   settingsLayout->addWidget(m_gotoIndex);
   QPushButton* btnGotoAddress = new QPushButton(tr("Go To"));
   settingsLayout->addWidget(btnGotoAddress);
   settingsLayout->addStretch();
   l->addLayout(settingsLayout);

   settingsLayout = new QHBoxLayout();
   settingsLayout->addWidget(new QLabel(tr("Data Type")));
   settingsLayout->addWidget(m_valueDataType);
   settingsLayout->addStretch();
   l->addLayout(settingsLayout);

   settingsLayout = new QHBoxLayout();
   settingsLayout->addWidget(new QLabel(tr("Format")));
   settingsLayout->addWidget(m_valueFormat);
   settingsLayout->addWidget(new QLabel(tr("Columns")));
   settingsLayout->addWidget(m_valueColumns);
   settingsLayout->addStretch();
   settingsLayout->addWidget(m_refresh);
   l->addLayout(settingsLayout);

   settingsLayout = new QHBoxLayout();
   settingsLayout->setSpacing(2);
   settingsLayout->setMargin(0);
   settingsLayout->addWidget(m_table,1);
   settingsLayout->addWidget(m_scroll,0);
   l->addLayout(settingsLayout);

   QWidget* wrapper = new QWidget();
   wrapper->setLayout(l);
   setWidget(wrapper); //must use wrapper widget for dockwidget stuffs

   //listen for gui events
   connect(m_valueDataType,SIGNAL(currentIndexChanged(int)), this, SLOT(OnDataTypeChanged(int)));
   connect(m_valueFormat,SIGNAL(currentIndexChanged(int)), this, SLOT(OnFormatChanged(int)));
   connect(m_valueColumns,SIGNAL(currentIndexChanged(int)), this, SLOT(OnColumnsChanged(int)));
   connect(m_indexFormat,SIGNAL(currentIndexChanged(int)), this, SLOT(OnIndexFormatChanged(int)));
   connect(btnGotoAddress,SIGNAL(clicked()),this,SLOT(GotoIndex()));
   connect(m_refresh,SIGNAL(clicked()),this,SLOT(OnRefreshData()));
   connect(m_scroll,SIGNAL(PositionChanged()),this,SLOT(OnTableScrolled()));

   //listen for model events
   connect(m_bufferValues,SIGNAL(ModelNewData()),this, SLOT(OnModelNewData()));
   connect(m_bufferValues,SIGNAL(ModelStructureChanged()), this, SLOT(OnModelStructureChanged()));
   connect(m_bufferValues,SIGNAL(NameChanged(DataClass*)),this, SLOT(OnModelNameChanged(DataClass*)));

   //get gui in sync with settings . . . simulate structure change
   OnModelStructureChanged();
   m_table->horizontalHeader()->resizeSections(QHeaderView::Stretch);
}
コード例 #14
0
LPVOID BackgroundPainter::AddPane(const IPane *pane) {
  PerPaneData *data = new PerPaneData();
  data->stateData.resize(mStateCount);
  PositionChanged(pane, data, pane->GetRenderingPosition(), true, true);
  return data;
}
コード例 #15
0
ファイル: LayerSurface.cpp プロジェクト: CBoensel/freesurfer
LayerSurface::LayerSurface( LayerMRI* ref, QObject* parent ) : LayerEditable( parent ),
  m_surfaceSource( NULL ),
  m_bResampleToRAS( true ),
  m_volumeRef( ref ),
  m_nActiveOverlay( -1 ),
  m_nActiveAnnotation( -1 ),
  m_nActiveLabel( -1 ),
  m_bUndoable( false ),
  m_bVector2DPendingUpdate( true ),
  m_bLoadAll(false)
{
  m_strTypeNames.push_back( "Surface" );

  // create property before actors!
  mProperty = new LayerPropertySurface( this );

  for ( int i = 0; i < 3; i++ )
  {
    // m_nSliceNumber[i] = 0;
    m_sliceActor2D[i] = vtkActor::New();
    m_sliceActor3D[i] = vtkActor::New();
    m_vectorActor2D[i] = vtkActor::New();
  }

// m_mainActor = vtkLODActor::New();
  m_mainActor = vtkSmartPointer<vtkActor>::New();
  m_mainActor->GetProperty()->SetEdgeColor( 0.75, 0.75, 0.75 );
  mLowResFilter = vtkSmartPointer<vtkDecimatePro>::New();
  mLowResFilter->SetTargetReduction( 0.9 );
// mMediumResFilter = vtkSmartPointer<vtkDecimatePro>::New();
// mMediumResFilter->SetTargetReduction( 0.9 );

  m_vectorActor = vtkSmartPointer<vtkActor>::New();
  m_vectorActor->GetProperty()->SetColor( GetProperty()->GetVectorColor() );
  m_vectorActor->GetProperty()->SetPointSize( GetProperty()->GetVectorPointSize() );
  m_vectorActor->PickableOff();

  for ( int i = 0; i < 3; i++ )
  {
    m_vectorActor2D[i]->GetProperty()->SetColor( GetProperty()->GetVectorColor() );
    m_vectorActor2D[i]->GetProperty()->SetPointSize( GetProperty()->GetVectorPointSize() );
    m_vectorActor2D[i]->PickableOff();
  }

  m_vertexActor = vtkSmartPointer<vtkActor>::New();
  m_vertexActor->GetProperty()->SetRepresentationToPoints();
  m_vertexActor->VisibilityOff();

  m_wireframeActor = vtkSmartPointer<vtkActor>::New();
  m_wireframeActor->VisibilityOff();

  LayerPropertySurface* p = GetProperty();
  connect( p, SIGNAL(ColorMapChanged()), this, SLOT(UpdateColorMap()) ),
           connect( p, SIGNAL(OpacityChanged(double)), this, SLOT(UpdateOpacity()) );
  connect( p, SIGNAL(EdgeThicknessChanged(int)), this, SLOT(UpdateEdgeThickness()) );
  connect( p, SIGNAL(VectorPointSizeChanged(int)), this, SLOT(UpdateVectorPointSize()) );
  connect( p, SIGNAL(RenderModeChanged(int)), this, SLOT(UpdateRenderMode()) );
  connect( p, SIGNAL(VertexRenderChanged()), this, SLOT(UpdateVertexRender()) );
  connect( p, SIGNAL(MeshRenderChanged()), this, SLOT(UpdateMeshRender()) );
  connect( p, SIGNAL(PositionChanged()), this, SLOT(UpdateActorPositions()) );
}