Example #1
0
void Reportes::setDatosGraficoMuestras(QVector<Muestra*> listaMuestras)
{
    const int size=listaMuestras.size();
    QVector<double> tiempo(size);
    QVector<double> AcX(size);
    QVector<double> AcY(size);
    QVector<double> AcZ(size);
    QVector<double> GyX(size);
    QVector<double> GyY(size);
    QVector<double> GyZ(size);
    for (int var = 0; var < size; ++var) {
        Muestra *muestra=listaMuestras.at(var);
        tiempo[var]=muestra->getTiempo();
        AcX[var]=muestra->getAcX();
        AcY[var]=muestra->getAcY();
        AcZ[var]=muestra->getAcZ();
        GyX[var]=muestra->getGyX();
        GyY[var]=muestra->getGyY();
        GyZ[var]=muestra->getGyZ();
    }
    this->vaciarGraficoMuestras();
    graficoAcX->setData(tiempo,AcX);
    graficoAcY->setData(tiempo,AcY);
    graficoAcZ->setData(tiempo,AcZ);
    graficoGyX->setData(tiempo,GyX);
    graficoGyY->setData(tiempo,GyY);
    graficoGyZ->setData(tiempo,GyZ);
    this->replotGraficoMuestras();
}
Example #2
0
void Reportes::setDatosGraficosDezplazamientos(QVector<Desplazamiento*> listaDesplazamientos)
{
    const int size=listaDesplazamientos.size();
    QVector<double> tiempo(size);
    QVector<double> despProX(size);
    QVector<double> despProY(size);
    QVector<double> despReCurX(size);
    QVector<double> despReCurY(size);
    for (int var = 0; var < size; ++var) {
        Desplazamiento *desp=listaDesplazamientos.at(var);
        tiempo[var]=desp->getTiempo();
        despProX[var]=desp->getDesplazamientoProyeccion().Desplazamiento1;
        despProY[var]=desp->getDesplazamientoProyeccion().Desplazamiento2;
        despReCurX[var]=desp->getDesplazamientoRecorridoCurvo().Desplazamiento1;
        despReCurY[var]=desp->getDesplazamientoRecorridoCurvo().Desplazamiento2;
    }

    this->vaciarGraficosDesplazamientoProyeccion();
    this->vaciarGraficosDesplazamientoRecorridoCurvo();
    graficoDesplazamientoProX->setData(tiempo,despProX);
    graficoDesplazamientoProY->setData(tiempo,despProY);
    graficoDesplazamientoReCurX->setData(tiempo,despReCurX);
    graficoDesplazamientoReCurY->setData(tiempo,despReCurY);
    this->replotGraficoDesplazamientoProyeccion();
    this->replotGraficoDesplazamientoRecorridoCurvo();
}
void Imprimir_graficos::calccpm() {
    QTime tiempo(0, 0, 0, 0);
    int t = 0;
    tiempo.start();
    // Llamar al algoritmo cpm
    g->cpm();
    t = tiempo.elapsed();
    ui->algasg->setText(QString::number(g->asgs));
    ui->algcmp->setText(QString::number(g->asgs));
    ui->alglns->setText(QString::number(g->lns));
    ui->algtmp->setText(QString::number(t) + " ms.");
}
Example #4
0
int main(){
    initscr();
    curs_set(0);
    keypad(stdscr, 1);
    noecho();

    while (fin_juego()){
    laberinto();
    move(5,58); printw("   Encuentra");
    move(6,58); printw("    los 15");
    move(7,58); printw("quesos en 1:30.");
    move(yq,xq); printw("%c",178);
    move(11,60); printw("Tiempo: %d:%d", minutos,segundos);
    tiempo();
    queso();
    puntos();
    mvprintw(y, x, "&");
    tecla = getch();
        if (tecla == KEY_DOWN) { y++; clear(); }
        if (tecla == KEY_UP)   { y--; clear(); }
        if (tecla == KEY_LEFT) { x--; clear(); }
        if (tecla == KEY_RIGHT){ x++; clear(); }
     /*   if (y==2)  y++; clear();
        if (y==23) y--; clear();
        if (x==6)  x++; clear();
        if (x==47) x--; clear();
        if (y>5 && y<23 && x==11)  x--; clear();
        if (y>11 && y<18 && x==27)  x--; clear();
        if (y>5 && y<21 && x==15)  x--; clear();
        if (y>8 && y<21 && x==19)  x--; clear();
        if (y>1 && y<7 && x==23)  x--; clear();
        if (y>11 && y<18 && x==13)  x--; clear();
        if (y>9 && y<23 && x==23)  x--; clear();
        if (y>11 && y<18 && x==27)  x--; clear();
        if (y>19 && y<23 && x==27)  x--; clear();
        if (y>8 && y<18 && x==31)  x--; clear();
        if (y>2 && y<18 && x==35)  x--; clear();
        if (y>6 && y<18 && x==39)  x--; clear();
        if (y>9 && y<20 && x==43)  x--; clear();//
        if (x>14 && x<32 && y==6)  y--; clear();
        if (x>38 && x<43 && y==6)  y--; clear();
        if (x>18 && x<32 && y==9)  y--; clear();
        if (x>27 && x<32 && y==17)  y--; clear();
        if (x>35 && x<40 && y==17)  y--; clear();
        if (x>26 && x<44 && y==20)  y--; clear();*/
    }
    endwin();
}
Example #5
0
void Reportes::setDatosGraficoAngulos(QVector<Angulo*> listaAngulos)
{
    const int size=listaAngulos.size();
    QVector<double> tiempo(size);
    QVector<double> angX(size);
    QVector<double> angY(size);
    for (int var = 0; var < size; ++var) {
        Angulo *angulo=listaAngulos.at(var);
        tiempo[var]=angulo->getTiempo();
        angX[var]=angulo->getAngulo1();
        angY[var]=angulo->getAngulo2();
    }
    this->vaciarGraficoAngulos();
    graficoAnguloX->setData(tiempo,angX);
    graficoAnguloY->addData(tiempo,angY);
    this->replotGraficoAngulos();
}
void Imprimir_graficos::mostprof() {

    pasgs = 0; pcmps = 0; plns = 0;
    QTime tiempo(0, 0, 0, 0);
    int t = 0;
    ui->listacts->clear();

    tiempo.start();
    // Llamada al metodo recursivo de profundidad
    prof(g->vertinicio, 0);
    t = tiempo.elapsed();
    plns += pasgs + pcmps;

    ui->listacts->addItem(QString::fromStdString(g->rutac));
    ui->recasg->setText(QString::number(pasgs));
    ui->reccmp->setText(QString::number(pcmps));
    ui->reclns->setText(QString::number(plns));
    ui->rectmp->setText(QString::number(t) + " ms.");
}
Example #7
0
void automovil( void *id ){
	int ent,tie,sal,i;
//	for(i=0;i<NEJECUCIONES;i++)
	while(1)
	{
		ent = rand()%NENTRADAS;
		tie = rand()%5;
		sal = rand()%NSALIDAS;

		int id2 = (int) id;
		//printf("id2: %d",id2);

		int lug = entrada(id,ent);
		pthread_mutex_unlock(&C1);
		tiempo(tie);
		salida(id,sal,lug);
		pthread_mutex_unlock(&C1);
	}
	sleep(3);
}
void Imprimir_graficos::mostampl() {

    int asgs = 0, cmps = 0, lns = 0, t = 0;
    ui->listacts->clear();
    QTime tiempo(0, 0, 0, 0);

    tiempo.start();

    // Recorrido por amplitud
    asgs += 2;
    grafo::vertice *temp = g->vertinicio;
    cmps++;
    while (temp != NULL) {
        cmps++; asgs++;
        QString vertitem =
                "Vertice : " + QString::number(temp->id) + " ( ";

        // Mostrar los predecesores y su informacion
        cmps++;
        if (temp->pred == NULL) {
            asgs++;
            vertitem += " -- ";
        }
        else {
            asgs++;
            grafo::subarco *sublista = temp->pred;
            cmps++;
            while (sublista != NULL) {
                cmps++; lns++;
                vertitem.append(sublista->destino->nombre);
                vertitem += " ";
                sublista = sublista->sig;
                asgs += 2;
            }
        }
        asgs++;
        vertitem += ") - ET: " + QString::number(temp->et);

        ui->listacts->addItem(vertitem);

        // Imprimir los sucesores y su informacion
        asgs++;
        grafo::subarco *sucs = temp->sigarco;
        cmps++;
        while (sucs != NULL) {
            cmps++; asgs++;
            QString sucitem = " - Arco: ";
            sucitem.append(sucs->destino->nombre);
            sucitem += " \t t: " + QString::number(sucs->destino->tiempo);
            sucitem += " \t dest: " + QString::number(sucs->destino->destino->id);
            ui->listacts->addItem(sucitem);
            sucs = sucs->sig;
            lns += 2; asgs += 4;
        }
        asgs++;
        temp = temp->sig;
    }
    lns += cmps + asgs;
    ui->listacts->addItem(QString::fromStdString(g->rutac));
    t = tiempo.elapsed();
    ui->recasg->setText(QString::number(asgs));
    ui->reccmp->setText(QString::number(cmps));
    ui->reclns->setText(QString::number(lns));
    ui->rectmp->setText(QString::number(t) + " ms.");
}