diff --git a/Olivia/olv_limp_thr.cpp b/Olivia/olv_limp_thr.cpp index 4877d31..859b8f2 100644 --- a/Olivia/olv_limp_thr.cpp +++ b/Olivia/olv_limp_thr.cpp @@ -1002,6 +1002,10 @@ BOOL Colv_limp_thr::rellena_info_amb() if(olv_limp->tipo_ambit==OLV_AMB_PUN) return TRUE; + BOOL sigue_msg = TRUE; + char msg_[OLV_MAX_MSG_PROCE]; + msg_[0] = 0; + //cuando se ha enviado eje de calle, no se lee info asociada porque la tabla es de tomotom, no tiene info //tipo entidad ni nada.. if((olv_limp->uds_tto==OliviaDef::GeneralDef::OlvTipTtoMh_eje) || @@ -1137,9 +1141,19 @@ BOOL Colv_limp_thr::rellena_info_amb() if(!olv_limp->barr_mix) olv_limp->barr_mix=(barr_mix & (OLV_LIMP_FLG_AMB_APA | OLV_LIMP_FLG_AMB_BORD)) && (barr_mix & OLV_LIMP_FLG_AMB_ACE); } - if(icampoid>=0) + if (icampoid >= 0) + { olv_limp->iaso[ia].oid = dbf.getI(icampoid); + //imprime + if (msg_[0] == 0) + sprintf_s(msg_, OLV_MAX_MSG_PROCE, "Recibidos ámbitos con oids: "); + if (sigue_msg) + sprintf_s(msg_, OLV_MAX_MSG_PROCE, "%s %ld,", msg_, olv_limp->iaso[ia].oid); + if (sigue_msg && strlen(msg_) + 10 >= OLV_MAX_MSG_PROCE) + sigue_msg = FALSE;//para que no se pase del largo + } + ia++; idd =dbf.leeNexRow(); } @@ -1152,6 +1166,15 @@ BOOL Colv_limp_thr::rellena_info_amb() ret=FALSE; goto fin; } + + if (!sigue_msg && ((strlen(msg_) + 5) < OLV_MAX_MSG_PROCE)) + sprintf_s(msg_, "%s %s", msg_, "y mas"); + if (msg_[0] != 0) + { + pon_mi_msg(msg_); + Sleep(OLV_T_SLEEP_MSG); + } + olvlog(LOG_TODO,"olv_limp_t","Finaliza Matriz de info asociada a ámbitos"); fin: @@ -7038,7 +7061,7 @@ BOOL Colv_limp_thr::planifica() memset(olv_limp->plan,0,olv_limp->nsec*sizeof(Info_planif)); //lanza los threads - lanza_subthrs(OLV_LIMP_EV_PLANIFICA_SUB,1); + lanza_subthrs(OLV_LIMP_EV_PLANIFICA_SUB); return TRUE; } diff --git a/Olivia/olv_reco_thr.cpp b/Olivia/olv_reco_thr.cpp index b619e84..c1670c7 100644 --- a/Olivia/olv_reco_thr.cpp +++ b/Olivia/olv_reco_thr.cpp @@ -155,6 +155,10 @@ BOOL Colv_reco_thr::rellena_datos() uds=kg=capa=id=0; + BOOL sigue_msg = TRUE; + char msg_[OLV_MAX_MSG_PROCE]; + msg_[0] = 0; + //lee dbf del shp strcpy_s(nfile,MAX_PATH,olv->paths.path_data); //cambiaext(nfile,".shp",".dbf"); @@ -283,9 +287,19 @@ BOOL Colv_reco_thr::rellena_datos() } } - if(icampoid>=0) + if (icampoid >= 0) + { olv_limp->iaso[ia].oid = dbf.getI(icampoid); + //imprime + if (msg_[0] == 0) + sprintf_s(msg_, OLV_MAX_MSG_PROCE, "Recibidos ámbitos con oids: "); + if (sigue_msg) + sprintf_s(msg_, OLV_MAX_MSG_PROCE, "%s %ld,", msg_, olv_limp->iaso[ia].oid); + if (sigue_msg && strlen(msg_) + 10 >= OLV_MAX_MSG_PROCE) + sigue_msg = FALSE;//para que no se pase del largo + } + //olvlog(LOG_TODO,"olv_limp_t","Rellena %0d %3.1f %ld %04d",ia, kg_,uds_,olv_limp->iaso[ia].oid); /////////////////////////////// @@ -308,6 +322,14 @@ BOOL Colv_reco_thr::rellena_datos() goto fin; } + if (!sigue_msg && ((strlen(msg_) + 5) < OLV_MAX_MSG_PROCE)) + sprintf_s(msg_, "%s %s", msg_, "y mas"); + if (msg_[0] != 0) + { + pon_mi_msg(msg_); + Sleep(OLV_T_SLEEP_MSG); + } + olvlog(LOG_TODO,"olv_limp_t","Finaliza Matriz de info asociada a ámbitos"); fin: @@ -1178,19 +1200,34 @@ void Colv_reco_thr::planifica_sub_1(int ithr, Matrix2d &cost_amb) s->cost_despl_aux=0; sig=FALSE; - //busca el ámbito inicial de la planificiación - secu_ambi=planifica_sect(s,olv_limp->ang_conj,OLV_LIMP_FACT_PERM); - if(!secu_ambi) + //si venía secuencia en el archivo, se utiliza esa + if (olv_limp->usa_secuen) { - olvlog(LOG_TODO,"olv_limp_t","Subthr %ld, Imposible planificar sector %02d",ithr,is); - sal=TRUE; - continue; + secu_ambi = planifica_sect_dada_secuen(s); + if (!secu_ambi) + { + olvlog(LOG_TODO, "olv_limp_t", "Subthr %ld, Imposible planificar sector %02d", ithr, is); + sal = TRUE; + continue; + } } - if(esta_repe(secu_ambi, s->namb)) + else { - olvlog(LOG_TODO,"olv_limp_t","Esta repe despues de planifica sec"); - sal=TRUE; - continue; + //si no venía, se planifica el sector + //busca el ámbito inicial de la planificiación + secu_ambi = planifica_sect(s, olv_limp->ang_conj, OLV_LIMP_FACT_PERM); + if (!secu_ambi) + { + olvlog(LOG_TODO, "olv_limp_t", "Subthr %ld, Imposible planificar sector %02d", ithr, is); + sal = TRUE; + continue; + } + if (esta_repe(secu_ambi, s->namb)) + { + olvlog(LOG_TODO, "olv_limp_t", "Esta repe despues de planifica sec"); + sal = TRUE; + continue; + } } nvac=0; s->cost_despl_aux=(float)dame_coste_pon_viajes(secu_ambi,0,s->namb-1,s,&nvac);