void core::DatabaseMapperDialog::init(const QSqlDatabase &db)
{

	_loMain = new QVBoxLayout();

	_lcbTables = new LabeledComboBox(tr("Tables"));

	tblMapView = new QTableWidget(1, 4);

	tblMapView->verticalHeader()->setVisible(false);


	if(db.isOpen()){
		_lcbTables->getComboBox()->addItems(db.tables(QSql::Tables));
		_lcbTables->getComboBox()->addItems(db.tables(QSql::Views));
	}

	_loMain->addWidget(_lcbTables);
	_loMain->addWidget(tblMapView);

	getMainToolbar()->addAction(ICON_UPDATE, tr("Update"), this, SLOT(updateConnection()));

	getMainMenuBar()->setVisible(false);
	setApplyButtonVisible(false);

	getMainWindow()->centralWidget()->setLayout(_loMain);

	_db = db;

	connect(_lcbTables->getComboBox(), &QComboBox::currentTextChanged, [=](const QString &text){
		fillTable(text);
	});

	fillTable(_lcbTables->getComboBox()->currentText());
}
void ddLineConnection::basicMoveBy(int x, int y){
	/*ddPoint *newPoint;
	for(int i=1 ; i<points->count()-1 ; i++){
		newPoint = (ddPoint *) points->getItemAt(i);  //DD-TODO: replace and test with pointAt
		newPoint->x += x;
		newPoint->y += y;
		points->replaceAtIndex((ddObject *) newPoint,i); //DD-TODO: this is neede because I'm working with pointers??
	}*/
	ddPolyLineFigure::basicMoveBy(x,y);
	updateConnection();
}
示例#3
0
	void settings::port(const unsigned int v) {

		{

			boost::lock_guard<boost::mutex> guard(portMutex_);

			port_ = v;

		}

		updateConnection();						// update the connection

	}
示例#4
0
	void settings::dataBase(const std::string & s) {

		{
			
			boost::lock_guard<boost::mutex> guard(dataBaseMutex_);

			dataBase_ = s;
				
		}
		
		updateConnection();						// update the connection

	}
示例#5
0
	void settings::password(const std::string & s) {

		{

			boost::lock_guard<boost::mutex> guard(passwordMutex_);

			password_ = s; 
			
		}

		updateConnection();						// update the connection

	}
示例#6
0
	void settings::user(const std::string & s) {

		{

			boost::lock_guard<boost::mutex> guard(userMutex_);

			user_ = s;

		}

		updateConnection();						// update the connection

	}
