Beispiel #1
0
void TunManager::addIntf(RouterID rid, const Interface::Addresses& addrs) {
  auto ret = intfs_.emplace(rid, nullptr);
  if (!ret.second) {
    throw FbossError("Duplicate interface for router ", rid);
  }
  SCOPE_FAIL {
    intfs_.erase(ret.first);
  };
  auto intf = folly::make_unique<TunIntf>(
      sw_, evb_, rid, addrs, getMinMtu(sw_->getState()));
  SCOPE_FAIL {
    intf->setDelete();
  };
  const auto& name = intf->getName();
  auto index = intf->getIfIndex();
  // bring up the interface so that we can add the default route next step
  bringupIntf(name, index);
  // create a new route table for this rid
  addRouteTable(index, rid);
  // add all addresses
  for (const auto& addr : addrs) {
    addTunAddress(name, rid, index, addr.first, addr.second);
  }
  ret.first->second = std::move(intf);
}
Beispiel #2
0
// Open the dialog type 't'
void FileHandling::openDialog(QString t) {

	if(verbose) std::clog << "fhd: Open widget:" << t.toStdString() << std::endl;

	if(currentfile != "") {

		// Make sure all widgets are hidden by default
		renameWidget->hide();
		deleteWidget->hide();
		moveWidget->hide();
		copyWidget->hide();

		// Save current state
		dialogType = t;

		// Set right widget
		if(t == "rename")
			setRename();
		if(t == "delete")
			setDelete();
		if(t == "copy")
			setCopy();
		if(t == "move")
			setMove();

		// And animate
		makeShow();

	}

}
Beispiel #3
0
/**
\param parent
\return
**/
MovimientosSubform::MovimientosSubform ( QWidget *parent, const char * ) : BfSubForm ( parent )
{
    BL_FUNC_DEBUG
    /// Disparamos los plugins.
    int res = g_plugins->run ( "MovimientosSubform_MovimientosSubform", this );
    if ( res != 0 )
        return;
    setDbTableName ( "movimiento" );
    setDbFieldId ( "idmovimiento" );
    addSubFormHeader ( "idmovimiento", BlDbField::DbInt, BlDbField::DbPrimaryKey, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite, _ ( "idarticulo" ) );
    addSubFormHeader ( "fechamovimiento", BlDbField::DbDate, BlDbField::DbNotNull, BlSubFormHeader::DbNone , _ ( "Fecha" ) );
    addSubFormHeader ( "idarticulo", BlDbField::DbInt, BlDbField::DbNotNull, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite, _ ( "Id articulo" ) );
    addSubFormHeader ( "codigocompletoarticulo", BlDbField::DbVarChar, BlDbField::DbNothing, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite, _ ( "Codigo articulo" ) );
    addSubFormHeader ( "nomarticulo", BlDbField::DbVarChar, BlDbField::DbNothing, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite, _ ( "Nombre articulo" ) );
    addSubFormHeader ( "cantidadmovimiento", BlDbField::DbNumeric, BlDbField::DbNotNull, BlSubFormHeader::DbNone , _ ( "Cantidad" ) );
    addSubFormHeader ( "lotemovimiento", BlDbField::DbVarChar, BlDbField::DbNothing, BlSubFormHeader::DbNone, _ ( "Lote" ) );
    addSubFormHeader ( "idalmacen", BlDbField::DbInt, BlDbField::DbNotNull, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite, _ ( "Id almacen" ) );
    addSubFormHeader ( "codigoalmacen", BlDbField::DbVarChar, BlDbField::DbNothing, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite, _ ( "Codigo almacen" ) );
    addSubFormHeader ( "nomalmacen", BlDbField::DbVarChar, BlDbField::DbNothing, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite, _ ( "Nombre almacen" ) );
    addSubFormHeader ( "idlalbaran", BlDbField::DbInt, BlDbField::DbNothing, BlSubFormHeader::DbNone, _ ( "Id albaran cliente" ) );
    addSubFormHeader ( "idlalbaranp", BlDbField::DbInt, BlDbField::DbNothing, BlSubFormHeader::DbNone, _ ( "Id albaran proveedor" ) );

    setInsert ( FALSE );
    setDelete ( FALSE );
    setSortingEnabled ( FALSE );

}
/**
\param parent
**/
BcExtractoSubForm::BcExtractoSubForm ( QWidget *parent, const char * ) : BcSubForm ( parent )
{
    BL_FUNC_DEBUG
    setDbTableName ( "apunte" );
    setFileConfig ( "BcExtractoSubForm" );
    setDbFieldId ( "idapunte" );
    addSubFormHeader ( "punteo", BlDbField::DbBoolean, BlDbField::DbNotNull, BlSubFormHeader::DbNone, _ ( "Punteo" ) );
    addSubFormHeader ( "fecha", BlDbField::DbVarChar, BlDbField::DbNoSave, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite | BlSubFormHeader::DbDisableView, _ ( "Fecha" ) );
    addSubFormHeader ( "codigo", BlDbField::DbVarChar, BlDbField::DbNoSave, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite, _ ( "Cuenta" ) );
    addSubFormHeader ( "ordenasiento", BlDbField::DbInt, BlDbField::DbNoSave, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite | BlSubFormHeader::DbDisableView, _ ( "Asiento" ) );
    addSubFormHeader ( "descripcioncuenta", BlDbField::DbVarChar, BlDbField::DbNoSave, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite, _ ( "Descripcion" ) );
    addSubFormHeader ( "descripcionapunte", BlDbField::DbVarChar, BlDbField::DbNoSave, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite, _ ( "Descripcion Apunte" ) );
    addSubFormHeader ( "descripcionasiento", BlDbField::DbVarChar, BlDbField::DbNoSave, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite, _ ( "Descripcion Asiento" ) );
    addSubFormHeader ( "conceptocontable", BlDbField::DbVarChar, BlDbField::DbNoSave, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite, _ ( "Concepto" ) );
    addSubFormHeader ( "debe", BlDbField::DbNumeric, BlDbField::DbNoSave, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite | BlSubFormHeader::DbDisableView, _ ( "Debe" ) );
    addSubFormHeader ( "haber", BlDbField::DbNumeric, BlDbField::DbNoSave, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite | BlSubFormHeader::DbDisableView, _ ( "Haber" ) );
    addSubFormHeader ( "saldo", BlDbField::DbNumeric, BlDbField::DbNoSave, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite, _ ( "Saldo" ) );

    addSubFormHeader ( "idapunte", BlDbField::DbInt, BlDbField::DbNotNull | BlDbField::DbPrimaryKey, BlSubFormHeader::DbHideView | BlSubFormHeader::DbNoWrite, _ ( "idapunte" ) );
    addSubFormHeader ( "codigoborrador", BlDbField::DbVarChar, BlDbField::DbNoSave, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite, _ ( "codigoborrador" ) );
    addSubFormHeader ( "idasiento", BlDbField::DbInt, BlDbField::DbNoSave, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite, _ ( "idasiento" ) );
    addSubFormHeader ( "iddiario", BlDbField::DbVarChar, BlDbField::DbNoSave, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite, _ ( "iddiario" ) );
    addSubFormHeader ( "idcuenta", BlDbField::DbVarChar, BlDbField::DbNoSave, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite, _ ( "idcuenta" ) );
    addSubFormHeader ( "tipocuenta", BlDbField::DbVarChar, BlDbField::DbNoSave, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite, _ ( "tipocuenta" ) );
    addSubFormHeader ( "contrapartida", BlDbField::DbVarChar, BlDbField::DbNoSave, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite, _ ( "Id contrapartida" ) );
    addSubFormHeader ( "codcontrapartida", BlDbField::DbVarChar, BlDbField::DbNoSave, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite, _ ( "contrapartida" ) );
    addSubFormHeader ( "comentario", BlDbField::DbVarChar, BlDbField::DbNoSave, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite, _ ( "Comentario" ) );
    addSubFormHeader ( "idcanal", BlDbField::DbVarChar, BlDbField::DbNoSave, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite, _ ( "idcanal" ) );
    addSubFormHeader ( "nombrecanal", BlDbField::DbVarChar, BlDbField::DbNoSave, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite, _ ( "Canal" ) );
    addSubFormHeader ( "marcaconciliacion", BlDbField::DbVarChar, BlDbField::DbNoSave, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite, _ ( "marcaconciliacion" ) );
    addSubFormHeader ( "idc_coste", BlDbField::DbVarChar, BlDbField::DbNoSave, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite, _ ( "idc_coste" ) );
    addSubFormHeader ( "nombrec_coste", BlDbField::DbVarChar, BlDbField::DbNoSave, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite, _ ( "Centro Coste" ) );
    addSubFormHeader ( "idtipoiva", BlDbField::DbVarChar, BlDbField::DbNoSave, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite, _ ( "idtipoiva" ) );
    addSubFormHeader ( "orden", BlDbField::DbVarChar, BlDbField::DbNoSave, BlSubFormHeader::DbNone | BlSubFormHeader::DbNoWrite, _ ( "Orden" ) );
    setInsert ( FALSE );
    setOrdenEnabled ( FALSE );
    setOrdenPorQuery ( FALSE );
    setDelete ( FALSE );
 
}
void BolaEnemigo::aumentarTiempo(){
	tiempoDeVida++;
	if(tiempoDeVida>=5000)
		setDelete();
	return;
}
Beispiel #6
0
/** give player max health when colliding with player */
void HPackObj::collidePlayer() {
  game->setMaxHealth();
  game->getPlayer()->addCharge(charge); // add health pack's charge to player's charge due to charge conservation
  setDelete(); // technically conservation of momentum says I should add the health pack's momentum to the player, but in this case I don't think that's appropriate
  game->playCollectSnd();
}
static int setTestDriver(int argc, UC8 **argv) {  
	const UC8 me[]="setTestDriver"; 
	 /* Lets keep complaints about not using argc/v quiet... */
	if (!argc) { 
		printf("%s: No Args: .\n", me);
	} else {
		int i;
		UC8 *mem;
		UC8 *otherSet;
		UC8 *uSet;
		UC8 newSet[300];
		UC8 newSet_B[300];
		myBool isMem;
		while (--argc > 0 && (*++argv)[0] == '-')
			switch ((*argv)[1]) {
			case 's':  
				--argc; argv++; i=setShow(mk0Null(*argv)); printf("\n");
				printf("%s: Show:          :%-15s: Result:           %3d\n", "set", *argv, i);
				return i;
			case 'c':
				--argc; argv++; i=setCardinal(mk0Null(*argv));
				printf("%s: Cardinal:      :%-15s:                : Result:%3d \n", "set", *argv, i);
				return i;
			case 'n':
				--argc; argv++; 
				// !! setNormalise writes to what's pointed at by its params. 
				//    That MUST be writable.  I don't think **argv is  is....
				if (*argv) strcpy(newSet, *argv); else newSet[0]=0;   // strcpy cant cope with NULLs.....
				i=setNormalise(mk0Null(newSet));
				printf("%s: Normalise:     :%-15s:%-15s : Status:%3d (%s)\n", "set", *argv, newSet, i, setStatus2Str(i) );
				return i;
			case 'm':
				--argc; argv++; mem=mk0Null(*argv);
				--argc; argv++; isMem=setIsNotMember(mem, mk0Null(*argv));
				printf("%s: isNotMember:   :%-15s:%-15s : Result:%3d (%s)\n", "set", mem, *argv, isMem, setStatus2Str(isMem));
				return isMem;
			case 'e': // Note - setIsNotEqual calls normalise, so *argv won't do......
				--argc; argv++; 
				otherSet=mk0Null(*argv);
				if (*argv) strcpy(newSet, otherSet); else newSet[0]=0;   // strcpy cant cope with NULLs.....
				--argc; argv++; 
				if (mk0Null(*argv)) strcpy(newSet_B, mk0Null(*argv)); else newSet_B[0]=0;   // strcpy cant cope with NULLs.....
				isMem=setIsNotEqual(newSet, newSet_B);
				printf("%s: setIsNotEqual: :%-15s, %-15s: Result:%3d (%s)\n", "set", otherSet, *argv, isMem, setStatus2Str(isMem));
				return isMem;
			case 'u':
				--argc; argv++; otherSet=mk0Null(*argv);
				--argc; argv++; uSet=setUnion(otherSet, mk0Null(*argv));
				printf("%s: setUnion:      :%-15s, %-15s: Result: %-15s\n", "set", otherSet, *argv, uSet);
				//printf("%s: : setUnion: Doing The CleanUp\n", me);
				setDelete(uSet);
				//printf("%s: : setUnion: CleanUp Done\n", me);
				// Like to return a decent value here
				break;
			case 'i':
				--argc; argv++; otherSet=mk0Null(*argv);
				--argc; argv++; uSet=setIntersection(otherSet, mk0Null(*argv));
				printf("%s: setIntersection:%-15s, %-15s: Result: %-15s\n", "set", otherSet, mk0Null(*argv), uSet);
				//printf("%s: : setIntersection: Doing The CleanUp\n", me);
				setDelete(uSet);
				//printf("%s: : setIntersection: CleanUp Done\n", me);
				// Like to return a decent value here
				break;
			default:
				printf("%s: : ERROR UNKNOWN: %c:\n", "set", (*argv)[1] );
			}
	}
	//printf("%s: Complete. No Status Value returned (only 0)\n", me);
	return 0; // What we return if we can't return anythingelse
}