コード例 #1
0
void FrameCreateEditBorrowerApp::btnOKBorrowerClicked(wxCommandEvent & event)
{
    string name = txt_name->GetValue().ToStdString();
    showError(strcmp(name.c_str(), "") != 0, lbl_error_name, "Please enter the borrower name!");

    int borrower_type = choice_borrower_type->GetSelection();
    showError(borrower_type != 0, lbl_error_borrower_type, "Please choose a borrower type!");

    int department = choice_department->GetSelection();
    showError(department != 0, lbl_error_department, "Please choose a department!");

    string mobile = txt_mobile_number->GetValue().ToStdString();
    showError(strcmp(mobile.c_str(), "") != 0, lbl_error_mobile, "Please enter a mobile number!");

    if (b == NULL)
    {
        if (strcmp(name.c_str(), "") != 0 && borrower_type != 0 && department != 0 && strcmp(mobile.c_str(), "") != 0)
        {
            l->addBorrower(name, borrower_type, department, mobile);
            switchFrame(this, previous_frame);
        }
    }

    else
    {
        string items_borrowed = txt_items_borrowed->GetValue().ToStdString();
        showError(strcmp(items_borrowed.c_str(), "") != 0, lbl_error_items_borrowed, "Please enter the number of items borrowed!");

        string items_late = txt_items_late->GetValue().ToStdString();
        showError(strcmp(items_late.c_str(), "") != 0, lbl_error_items_late, "Please enter the number of items returned late!");

        if (strcmp(items_late.c_str(), "") != 0 && strcmp(items_borrowed.c_str(), "") != 0)
        {
            istringstream iss_borrow(items_borrowed);
            int items_borrowed_num;
            iss_borrow >> items_borrowed_num;

            istringstream iss_late(items_late);
            int items_late_num;
            iss_late >> items_late_num;

            l->editBorrower(b, name, borrower_type, department, mobile, items_borrowed_num, items_late_num);

            switchFrame(this, previous_frame);
        }
    }
コード例 #2
0
void FrameChangeItemStatusApp::btnConfirmChangeClicked(wxCommandEvent & event)
{
    Instance * in = NULL;
    showError(search_choice != 0, lbl_error_change_item, "Please enter the item barcode or the collection title or the collection author!");

    if (search_choice != 0)
    {
        if (search_choice == 1)
        {
            string barcode_string = txt_item_barcode_change->GetValue().ToStdString();
            int barcode;
            istringstream iss_barcode(barcode_string);
            iss_barcode >> barcode;

            bool valid = false;
            for (unsigned int i = 0; i < l->instances->size(); ++i)
            {
                in = l->instances->at(i);
                if (* in == barcode)
                {
                    valid = true;
                    break;
                }
            }
            string error_string = "Cannot find an item with barcode ";
            error_string.append(barcode_string);
            error_string.append("!");
            showError(valid, lbl_error_item_barcode_change, error_string);

            if (valid)
            {
                FrameCreateEditInstanceApp * fceia = new FrameCreateEditInstanceApp(GetParent(), l, NULL, barcode, this);
                switchFrame(this, fceia);
            }
        }

        else
        {
コード例 #3
0
void FrameCreateEditCollectionApp::btnBackCreateCollectionClicked(wxCommandEvent & event)
{
    switchFrame(this, previous_frame);
}
コード例 #4
0
void FrameCreateEditCollectionApp::btnHomeCreateCollectionClicked(wxCommandEvent & event)
{
    switchFrame(this, GetParent());
}
コード例 #5
0
void FrameCreateEditBorrowerApp::btnHomeCreateBorrowerClicked(wxCommandEvent & event)
{
    switchFrame(this, GetParent());
}
コード例 #6
0
void FrameCreateEditBorrowerApp::btnBackCreateBorrowerClicked(wxCommandEvent & event)
{
    switchFrame(this, previous_frame);
}
コード例 #7
0
void FrameDownloadApp::btnBackClicked(wxCommandEvent & event)
{
    switchFrame(this, GetParent());
}
コード例 #8
0
Worker::Worker(RoboCompArmrocio::ArmrocioPrx armrocioprx, RoboCompCamera::CameraPrx cameraprx, RoboCompDifferentialRobot::DifferentialRobotPrx differentialrobotprx, RoboCompSpeech::SpeechPrx speechprx, QObject* parent) : Ui_MainWindow()
{
	armrocio = armrocioprx;
	camera = cameraprx;
	differentialrobot = differentialrobotprx;
	speech = speechprx;
	
	//hilo
	capturador = new MiQThread (this);
	
	proccesRecWin = NULL;
	proccesWinfo = NULL;
				
 	setupUi(this);	
	this->setWindowTitle("RobEx");
	juegosLW->item(0)->setSelected(true);
	dlg.resize(800,600);
	dlg.setWindowTitle("Proyector");
	pbRec->hide();
	
	
// 	connect(&timer, SIGNAL(timeout()), this, SLOT(compute()));
	connect (speechPB,SIGNAL(clicked()),this,SLOT(habla()));
	connect(openVidPB, SIGNAL(clicked()), this, SLOT(changeDirectory()));
	connect(openTextPB, SIGNAL(clicked()), this, SLOT(changeSentences()));
	connect (phrasesLW,SIGNAL(itemClicked(QListWidgetItem*)),this,SLOT(toTextEdit(QListWidgetItem*)));
	connect (juegosLW,SIGNAL(itemClicked(QListWidgetItem*)),this,SLOT(loadGame(QListWidgetItem*)));	
	connect (videosLW,SIGNAL(itemClicked(QListWidgetItem*)),this,SLOT(loadVideo(QListWidgetItem*)));
	connect (pbRec,SIGNAL (pressed()), this, SLOT (recProyector()) );
	
// 	timer.start(BASIC_PERIOD);
	
	QIcon openIcon = style()->standardIcon(QStyle::SP_DialogOpenButton);
	openVidPB->setIcon(openIcon);
	openTextPB->setIcon(openIcon);

	QIcon playIcon = style()->standardIcon(QStyle::SP_MediaPlay);
	playPB->setIcon(playIcon);
	QIcon stopIcon = style()->standardIcon(QStyle::SP_MediaStop);
	stopPB->setIcon(stopIcon);
	
	
	 QStringList filters;
	filters << "*.avi" << "*.mpg"<<"*.wav"<<"*.ogg"<<"*.mov";
	videosDir.setNameFilters(filters);
	videosDir.setFilter(QDir::Files);
	
	hLayout = new QHBoxLayout(&dlg);	
	vLayout = new QVBoxLayout();	 

	videoPlayer2 = new Phonon::VideoPlayer(&dlg);
 	videoPlayer2->hide();
	vLayout->addWidget(videoPlayer2);

	///qframe con el video del camara para la interaccion con osgART	
	frameDlg= new QFrame ();
	frameDlg->setMinimumSize(800,600);
	frameDlg->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);

	vLayout->addWidget(frameDlg);	
	hLayout->addLayout(vLayout);
	
	osgArt = new OsgArt(camera, frameDlg);    	
	q = new QImage (frame->size(),QImage::Format_RGB32 );
	miVisor = new qWorld (q,frame);
	dlg.show();
	show();
	
	switchState = false;
	switchPB->setText("Change to video");
	
	connect(playPB, SIGNAL(clicked()), videoPlayer, SLOT(play()));
	connect(switchPB, SIGNAL(clicked()), this, SLOT(switchFrame()));
	connect(playPB, SIGNAL(clicked()), videoPlayer2, SLOT(play()));
	connect(stopPB, SIGNAL(clicked()), videoPlayer2, SLOT(stop()));
 	connect( &dlg, SIGNAL (resizeMiQDialog()), osgArt, SLOT (resizeOsgArt()));
	connect( &dlg, SIGNAL (killMiQDialog()), osgArt, SLOT (closeOsgArt()));
	connect( osgArt, SIGNAL (signalSpeechConseguido()), this, SLOT (speechConseguido()) );
	connect( &dlg, SIGNAL (killMiQDialog()), this, SLOT (close()));
	connect(rbHola, SIGNAL (clicked()),this, SLOT (armHola()) );
	connect (rbAdios, SIGNAL (clicked()),this, SLOT (armAdios()) );
	// 	connect (videoPlayer->mediaObject(),SIGNAL (tick(qint64) ),this,SLOT (miSeek(qint64)) );
	// 	syncAdjust=0;
	
	//fichero de frases por defecto
	sentencesFile.setFileName("data/frasesBrazo.txt");
	this->fillSentenceList();
	
 	connect(&timer, SIGNAL(timeout()), this, SLOT(compute()));
//  	connect(&timer, SIGNAL(timeout()), this, SLOT(iniThread()));

	
 	timer.start(BASIC_PERIOD);
	
		
}