CVisSystemCanvasConnectionItem::CVisSystemCanvasConnectionItem(IVisNetworkConnection* con, CVisSystemCanvas* canvas)
:QGraphicsItem(0, canvas->scene())
{
    d = new CVisSystemCanvasConnectionItemData;
    d->canvas = canvas;
    d->connection = con;

    IVisSystemNodeIOData* ioData = d->connection->connectionData();
    bool success = ioData && ioData->queryInterface("IContainer", (void**)(&d->connectionContainer));
    if( success )
    {
        QObject* conObj = d->connectionContainer->containerObject();
        d->connectionConfigurable = qobject_cast<IConfigurable*>(conObj);
    }

    setZValue(2.0f);
    setFlags(ItemIsSelectable|ItemIsFocusable);
    updateConnection();
}
示例#8
0
//--------------------------------------------------------------
void testApp::update(){
    
    
    /*------------------- WI-FLY ------------------*/
    updateConnection();
    /*---------------------------------------------*/
    
    
    /*------------------- SOUND -------------------*/
    float avg_power = 0.0f;
	myfft.powerSpectrum(0,(int)BUFFER_SIZE/2, left,BUFFER_SIZE,&magnitude[0],&phase[0],&power[0],&avg_power);
	for (int i = 0; i < (int)(BUFFER_SIZE/2); i++){
		freq[i] = magnitude[i];
//        cout << freq[i] << endl;
	}
	FFTanalyzer.calculate(freq);

    /*---------------------------------------------*/

    
    //BACKGROUND
    ofPoint currAverageAccel2 = average(accel2);
	for (int i=0; i < myTiles.size(); i++) {
		myTiles[i].update(tileGUImode, selectedTileMode, mouseX, mouseY, freq, threshold, hue, currAverageAccel2, lastAverageAccel2);
	}
    lastAverageAccel2 = currAverageAccel2;
    
    //VIDEO
    fogMovie.update();
    
    // PARTICLES
    ofPoint currAverageAccel1 = average(accel1);
    for(int i=0; i < myParticles.size(); i++){
        
        myParticles[i].update(particleGUImode, selectedMode, selectedShape, expansion, shapeSize, nVertices, particleSize, rotation, currAverageAccel1, lastAverageAccel1);
    }
    lastAverageAccel1 = currAverageAccel1;
}
void hdLineConnection::onFigureChanged(int posIdx, hdIFigure *figure)
{
	updateConnection(posIdx);
}
示例#10
0
void hdLineConnection::setPointAt (int posIdx, int index, int x, int y)
{
	hdPolyLineFigure::setPointAt(posIdx, index, x, y);
	updateConnection(posIdx);
}
示例#11
0
void hdLineConnection::basicMoveBy(int posIdx, int x, int y)
{
	hdPolyLineFigure::basicMoveBy(posIdx, x, y);
	updateConnection(posIdx);
}
//DD-TODO: HIGH-PRIORITY-FINISH-THIS observer pattern
void ddLineConnection::onFigureChanged(ddIFigure *figure)
{
//		ddIConnectionFigure::onFigureChanged(figure);
		//BUGSISIMO  ver si debe ir aqui pq da un super error 
	updateConnection();
}
void ddLineConnection::setPointAt (int index, int x, int y)
{
	ddPolyLineFigure::setPointAt(index,x,y);
	updateConnection();
}
示例#14
0
void boundaryArea::divide( int targetPartIndex, int firstCurveIndex, int firstPointIndex, int lastCurveIndex, int lastPointIndex )
{
	//分割するパートを保存して削除
	boundaryPart bporiginal = parts[targetPartIndex];
	parts.pop( parts[targetPartIndex] );
	//分割後のパートを作成.First Point->Last Pointの順に切って,リストを時計回りで持つ物をbpFL,逆にきる物をbpLFとする.
	boundaryPart & bpFL = parts.push_back( boundaryPart::factory() );
	boundaryPart & bpLF = parts.push_back( boundaryPart::factory() );
	//余計な情報をクリアする
	bpFL.resetConnection();
	bpLF.resetConnection();
	//周囲のカーブを分割
	bool interest1 = true;
	//分割用のカーブ
	boundaryPoint & bpfirst = divisions[firstCurveIndex].points[firstPointIndex];//最初の点
	boundaryPoint & bplast = divisions[lastCurveIndex].points[lastPointIndex];//最後の点
	boundaryCurve & divider = divisions.push_back( boundaryCurve() );//分割線
	divider.setAsDivider( bpfirst, bplast );
	int dividerCurveIndex = divisions.size - 1;//分割線のカーブリストのインデックス
	//分割点があるカーブの境界線リストでのインデックス
	int startingIndex = bporiginal.find( firstCurveIndex, firstPointIndex );
	int endingIndex = bporiginal.find( lastCurveIndex, lastPointIndex );
	boundaryCurveIndex * bci = NULL;
	//first->lastの分割線を通った後,残りを探す
	for ( int i = endingIndex; i <= endingIndex + bporiginal.curves.size; ++i ) {
		int clampedIndex = i % bporiginal.curves.size;//範囲外をクランプ
		if ( i == endingIndex ) {//最初だけの処理
			//分割線を追加
			bci = & bpFL.curves.push_back( boundaryCurveIndex() );
			bci->curve = dividerCurveIndex;
			bci->start = 0;
			bci->end = 2;
			bci->size = 2;
		}
		//通常の部分を追加
		bci = & bpFL.curves.push_back( bporiginal.curves[clampedIndex] );
		if ( i == endingIndex ) {//最初
			//最初のカーブは初期値を切った位置に合わせる
			bci->start = lastPointIndex;
			//一つの境界線上で最初と最後があるとき
			if ( i == startingIndex ) {
				//その線が初期の分割されていない周りの線の場合か
				if ( ( bporiginal.curves[clampedIndex].whole() && bci->curve == 0 ) ||
					//残りの線上に最初の分割点がある場合には
					bci->include( firstPointIndex ) ) {//これで終わり
					bci->end = firstPointIndex;
					break;
				}
			}
		} else if ( clampedIndex == startingIndex ) {//一周して戻ってきた
			bci->end = firstPointIndex;
			break;
		}
	}
	bpFL.clean();
	//last->firstの分割線を通った後,残りを探す
	for ( int i = startingIndex; i <= startingIndex + bporiginal.curves.size; ++i ) {
		int clampedIndex = i % bporiginal.curves.size;
		if ( i == startingIndex ) {
			//分割線
			bci = & bpLF.curves.push_back( boundaryCurveIndex() );
			bci->curve = dividerCurveIndex;
			bci->start = 2;
			bci->end = 0;
			bci->size = 2;
		}
		//通常の部分
		bci = & bpLF.curves.push_back( bporiginal.curves[clampedIndex] );
		if ( i == startingIndex ) {//最初
			bci->start = firstPointIndex;
			if ( i == endingIndex ) {
				if ( ( bporiginal.curves[clampedIndex].whole() && bci->curve == 0 ) ||
					bci->include( firstPointIndex ) ) {//これで終わり
					bci->end = lastPointIndex;
					break;
				}
			}
		} else if ( clampedIndex == endingIndex ) {//一周して戻ってきた
			bci->end = lastPointIndex;
			break;
		}
	}
	bpLF.clean();
	updateConnection();
}