Recibe mima nw, th preparado pero no se usa todavía
parent
85878bf4ce
commit
f01b8b3412
|
|
@ -62,6 +62,7 @@ Colv_limp::Colv_limp(COlivia *olv)
|
||||||
barr_mix=FALSE;
|
barr_mix=FALSE;
|
||||||
usa_secuen = FALSE;
|
usa_secuen = FALSE;
|
||||||
revisa_elev = TRUE;
|
revisa_elev = TRUE;
|
||||||
|
memset(mima, 0, N_COOR_MIMA * sizeof(double));
|
||||||
}
|
}
|
||||||
//*******************************************************************************************************************************************
|
//*******************************************************************************************************************************************
|
||||||
Colv_limp::~Colv_limp(void)
|
Colv_limp::~Colv_limp(void)
|
||||||
|
|
@ -472,6 +473,7 @@ int Colv_limp::pon_config(char *config_)
|
||||||
if(!olv->dame_param(token, camps.atr_circ[OLV_ATR_CIRC_PEDES], sizeof(camps.atr_circ[OLV_ATR_CIRC_PEDES])))
|
if(!olv->dame_param(token, camps.atr_circ[OLV_ATR_CIRC_PEDES], sizeof(camps.atr_circ[OLV_ATR_CIRC_PEDES])))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
//anchos de bordillos
|
||||||
else if (strstr(token, OliviaDef::GeneralDef::GTO_anch_peat))
|
else if (strstr(token, OliviaDef::GeneralDef::GTO_anch_peat))
|
||||||
{
|
{
|
||||||
if (!olv->dame_param(token, &anchos_def[OLV_ANCH_DEF_PEAT]))
|
if (!olv->dame_param(token, &anchos_def[OLV_ANCH_DEF_PEAT]))
|
||||||
|
|
@ -497,6 +499,7 @@ int Colv_limp::pon_config(char *config_)
|
||||||
if (!olv->dame_param(token, &anchos_def[OLV_ANCH_DEF_BORD]))
|
if (!olv->dame_param(token, &anchos_def[OLV_ANCH_DEF_BORD]))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
//giros y desv
|
||||||
else if (strstr(token, OliviaDef::GeneralDef::GTO_girmax))
|
else if (strstr(token, OliviaDef::GeneralDef::GTO_girmax))
|
||||||
{
|
{
|
||||||
double ang;
|
double ang;
|
||||||
|
|
@ -521,6 +524,7 @@ int Colv_limp::pon_config(char *config_)
|
||||||
if (strlen(camps.campo_oid) > OLV_MAX_COL_SHP)//10 porque el shp solo pasa con 10 caracteres en los nombres de columna
|
if (strlen(camps.campo_oid) > OLV_MAX_COL_SHP)//10 porque el shp solo pasa con 10 caracteres en los nombres de columna
|
||||||
camps.campo_oid[OLV_MAX_COL_SHP] = 0;
|
camps.campo_oid[OLV_MAX_COL_SHP] = 0;
|
||||||
}
|
}
|
||||||
|
//campos sect y secuen
|
||||||
else if (strstr(token, OliviaDef::GeneralDef::GTO_camp_sector))
|
else if (strstr(token, OliviaDef::GeneralDef::GTO_camp_sector))
|
||||||
{
|
{
|
||||||
if (!olv->dame_param(token, camps.campo_secto, sizeof(camps.campo_secto)))
|
if (!olv->dame_param(token, camps.campo_secto, sizeof(camps.campo_secto)))
|
||||||
|
|
@ -535,6 +539,26 @@ int Colv_limp::pon_config(char *config_)
|
||||||
if (strlen(camps.campo_secuen) > OLV_MAX_COL_SHP)//10 porque el shp solo pasa con 10 caracteres en los nombres de columna
|
if (strlen(camps.campo_secuen) > OLV_MAX_COL_SHP)//10 porque el shp solo pasa con 10 caracteres en los nombres de columna
|
||||||
camps.campo_secuen[OLV_MAX_COL_SHP] = 0;
|
camps.campo_secuen[OLV_MAX_COL_SHP] = 0;
|
||||||
}
|
}
|
||||||
|
else if (strstr(token, OliviaDef::GeneralDef::GTO_mima_xmin))
|
||||||
|
{
|
||||||
|
if (!olv->dame_param(token, &mima[XMIN]))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (strstr(token, OliviaDef::GeneralDef::GTO_mima_xmax))
|
||||||
|
{
|
||||||
|
if (!olv->dame_param(token, &mima[XMAX]))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (strstr(token, OliviaDef::GeneralDef::GTO_mima_ymin))
|
||||||
|
{
|
||||||
|
if (!olv->dame_param(token, &mima[YMIN]))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (strstr(token, OliviaDef::GeneralDef::GTO_mima_ymax))
|
||||||
|
{
|
||||||
|
if (!olv->dame_param(token, &mima[YMAX]))
|
||||||
|
break;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
token = strtok(NULL, OliviaDef::GeneralDef::EjecGeoParamSep);
|
token = strtok(NULL, OliviaDef::GeneralDef::EjecGeoParamSep);
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ public:
|
||||||
std::vector<Info_tramos> *tramos;
|
std::vector<Info_tramos> *tramos;
|
||||||
|
|
||||||
std::vector<Info_aso_nw_elev> iaso_elev; ///<Map con mismos elementos que la nw, con la info de elevación de los nodos
|
std::vector<Info_aso_nw_elev> iaso_elev; ///<Map con mismos elementos que la nw, con la info de elevación de los nodos
|
||||||
|
double mima[N_COOR_MIMA]; ///<Coordenadas de las cuatro esquinas de la red
|
||||||
//*************************************************************************************
|
//*************************************************************************************
|
||||||
//Funciones
|
//Funciones
|
||||||
Colv_limp(COlivia *olv);
|
Colv_limp(COlivia *olv);
|
||||||
|
|
|
||||||
|
|
@ -535,7 +535,6 @@ typedef struct th_param_planif
|
||||||
/*
|
/*
|
||||||
* Para revisar la elevación de las carreteras y borrar uniones que no debería haber por estar a distinta elevación
|
* Para revisar la elevación de las carreteras y borrar uniones que no debería haber por estar a distinta elevación
|
||||||
*/
|
*/
|
||||||
#define INFO_ASO_NW_NO_ELEV 0
|
|
||||||
enum INFO_ASO_NW_NODOS
|
enum INFO_ASO_NW_NODOS
|
||||||
{
|
{
|
||||||
FROM = 0,
|
FROM = 0,
|
||||||
|
|
@ -562,6 +561,17 @@ enum INFO_ASO_NW_ELEV
|
||||||
N_ELEV = 2
|
N_ELEV = 2
|
||||||
};
|
};
|
||||||
/*
|
/*
|
||||||
|
* Para revisar coordenadas min y max
|
||||||
|
*/
|
||||||
|
enum COORDENADAS_MIMA
|
||||||
|
{
|
||||||
|
XMIN = 0,
|
||||||
|
XMAX = 1,
|
||||||
|
YMIN = 2,
|
||||||
|
YMAX = 3,
|
||||||
|
N_COOR_MIMA
|
||||||
|
};
|
||||||
|
/*
|
||||||
* Estructura para almacenar nodos que están a distinta elevación
|
* Estructura para almacenar nodos que están a distinta elevación
|
||||||
*/
|
*/
|
||||||
typedef struct Info_aso_conj_elev_aux
|
typedef struct Info_aso_conj_elev_aux
|
||||||
|
|
@ -603,6 +613,7 @@ typedef struct th_param_dist_elev
|
||||||
int id_th;//indica al thread el id que tiene
|
int id_th;//indica al thread el id que tiene
|
||||||
int n_nw;
|
int n_nw;
|
||||||
int milis_sleep;
|
int milis_sleep;
|
||||||
|
double coor_mima[N_COOR_MIMA];
|
||||||
th_param_dist_elev_thr *conj_th;
|
th_param_dist_elev_thr *conj_th;
|
||||||
std::vector<Info_aso_nw_elev> iaso_elev; ///<Map con mismos elementos que la nw, con la info de elevación de los nodos, cada thr su copia
|
std::vector<Info_aso_nw_elev> iaso_elev; ///<Map con mismos elementos que la nw, con la info de elevación de los nodos, cada thr su copia
|
||||||
}th_param_dist_elev;
|
}th_param_dist_elev;
|
||||||
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
UINT th_planificacion(LPVOID pp);
|
UINT th_planificacion(LPVOID pp);
|
||||||
UINT th_busca_elev_dist(LPVOID pp);
|
UINT th_busca_elev_dist(LPVOID pp);
|
||||||
|
BOOL is_pto_dentro(double* pto, double* pto_mima);
|
||||||
/**
|
/**
|
||||||
* @file olv_limp_thr.cpp
|
* @file olv_limp_thr.cpp
|
||||||
* Archivo de implementaciones del thread de control de la utilidad de limpieza viaria del programa Olivia.
|
* Archivo de implementaciones del thread de control de la utilidad de limpieza viaria del programa Olivia.
|
||||||
|
|
@ -1433,6 +1434,104 @@ UINT th_busca_elev_dist(LPVOID pp)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//*************************************************************************************
|
//*************************************************************************************
|
||||||
|
/**
|
||||||
|
* Thread para cálculo multiproceso de búsqueda de nodos a distinta elevación
|
||||||
|
*/
|
||||||
|
UINT th_busca_elev_dist_coor(LPVOID pp)
|
||||||
|
{
|
||||||
|
th_param_dist_elev* p = (th_param_dist_elev*)pp;
|
||||||
|
int ithr = p->id_th;
|
||||||
|
|
||||||
|
Info_aso_conj_elev conj_elev_i1;
|
||||||
|
Info_aso_conj_elev_aux conj_elev_nw_i1, conj_elev_nw_i2;
|
||||||
|
int i1, i2, elev1, elev2, it2;
|
||||||
|
Info_aso_nw_elev* info1, * info2;
|
||||||
|
std::vector<Info_aso_conj_elev> conj_elev_i;
|
||||||
|
|
||||||
|
double xdesp = (p->coor_mima[XMAX]-p->coor_mima[XMIN]) / p->nth_tot;
|
||||||
|
double xmin = min(p->coor_mima[XMIN] + ithr * xdesp, p->coor_mima[XMAX]);
|
||||||
|
double xmax = min(xmin + xdesp, p->coor_mima[XMAX]);
|
||||||
|
double pto_mima[N_COOR_MIMA];
|
||||||
|
pto_mima[XMIN] = xmin;
|
||||||
|
pto_mima[XMAX] = xmax;
|
||||||
|
pto_mima[YMIN] = p->coor_mima[YMIN];
|
||||||
|
pto_mima[YMAX] = p->coor_mima[YMAX];
|
||||||
|
|
||||||
|
//avisa de que ya empieza
|
||||||
|
p->id_th = -1;
|
||||||
|
|
||||||
|
for (int in = 0; in < p->n_nw && !p->pirate; in++)
|
||||||
|
{
|
||||||
|
info1 = &((p->iaso_elev)[in]);
|
||||||
|
for (i1 = 0; i1 < N_NODOS; i1++)
|
||||||
|
{
|
||||||
|
if (!is_pto_dentro(info1->coord[i1], pto_mima))
|
||||||
|
continue;
|
||||||
|
conj_elev_i1.conj_nw[MISMA_ELEV].clear();
|
||||||
|
conj_elev_i1.conj_nw[DIST_ELEV].clear();
|
||||||
|
for (it2 = 0; it2 < p->n_nw && !p->pirate; it2++)
|
||||||
|
{
|
||||||
|
info2 = &((p->iaso_elev)[it2]);
|
||||||
|
if (info2->i_nw == info1->i_nw)
|
||||||
|
{
|
||||||
|
continue;//mismo elemento
|
||||||
|
}
|
||||||
|
for (i2 = 0; i2 < N_NODOS; i2++)
|
||||||
|
{
|
||||||
|
if (!is_pto_dentro(info2->coord[i2], pto_mima))
|
||||||
|
continue;
|
||||||
|
if ((Colv_geom::pto_equals(info1->coord[i1], info2->coord[i2]))) //if (info1->inod[i1] == info2->inod[i2])
|
||||||
|
{
|
||||||
|
//comparten nodo, revisa elevación
|
||||||
|
conj_elev_nw_i2.set(info2->i_nw, i2);
|
||||||
|
if (info1->elev[i1] != info2->elev[i2])
|
||||||
|
{
|
||||||
|
//distinta elevación
|
||||||
|
//añade i2
|
||||||
|
conj_elev_i1.conj_nw[DIST_ELEV].push_back(conj_elev_nw_i2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//misma elev
|
||||||
|
conj_elev_i1.conj_nw[MISMA_ELEV].push_back(conj_elev_nw_i2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
///////////////////////////////////////
|
||||||
|
}
|
||||||
|
//solo los almacena si tiene alguno en dist elev, si todos son la misma, no
|
||||||
|
if (conj_elev_i1.conj_nw[DIST_ELEV].size() > 0)
|
||||||
|
{
|
||||||
|
//se añade a sí mismo
|
||||||
|
conj_elev_nw_i1.set(info1->i_nw, i1);
|
||||||
|
conj_elev_i1.conj_nw[MISMA_ELEV].push_back(conj_elev_nw_i1);
|
||||||
|
sprintf_s(conj_elev_i1.key_coord, 64, "%lf-%lf", info1->coord[i1][0], info1->coord[i1][1]);
|
||||||
|
conj_elev_i.push_back(conj_elev_i1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
p->conj_th[ithr].conj_elev_i = conj_elev_i;
|
||||||
|
//salida de thread-------------------------
|
||||||
|
lck_sum_atm(&p->nth, -1);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
//*************************************************************************************
|
||||||
|
/*
|
||||||
|
* Comprueba si pto está dentro de mima
|
||||||
|
*/
|
||||||
|
BOOL is_pto_dentro(double* pto, double* pto_mima)
|
||||||
|
{
|
||||||
|
//comprueba x
|
||||||
|
if (pto[0] >= pto_mima[XMIN] && pto[0] < pto_mima[XMAX])
|
||||||
|
{
|
||||||
|
//coprueba y
|
||||||
|
if (pto[1] >= pto_mima[YMIN] && pto[1] <= pto_mima[YMAX])
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
//*************************************************************************************
|
||||||
#define MUEVE_COOR_METROS 5
|
#define MUEVE_COOR_METROS 5
|
||||||
/**
|
/**
|
||||||
* Mueve las coordenadas de una conjunción de las que tienen distinta elevación
|
* Mueve las coordenadas de una conjunción de las que tienen distinta elevación
|
||||||
|
|
@ -9758,10 +9857,12 @@ BOOL Colv_limp_thr::genera_list_rut_ctrl()
|
||||||
//apunta a otro ámbito de la red, busca carretera
|
//apunta a otro ámbito de la red, busca carretera
|
||||||
int ref_nw = pp->elem[i].ref_nw;
|
int ref_nw = pp->elem[i].ref_nw;
|
||||||
BOOL sdire=false;
|
BOOL sdire=false;
|
||||||
while ((ref_nw>0) && (olv_limp->iaso[ref_nw].flgs & OLV_LIMP_FLG_AMB))
|
int nveces = 0;
|
||||||
|
while ((ref_nw>0) && (olv_limp->iaso[ref_nw].flgs & OLV_LIMP_FLG_AMB) && (nveces<5))
|
||||||
{
|
{
|
||||||
ref_nw= olv_limp->inww_amb[ref_nw + !sdire * olv_limp->n_amb].refnw;
|
ref_nw= olv_limp->inww_amb[ref_nw + !sdire * olv_limp->n_amb].refnw;
|
||||||
sdire = !sdire && (olv_limp->tipo_ambit== OLV_AMB_LIN);
|
sdire = !sdire && (olv_limp->tipo_ambit== OLV_AMB_LIN);
|
||||||
|
nveces++;
|
||||||
}
|
}
|
||||||
if((olv_limp->iaso[ref_nw].flgs & OLV_LIMP_FLG_NW) && olv_limp->iaso[ref_nw].inf_n.nomb)
|
if((olv_limp->iaso[ref_nw].flgs & OLV_LIMP_FLG_NW) && olv_limp->iaso[ref_nw].inf_n.nomb)
|
||||||
strcpy_s(calle, 1024, olv_limp->iaso[ref_nw].inf_n.nomb);
|
strcpy_s(calle, 1024, olv_limp->iaso[ref_nw].inf_n.nomb);
|
||||||
|
|
|
||||||
|
|
@ -51,8 +51,8 @@ namespace OliviaDef
|
||||||
public const int ProgrMax = 100;
|
public const int ProgrMax = 100;
|
||||||
public const int ProgrStep = 5;
|
public const int ProgrStep = 5;
|
||||||
public const int ParamN = 5;
|
public const int ParamN = 5;
|
||||||
public const int ParamLimpN = 48;
|
public const int ParamLimpN = 52;
|
||||||
public const int ParamRecoN = 46;
|
public const int ParamRecoN = 50;
|
||||||
/*
|
/*
|
||||||
* Define el separador entre parámetros de la llamada al proceso oliviatasks
|
* Define el separador entre parámetros de la llamada al proceso oliviatasks
|
||||||
*/
|
*/
|
||||||
|
|
@ -533,6 +533,11 @@ namespace OliviaDef
|
||||||
public const string GTO_camp_objectid = "Camp_objectid";
|
public const string GTO_camp_objectid = "Camp_objectid";
|
||||||
public const string GTO_camp_sector = "Camp_sector";
|
public const string GTO_camp_sector = "Camp_sector";
|
||||||
public const string GTO_camp_secuencia = "Camp_secuencia";
|
public const string GTO_camp_secuencia = "Camp_secuencia";
|
||||||
|
//mima
|
||||||
|
public const string GTO_mima_xmin = "Coor_mima_xmin";
|
||||||
|
public const string GTO_mima_xmax = "Coor_mima_xmax";
|
||||||
|
public const string GTO_mima_ymin = "Coor_mima_ymin";
|
||||||
|
public const string GTO_mima_ymax = "Coor_mima_ymax";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define el nombre para mandar a oliviatasks la configuración
|
* Define el nombre para mandar a oliviatasks la configuración
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue