Beispiel #1
0
Datei: led.c Projekt: B-C/ELEC223
void switchOnOff(unsigned short ledNb, short state) 
{
	if(ledNb!=4)
		modif(&PORTC,((unsigned short)1)<<ledNb,state);
	else
		modif(&PORTE,MASQUE_E,state);
}
Beispiel #2
0
void	catch_key(Uint8 *key, t_font *font, t_menu *menu, int *c)
{
  int	i;

  i = font->selected;
  if (key[SDLK_DOWN] && i < 5)
    {
      font->message[i] = TTF_RenderText_Solid(font->map,
					      font->name[i], font->whi);
      font->message[i + 1] = TTF_RenderText_Solid(font->map,
						  font->name[i + 1], font->red);
      modif(font, menu);
      font->selected++;
    }
  if (key[SDLK_UP] && i > 0)
    {
      font->message[i] = TTF_RenderText_Solid(font->map,
					      font->name[i], font->whi);
      font->message[i - 1] = TTF_RenderText_Solid(font->map,
						  font->name[i - 1], font->red);
      modif(font, menu);
      font->selected--;
    }
  if (key[SDLK_RETURN] && i == 5)
    *c = 0;
}
Beispiel #3
0
void MainWindow::on_cataleat_clicked()
{
    //Aleatoriu
    ui->catanim->setVisible(false);
    ui->cataleat->setVisible(false);
    ui->cataut->setVisible(false);
    ui->catfruct->setVisible(false);
    ui->catjud->setVisible(false);
    ui->catpict->setVisible(false);
    ui->catplant->setVisible(false);
    ui->cattari->setVisible(false);
    ui->lineEdit_3->setVisible(true);
    ui->label_3->setVisible(true);
    ui->label_4->setVisible(true);
    int cat=nrrandom();
    if(cat>6){
        cat=cat-2;
    }
    qDebug()<<cat;
    cuvl=citcuv(categorii[cat]);
    cuvo=transfcuv(cuvl);
    ui->label_2->setText("Categoria: "+categorii[cat]+"");
    ui->label_2->setStyleSheet("text-decoration: none; color: #666; position: absolute; font-size: 24px");
    cuvm=modif(cuvo);
    utilizate="";
    ui->label_4->setText(cuvm);
    ui->label_4->setStyleSheet("text-decoration: none; color: #666; position: absolute; font-size: 24px");
    ui->label_5->setText(""+citdesc(cuvl)+"");
}
Beispiel #4
0
void MainWindow::on_catanim_clicked()
{
    //------------Alegerea categoriei animale
    //UI
    ui->catanim->setVisible(false);
    ui->cataleat->setVisible(false);
    ui->cataut->setVisible(false);
    ui->catfruct->setVisible(false);
    ui->catjud->setVisible(false);
    ui->catpict->setVisible(false);
    ui->catplant->setVisible(false);
    ui->cattari->setVisible(false);
    ui->lineEdit_3->setVisible(true);
    ui->label_3->setVisible(true);
    ui->label_4->setVisible(true);
    //initializarea cuvantului din aceasta categorie
    cuvl = citcuv("animale");
    qDebug()<<cuvl;
    cuvo=transfcuv(cuvl);
    cuvm=modif(cuvo);
    ui->label_2->setText("Categoria: animale");
    ui->label_2->setStyleSheet("text-decoration: none; color: #666; position: absolute; font-size: 24px");
    utilizate="";
    ui->label_4->setText(cuvm);
    ui->label_4->setStyleSheet("text-decoration: none; color: #666; position: absolute; font-size: 24px");
    ui->label_5->setText(""+citdesc(cuvl)+"");
}
void MainWindow::on_pushButtonModifierMedicament_clicked()
{
    //on récup les données
    //combo
    QString nomFam = ui->comboBoxFamilleMedicament->currentText();
    QSqlQuery recupFam("select id FROM famille WHERE libelle='"+nomFam+"';");
    recupFam.first();
    QString famId = recupFam.value(0).toString();

    //le reste
    QString compo = ui->lineEditCompositionMedicament->text();
    QString depLeg = ui->lineEditDepLegalMedicament->text();
    QString nomCom = ui->lineEditNomCommercialMedicament->text();
    QString prixEch= ui->lineEditPrixEchMed->text();
    QString contreIndic = ui->textEditContreIndicMedicament->toPlainText();
    QString effets = ui->textEditEffetsMedicament->toPlainText();

    //on modifie
    QSqlQuery modif("update medicament SET id='"+depLeg+"', nomCommercial='"+nomCom+"', familleId='"+famId+"', composition='"+compo+"', effets='"+effets+"', contreIndications='"+contreIndic+"', prixEchantillon="+prixEch+" where id='"+this->med_depLeg+"';");
    modif.exec();

    //on rafraichit
    chargerMed();
    viderChampMed();
}
Beispiel #6
0
/*!
 * \brief Constructeur du menu initial de gestion des UVs.
 */
