void LofarBeam::_setupConnections() { // setup all the relationships between parameters connect( _array.get(), SIGNAL( updatedSelection() ), this, SLOT( refreshFilter() ) ); connect( _array.get(), SIGNAL( updatedSelection() ), this, SLOT( refreshRCU() ) ); connect( _array.get(), SIGNAL( updatedSelection() ), this, SLOT( refreshFrequency() ) ); connect( _lofar->clockSpeeds().get(), SIGNAL( updatedSelection() ), this, SLOT( clockUpdated() ) ); connect( _frequency.get(), SIGNAL( updatedSelection() ), this, SLOT( frequencyUpdate() ) ); connect( _bandwidth.get(), SIGNAL( updatedSelection() ), this, SLOT( bandwidthUpdate() ) ); connect( _subbands.get(), SIGNAL( updatedSelection() ), this, SLOT( subbandUpdate() ) ); connect( _directionType.get(), SIGNAL( updatedSelection() ), this, SLOT( updateDirection()) ); connect( _directionX.get(), SIGNAL( updatedSelection() ), this, SLOT( updateDirection()) ); connect( _directionY.get(), SIGNAL( updatedSelection() ), this, SLOT( updateDirection()) ); //connect( _filter.get(), SIGNAL( updatedSelection() ), // this, SLOT( frequencyUpdate() ) ); }
void CSMWorld::IdTableProxyModel::sourceRowsInserted(const QModelIndex &parent, int /*start*/, int end) { refreshFilter(); if (!parent.isValid()) { emit rowAdded(getRecordId(end).toUtf8().constData()); } }
void CSMWorld::InfoTableProxyModel::sourceRowsInserted(const QModelIndex &parent, int /*start*/, int end) { refreshFilter(); if (!parent.isValid()) { mFirstRowCache.clear(); // We can't re-sort the model here, because the topic of the added row isn't set yet. // Store the row index for using in the first dataChanged() after this row insertion. mLastAddedSourceRow = end; } }
void CSMWorld::InfoTableProxyModel::sourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) { refreshFilter(); if (mLastAddedSourceRow != -1 && topLeft.row() <= mLastAddedSourceRow && bottomRight.row() >= mLastAddedSourceRow) { // Now the topic of the last added row is set, // so we can re-sort the model to ensure the corrent position of this row int column = sortColumn(); Qt::SortOrder order = sortOrder(); sort(mInfoColumnIndex); // Restore the correct position of an added row sort(column, order); // Restore the original sort order emit rowAdded(getRecordId(mLastAddedSourceRow).toUtf8().constData()); // Make sure that we perform a re-sorting only in the first dataChanged() after a row insertion mLastAddedSourceRow = -1; } }
void CSMWorld::InfoTableProxyModel::sourceRowsRemoved(const QModelIndex &/*parent*/, int /*start*/, int /*end*/) { refreshFilter(); mFirstRowCache.clear(); }
void CSMWorld::IdTableProxyModel::sourceDataChanged(const QModelIndex &/*topLeft*/, const QModelIndex &/*bottomRight*/) { refreshFilter(); }
void CSMWorld::IdTableProxyModel::sourceRowsRemoved(const QModelIndex &/*parent*/, int /*start*/, int /*end*/) { refreshFilter(); }
/** * @details Constructs a LofarBeam object. */ LofarBeam::LofarBeam( Lofar* lofar ) : State(true), _lofar(lofar), _localUpdate(false) { // construct parameters //_streams.reset(new MultiRangeParameter<unsigned int>( // "streams(beamlets)", // "the output channels to map the subbands to. Max of 64 per beam is allowed") ); //_streams.setRange( Range<unsigned int>(0,247) ); _array.reset(new SelectionParameter<RCU::Array>( "Antenna Array", "Defines the Antenna array to use in this beam" ) ); QList<QString> arrayDesc; arrayDesc << "Low Band" << "High Band"; QList<RCU::Array> arrayValues; arrayValues << RCU::LB << RCU::HB; _array->setAllowableValues( arrayDesc, arrayValues); _filter.reset( new SelectionParameter<RCU_Filter>( "RCU Filter", "The filter to apply to the RCU chain") ); _ids.reset( new MultiRangeParameter<unsigned int>( "rcu id", "The ids of all rcu's to be included in the beam") ); _frequency.reset( new SingleParameter<float>( "frequency", "The frequency range to observe" ) ); _bandwidth.reset( new SingleParameter<float>( "bandwidth", "The width of the frequecy band to observe" " relative to the start frequency" ) ); _subbands.reset( new MultiRangeParameter<unsigned int>( "subbands", "The subband identifiers associated with the frequen") ); _directionType.reset( new SelectionParameter<QString>( "direction", "The type " "of direction input. " "SKYSCAN will scan the sky with a L x M grid in " "the (l,m) plane") ); _directionType->setAllowableValues( _direction.types(), _direction.types() ); _directionType->set(_direction.types()[0]); _directionX.reset( new SingleParameter<float>("x", "The longitude in degrees for direction specification" ) ); _directionX->setRange( Range<float>(-180,180) ); _directionY.reset( new SingleParameter<float>("y", "The latitude in degrees for direction specification" ) ); _directionY->setRange( Range<float>(-90.0,90.0) ); updateDirection(); // set default values (pre-connection) _frequency->set(0.0); _bandwidth->set(0.0); _setupConnections(); // set default values _array->set(RCU::LB); refreshFilter(); _filter->set(RCU_Filter()); _ids->set( _lofar->rcuIds( _array->value()) ); _subbands->set( _lofar->subbandRanges() ); _subbands->setAllowableValues( _lofar->subbandRanges() ); _directionX->set(0.0); _directionY->set(0.0); refreshFrequency(); refreshRCU(); // set up the RCU group ParameterGroup g("RCU Selection"); g.addParameter( _array ); g.addParameter( _filter ); g.addParameter( _ids ); // set up the frequency group ParameterGroup f("Frequency"); f.addParameter( _frequency ); f.addParameter( _bandwidth ); f.addParameter( _subbands ); // set up the direction group ParameterGroup d("Direction"); d.addParameter( _directionType ); d.addParameter( _directionX ); d.addParameter( _directionY ); appendGroup( g ); appendGroup( f ); appendGroup( d ); }