Debut::Debut() {
    this->setWindowTitle(QString("Operation choisie sur les UVs ?"));
    liste=new QComboBox;
    update();
    ajouter=new QPushButton("Ajouter une UV", this);
    consulter=new QPushButton("Consulter les informations sur cette UV", this);
    modifier=new QPushButton("Modifier des informations sur cette UV", this);
    sup=new QPushButton("Supprimer cette UV", this);
    terminer=new QPushButton("Opérations sur les UVs terminées", this);

    coucheH1=new QHBoxLayout;
    coucheH1->addWidget(liste);

    coucheH2=new QHBoxLayout;
    coucheH2->addWidget(consulter);
    coucheH2->addWidget(sup);
    coucheH2->addWidget(ajouter);
    coucheH2->addWidget(modifier);
    coucheH2->addWidget(terminer);

    coucheV=new QVBoxLayout;
    coucheV->addLayout(coucheH1);
    coucheV->addLayout(coucheH2);
    setLayout(coucheV);

    QObject::connect(ajouter, SIGNAL(clicked()), this, SLOT(ajout()));
    QObject::connect(sup, SIGNAL(clicked()), this, SLOT(suppression()));
    QObject::connect(modifier, SIGNAL(clicked()), this, SLOT(modif()));
    QObject::connect(consulter, SIGNAL(clicked()), this, SLOT(afficher()));
    QObject::connect(terminer, SIGNAL(clicked()), this, SLOT(fin()));
}
void kXneurApp::addUserAction::keyPressEvent(QKeyEvent *event)
{
    QString key;
    QString md_key;
    key = QString("%1").arg(XKeysymToString(XkbKeycodeToKeysym(kXneurApp::xNeurConfig::dpy, event->nativeScanCode(),0,0)));
    md_key = modif(event->modifiers());
    if(key.endsWith("_L") ||  key.endsWith("_R") )
        key.remove(key.length()-2,2);
    ui->lblHotKey->setText(QString("%1%2").arg(md_key).arg(key));
}
void MainWindow::on_pushButtonModifierVisiteur_clicked()
{
    //on recup les nouvelles données
    QString matricule = ui->lineEditMatriculeVisisteur->text();
    QString nom = ui->lineEditNomVisiteur->text();
    QString prenom = ui->lineEditPrenomVisiteur->text();
    QString adresse = ui->lineEditAdresseVisiteur->text();
    QString CP = ui->lineEditCPVisiteur->text();
    QString ville = ui->lineEditVilleVisiteur->text();
    QString dateEmb = ui->lineEditDateEmbaucheVisiteur->text();

    //le secteur
    QString nomSec=ui->comboBoxSecteurVisiteur->currentText();
    QSqlQuery recupSec("select id FROM secteur WHERE libelle='"+nomSec+"';");
    recupSec.first();
    QString idSec=recupSec.value(0).toString();

    //le labo
    QString nomLab=ui->comboBoxLaboVisiteur->currentText();
    QSqlQuery recupLab("select id FROM labo WHERE nom='"+nomLab+"';");
    recupLab.first();
    QString idLab = recupLab.value(0).toString();

    //le dep
    QString nomDep = ui->comboBoxDepartementVisiteur->currentText();
    QSqlQuery recupDep("select id FROM departement WHERE nom='"+nomDep+"';");
    recupDep.first();
    QString idDep = recupDep.value(0).toString();

    //le delegue
    QString delegue;
    if(ui->radioButtonDelegueNON->isChecked())
    {
        delegue="0";
    }
    else
    {
        delegue="1";
    }

    //on modifie
    QString chaineModif("update visiteur SET id='"+matricule+"',nom='"+nom+"',prenom='"+prenom+"',adresse='"+adresse+"',cp='"+CP+"',ville='"+ville+"',dateEmbauche='"+dateEmb+"',secteur_id='"+idSec+"',labo_id='"+idLab+"',dep_id='"+idDep+"',delague="+delegue+" where nom='"+this->vis_nom+"' AND prenom='"+this->vis_prenom+"';");
    QSqlQuery modif(chaineModif);
    modif.exec();

    //on rafraichit
    chargerVis();
    viderChampVis();
}
Beispiel #9
0
Log& Log::operator<<(std::ostream& (*modif)(std::ostream&)){
	appendIfNeeded();

	modif(_stream);
	
	if(modif == static_cast<std::ostream& (*)(std::ostream&)>(std::flush) ||
	   modif == static_cast<std::ostream& (*)(std::ostream&)>(std::endl)){
		flush();
	} else {
#ifdef __APPLE__
		// Temporary fix for macOS.
		flush();
#endif
	}
	return *this;
}
void MainWindow::on_pushButtonModifierCabinet_clicked()
{
    //on recup
    QString nom = ui->lineEditLocalCabinet->text();
    QString tel = ui->lineEditTelCabinet->text();
    QString ville = ui->lineEditVilleCabinet->text();

    //on modifie
    QSqlQuery modif("update cabinet set local='"+nom+"', tel='"+tel+"', ville='"+ville+"' WHERE local='"+this->cab_nom+"';");
    modif.exec();

    //on actualise
    chargerCab();
    viderChampsCab();
    //on met aussi a jour la combo de l'onglet praticien
    chargerPrat();
}
void MainWindow::on_pushButtonModifierDepartement_clicked()
{
    //on recup les données
    QString nom = ui->lineEditNomDepartement->text();
    QString chef = ui->lineEditChefVenteDepartement->text();


    //on modifie
    QSqlQuery modif("update departement SET nom='"+nom+"',chefVente='"+chef+"' WHERE nom='"+this->dep_nom+"';");
    modif.exec();

    //on rafraichit
    chargerDep();
    viderChampDep();
    //on met aussi a jour la combo de l'onglet visiteur
    chargerVis();
}
void MainWindow::on_pushButtonModifierLabo_clicked()
{
    //on recup les données
    QString  nom = ui->lineEditNomLabo->text();
    QString code = ui->lineEditCodeLabo->text();
    QString chef = ui->lineEditChefVenteLabo->text();

    //on modifie
    QString chaineModif = "update labo set id='"+code+"', nom='"+nom+"', chefVente='"+chef+"' WHERE nom='"+this->lab_nom+"';";
    QSqlQuery modif(chaineModif);
    modif.exec();

    //on rafraichit
    chargerLabo();
    viderChampLabo();
    //on met aussi a jour la combo de l'onglet visiteur
    chargerVis();
}
Beispiel #13
0
void NMGChartAxis::slotChangeLabelText(const QString& id, const QString& newText)
{
  if(type == NMGChartAxis::TEXT)
  {
    QString modif(newText);
    if(modif.size() > 7) 
    {
      modif = modif.left(7);
      modif = modif.leftJustified(10, '.');
    }
    int pos = idsList.indexOf(id);
    if(pos != -1)
    {
      labelsList.replace(pos, modif);
      spaceNeededIntoSceneChanged = TRUE;
      update();
    }
  }
}
void tappend()
  {

       Button Data,Pass;
       Data.init(221,57,"Data       ",FLAT);
       Data.show( );
       Pass.init(221,77,"Password   ",FLAT);
       Pass.show( );
       int i= selc(Data,Pass,32,25);
       if(i==1)
     {

     data1();
     }
      else if(i==2)
     {
      modif();
     }

  }
Beispiel #15
0
Debut::Debut() {

    this->setWindowTitle(QString("Choix de début"));

    ajouter=new QPushButton("Ajouter", this);
    modifier=new QPushButton("Modifier", this);
    sup=new QPushButton("Supprimer", this);

    coucheH=new QHBoxLayout;
    coucheH->addWidget(sup);
    coucheH->addWidget(ajouter);
    coucheH->addWidget(modifier);

    coucheV=new QVBoxLayout;
    coucheV->addLayout(coucheH);
    setLayout(coucheV);

    QObject::connect(ajouter, SIGNAL(clicked()), this, SLOT(ajout()));
    QObject::connect(sup, SIGNAL(clicked()), this, SLOT(suppression()));
    QObject::connect(modifier, SIGNAL(clicked()), this, SLOT(modif()));

}
Beispiel #16
0
menuFormation::menuFormation(cursusManager *man, UVManager* u)
{
    m=man;
    uvman=u;

    mainbox=new QVBoxLayout(this);
    hbox1=new QHBoxLayout(this);
    hbox2=new QHBoxLayout(this);
    titre=new QLabel("Choisissez une formation et sélectionnez l'opération:",this);
    select=new QComboBox(this);
    visualiser=new QPushButton("Voir les détails",this);
    ajouter=new QPushButton("Ajouter une formation",this);
    modifier=new QPushButton("Modifier",this);
    supprimer=new QPushButton("Supprimer",this);
    quit=new QPushButton("Quitter",this);
    sauver=new QPushButton("Sauver",this);

    select->setFixedWidth(300);
    mainbox->addLayout(hbox1);
    mainbox->addLayout(hbox2);
    hbox1->addWidget(titre);
    hbox1->addWidget(select);
    hbox2->addWidget(visualiser);
    hbox2->addWidget(ajouter);
    hbox2->addWidget(modifier);
    hbox2->addWidget(supprimer);
    hbox2->addWidget(sauver);
    hbox2->addWidget(quit);

    QObject::connect(visualiser,SIGNAL(clicked()),this,SLOT(voir()));
    QObject::connect(ajouter,SIGNAL(clicked()),this, SLOT(ajout()));
    QObject::connect(modifier,SIGNAL(clicked()),this, SLOT(modif()));
    QObject::connect(supprimer,SIGNAL(clicked()),this, SLOT(suppr()));
    QObject::connect(quit,SIGNAL(clicked()),this,SLOT(close()));
    QObject::connect(sauver, SIGNAL(clicked()),this,SLOT(save()));

    update();
}
Beispiel #17
0
int		modif_cd(char **env, t_param_env *param, char **s)
{
  int		i;
  char		**save;

  i = 0;
  if (env[1] == NULL)
    return (1);
  save = my_str_to_wordtab(s[1], '/');
  while (save[i])
    {
      if (save[i][0] == '.' && save[i][1] == '.')
	{
	  modif(env, param);
	  ++i;
	}
      else
	{
	  modif_cd_norm(env, param, save[i]);
	  ++i;
	}
    }
  return (0);
}
int main(void){
	for(;;){ /*crea un bucle infinito de aperturas*/
		system("clear");
		printf("MENU\n");
		printf("1- Introducir registros\n");
		printf("2- Modificar registros\n");
		printf("3- listar registros\n");
		printf("4- Consultar registros\n");
		printf("5- FINALIZAR\n");
		printf("Introducir el nro de opcion deseado");
		opc=getchar();// ingresa la opcion de 1 a 5;
		fflush(stdin);
		getchar();
		
		switch(opc){
			case'1': intro();break;
			case'2': modif();break;
			case'3': listar();break;
			case'4': consul();break;
			case'5': exit(0);// sale del bucle infinito
			default:break;
		}
	}
}
Beispiel #19
0
void MainWindow::on_cattari_clicked()
{
    //categoria tari
    ui->catanim->setVisible(false);
    ui->cataleat->setVisible(false);
    ui->cataut->setVisible(false);
    ui->catfruct->setVisible(false);
    ui->catjud->setVisible(false);
    ui->catpict->setVisible(false);
    ui->catplant->setVisible(false);
    ui->cattari->setVisible(false);
    ui->lineEdit_3->setVisible(true);
    ui->label_3->setVisible(true);
    ui->label_4->setVisible(true);
    cuvl=citcuv("tari");
    cuvo=transfcuv(cuvl);
    ui->label_2->setText("Categoria: tari");
    ui->label_2->setStyleSheet("text-decoration: none; color: #666; position: absolute; font-size: 24px");
    cuvm=modif(cuvo);
    utilizate="";
    ui->label_4->setText(cuvm);
    ui->label_4->setStyleSheet("text-decoration: none; color: #666; position: absolute; font-size: 24px");
    ui->label_5->setText(""+citdesc(cuvl)+"");
}
Beispiel #20
0
Log& Log::operator<<(std::ios_base& (*modif)(std::ios_base&)){
	modif(_stream);
	return *this;
}
Beispiel #21
0
Lisp_Object modulus(Lisp_Object a, Lisp_Object b)
{
    switch ((int)a & TAG_BITS)
    {
    case TAG_FIXNUM:
        switch ((int)b & TAG_BITS)
        {
        case TAG_FIXNUM:
            /*
             * This is where fixnum % fixnum arithmetic happens - the case I most want to
             * make efficient.
             */
        {   int32_t p = int_of_fixnum(a);
            int32_t q = int_of_fixnum(b);
            if (q == 0) return aerror2("bad arg for mod", a, b);
            p = p % q;
            if (q < 0)
            {   if (p > 0) p += q;
            }
            else if (p < 0) p += q;
            /* No overflow is possible in a modulus operation */
            return fixnum_of_int(p);
        }
        /*
         * Common Lisp defines a meaning for the modulus function when applied
         * to floating point values - so there is a whole pile of mess here to
         * support that.  Standard Lisp is only concerned with fixnums and
         * bignums.
         */
        case TAG_SFLOAT:
            return modis(a, b);
        case TAG_NUMBERS:
        {   int32_t hb = type_of_header(numhdr(b));
            switch (hb)
            {
            case TYPE_BIGNUM:
                return modib(a, b);
            case TYPE_RATNUM:
                return modir(a, b);
            default:
                return aerror1("Bad arg for mod",  b);
            }
        }
        case TAG_BOXFLOAT:
            return modif(a, b);
        default:
            return aerror1("Bad arg for mod",  b);
        }
    case TAG_SFLOAT:
        switch ((int)b & TAG_BITS)
        {
        case TAG_FIXNUM:
            return modsi(a, b);
        case TAG_SFLOAT:
        {   Float_union aa, bb;
            aa.i = a - TAG_SFLOAT;
            bb.i = b - TAG_SFLOAT;
            aa.f = (float) (aa.f + bb.f);
            return (aa.i & ~(int32_t)0xf) + TAG_SFLOAT;
        }
        case TAG_NUMBERS:
        {   int32_t hb = type_of_header(numhdr(b));
            switch (hb)
            {
            case TYPE_BIGNUM:
                return modsb(a, b);
            case TYPE_RATNUM:
                return modsr(a, b);
            default:
                return aerror1("Bad arg for mod",  b);
            }
        }
        case TAG_BOXFLOAT:
            return modsf(a, b);
        default:
            return aerror1("Bad arg for mod",  b);
        }
    case TAG_NUMBERS:
    {   int32_t ha = type_of_header(numhdr(a));
        switch (ha)
        {
        case TYPE_BIGNUM:
            switch ((int)b & TAG_BITS)
            {
            case TAG_FIXNUM:
                return modbi(a, b);
            case TAG_SFLOAT:
                return modbs(a, b);
            case TAG_NUMBERS:
            {   int32_t hb = type_of_header(numhdr(b));
                switch (hb)
                {
                case TYPE_BIGNUM:
                    return modbb(a, b);
                case TYPE_RATNUM:
                    return modbr(a, b);
                default:
                    return aerror1("Bad arg for mod",  b);
                }
            }
            case TAG_BOXFLOAT:
                return modbf(a, b);
            default:
                return aerror1("Bad arg for mod",  b);
            }
        case TYPE_RATNUM:
            switch ((int)b & TAG_BITS)
            {
            case TAG_FIXNUM:
                return modri(a, b);
            case TAG_SFLOAT:
                return modrs(a, b);
            case TAG_NUMBERS:
            {   int32_t hb = type_of_header(numhdr(b));
                switch (hb)
                {
                case TYPE_BIGNUM:
                    return modrb(a, b);
                case TYPE_RATNUM:
                    return modrr(a, b);
                default:
                    return aerror1("Bad arg for mod",  b);
                }
            }
            case TAG_BOXFLOAT:
                return modrf(a, b);
            default:
                return aerror1("Bad arg for mod",  b);
            }
        default:
            return aerror1("Bad arg for mod",  a);
        }
    }
    case TAG_BOXFLOAT:
        switch ((int)b & TAG_BITS)
        {
        case TAG_FIXNUM:
            return modfi(a, b);
        case TAG_SFLOAT:
            return modfs(a, b);
        case TAG_NUMBERS:
        {   int32_t hb = type_of_header(numhdr(b));
            switch (hb)
            {
            case TYPE_BIGNUM:
                return modfb(a, b);
            case TYPE_RATNUM:
                return modfr(a, b);
            default:
                return aerror1("Bad arg for mod",  b);
            }
        }
        case TAG_BOXFLOAT:
            return ccl_modff(a, b);
        default:
            return aerror1("Bad arg for mod",  b);
        }
    default:
        return aerror1("Bad arg for mod",  a);
    }
}
Beispiel #22
0
// wrappers for ldap_modify_ext
//
nsresult
nsLDAPOperation::ModifyExt(const char *base,
                           nsIArray *mods,
                           LDAPControl **serverctrls,
                           LDAPControl **clientctrls)
{
  if (mMessageListener == 0) {
    NS_ERROR("nsLDAPOperation::ModifyExt(): mMessageListener not set");
    return NS_ERROR_NOT_INITIALIZED;
  }

  LDAPMod **attrs = 0;
  int retVal = 0;
  PRUint32 modCount = 0;
  nsresult rv = mods->GetLength(&modCount);
  NS_ENSURE_SUCCESS(rv, rv);
  if (modCount && mods) {
    attrs = static_cast<LDAPMod **>(nsMemory::Alloc((modCount + 1) *
                                                       sizeof(LDAPMod *)));
    if (!attrs) {
      NS_ERROR("nsLDAPOperation::ModifyExt: out of memory ");
      return NS_ERROR_OUT_OF_MEMORY;
    }

    nsCAutoString type;
    PRUint32 index;
    for (index = 0; index < modCount && NS_SUCCEEDED(rv); ++index) {
      attrs[index] = new LDAPMod();
      if (!attrs[index])
        return NS_ERROR_OUT_OF_MEMORY;

      nsCOMPtr<nsILDAPModification> modif(do_QueryElementAt(mods, index, &rv));
      if (NS_FAILED(rv))
        break;

      PRInt32 operation;
      nsresult rv = modif->GetOperation(&operation);
      if (NS_FAILED(rv))
        break;

      attrs[index]->mod_op = operation | LDAP_MOD_BVALUES;

      rv = modif->GetType(type);
      if (NS_FAILED(rv))
        break;

      attrs[index]->mod_type = ToNewCString(type);

      rv = CopyValues(modif, &attrs[index]->mod_bvalues);
      if (NS_FAILED(rv))
        break;
    }

    if (NS_SUCCEEDED(rv)) {
      attrs[modCount] = 0;

      retVal = ldap_modify_ext(mConnectionHandle, base, attrs,
                               serverctrls, clientctrls, &mMsgID);
    }
    else
      // reset the modCount so we correctly free the array.
      modCount = index;

  }

  for (PRUint32 counter = 0; counter < modCount; ++counter)
    delete attrs[counter];

  nsMemory::Free(attrs);

  return NS_FAILED(rv) ? rv : TranslateLDAPErrorToNSError(retVal);
}
Beispiel #23
0
Datei: led.c Projekt: B-C/ELEC223
void switchAllOnState(short state)
{
	modif(&PORTC,MASQUE_C,state);
	modif(&PORTE,MASQUE_E,state);
}