Algunos avances para hacer columnas tipo número en vez de string
parent
e016a30829
commit
2885e59b2d
|
|
@ -28,7 +28,7 @@ _ReSharper*/
|
|||
.vs/
|
||||
#Nuget packages folder
|
||||
packages/
|
||||
x64*/
|
||||
/x64*/
|
||||
Olivia/x64*/
|
||||
Olivia/[Rr]elease*/
|
||||
Olivia/[Dd]ebug*/
|
||||
|
|
@ -37,4 +37,4 @@ OliviaTasks/[Rr]elease*/
|
|||
OliviaTasks/[Dd]ebug*/
|
||||
lib/
|
||||
bin/
|
||||
bin/
|
||||
bin/x64
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@
|
|||
#define OLV_TOMTOM_PEDESTRIAN 14
|
||||
#define OLV_NOMB_OID "OBJECTID"
|
||||
#define OLV_SHP_SZ_CAMP_CHAR 32
|
||||
#define OLV_SHP_SZ_CAMP_SZ 32 //sizeof(double)
|
||||
#define OLV_DIF_MAX_MISMA_COOR 0.01
|
||||
//defines para ini de configuracion campos dbf-------------------------
|
||||
#define OLV_LIMP_GRUPO_DBF "CONF_CAMPOS_DBF"
|
||||
|
|
|
|||
|
|
@ -6338,7 +6338,7 @@ BOOL Colv_limp_thr::pon_estado( int namb,int n_sec, Info_amb_sec *aa, Info_sec *
|
|||
for (i=0; i<n_sec; i++)
|
||||
{
|
||||
ss[i].namb=0;
|
||||
ss[i].sec_def=-1;
|
||||
//ss[i].sec_def=-1; //no lo borra porque ahí tiene guardada la info de qué sector es fuera, siempre será la misma
|
||||
ss[i].flags_tem=0;
|
||||
ss[i].cost_ac=0;
|
||||
ss[i].cost_despl_aux=0;
|
||||
|
|
@ -6570,7 +6570,7 @@ BOOL Colv_limp_thr::lee_secto()
|
|||
Cb_file f;
|
||||
Fdbf dbf;
|
||||
|
||||
|
||||
ret = TRUE;
|
||||
std::map<int,std::vector<int>> l_sec;
|
||||
|
||||
olvlog(LOG_TODO,"olv_limp_t","Comienza lectura de sectorización");
|
||||
|
|
@ -7623,7 +7623,7 @@ BOOL Colv_limp_thr::genera_rut_ctrl(int ns, Info_planif *planif, BOOL tramos)
|
|||
|
||||
for(i=0;i<olv_limp->npts_ctrl;i++)
|
||||
{
|
||||
pt.ia=is+1;
|
||||
pt.ia= olv_limp->sec[is].sec_def;
|
||||
memset(pt.pt,0,3*sizeof(double));
|
||||
if(pp->nelem>0)
|
||||
{
|
||||
|
|
@ -7760,7 +7760,7 @@ BOOL Colv_limp_thr::genera_rut_aux(Info_planif *pp, int is, BOOL is_insta, int i
|
|||
lin.addPto(olv_limp->carto.getPto(0));
|
||||
lin.addPto(olv_limp->carto.getPto(0));
|
||||
}
|
||||
lin.ia=is+1;
|
||||
lin.ia=olv_limp->sec[is].sec_def;
|
||||
if(!rut->add(lin))
|
||||
{
|
||||
return FALSE;
|
||||
|
|
@ -7777,7 +7777,7 @@ BOOL Colv_limp_thr::genera_rut_aux(Info_planif *pp, int is, BOOL is_insta, int i
|
|||
lin_fl.pts+=2;
|
||||
lin_fl.pts.n=2;
|
||||
pts_lin_fl = lin_fl.pts.ptr;
|
||||
lin_fl.ia=is+1;
|
||||
lin_fl.ia= olv_limp->sec[is].sec_def;
|
||||
if(pp->nelem==0 && !is_insta)
|
||||
{
|
||||
lin_fl.addPto(olv_limp->carto.getPto(0));
|
||||
|
|
@ -7930,20 +7930,6 @@ BOOL Colv_limp_thr::gen_guard_subtramos()
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/*/////////////////////////////////////////////
|
||||
//A continuación sobreescribe los archivos de las flechas
|
||||
strcpy_s(path_shp,MAX_PATH,olv_limp->olv->paths.path_res_rut);
|
||||
//cambiaext(path_shp,".shp","");
|
||||
*(Cdir_manager::extension_archivo(path_shp)-1)=0;
|
||||
|
||||
strcat_s(path_shp,"_Raux.shp");
|
||||
carto_flech.setNameIa(olv_limp->camps.campo_secto);
|
||||
if(!carto_flech.exportShp(path_shp))
|
||||
{
|
||||
pon_mi_msg("Errores en el guardado del shp de la capa de viajes aux");
|
||||
return FALSE;
|
||||
}*/
|
||||
|
||||
//guarda en los ámbitos una columna de "tramo al que pertenecen"
|
||||
if(!guarda_dbf_sector(3))
|
||||
{
|
||||
|
|
@ -8027,12 +8013,12 @@ BOOL Colv_limp_thr::guarda_cols_ruta_tram(char *path_shp)
|
|||
strcpy_s(path_dbf,MAX_PATH,path_shp);
|
||||
//cambiaext(path_dbf,".shp",".dbf");
|
||||
strcpy((Cdir_manager::extension_archivo(path_dbf)),"dbf");
|
||||
info = (char *)malloc(ntram*OLV_SHP_SZ_CAMP_CHAR*2); //x2 porque se va a usar el mismo array para guardar int y double
|
||||
info = (char *)malloc(ntram* OLV_SHP_SZ_CAMP_SZ);
|
||||
if(!info)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,ntram*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,ntram* OLV_SHP_SZ_CAMP_SZ);
|
||||
AddColsDbf dataDbf(info);
|
||||
|
||||
//SECTOR ya viene
|
||||
|
|
@ -8055,7 +8041,7 @@ BOOL Colv_limp_thr::guarda_cols_ruta_tram(char *path_shp)
|
|||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,ntram*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,ntram* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
//VIAJE
|
||||
nt_parc=0;
|
||||
|
|
@ -8067,16 +8053,16 @@ BOOL Colv_limp_thr::guarda_cols_ruta_tram(char *path_shp)
|
|||
for(it=0;it<nt;it++)
|
||||
{
|
||||
tt=it+1;
|
||||
sprintf_s(&info[(nt_parc+it)*OLV_SHP_SZ_CAMP_CHAR],OLV_SHP_SZ_CAMP_CHAR,"%ld",(int)tt);
|
||||
((int*)info)[nt_parc + it] = tt;
|
||||
}
|
||||
nt_parc+=nt;
|
||||
}
|
||||
if(!dbfmgr.AddCol(path_dbf,"VIAJE",GdataTable::Tstring,&dataDbf,OLV_SHP_SZ_CAMP_CHAR))
|
||||
if(!dbfmgr.AddCol(path_dbf,"VIAJE",GdataTable::Tint,&dataDbf))
|
||||
{
|
||||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,ntram*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,ntram* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
//H_INI
|
||||
nt_parc=0;
|
||||
|
|
@ -8098,7 +8084,7 @@ BOOL Colv_limp_thr::guarda_cols_ruta_tram(char *path_shp)
|
|||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,ntram*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,ntram* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
//H_FIN
|
||||
nt_parc=0;
|
||||
|
|
@ -8120,7 +8106,7 @@ BOOL Colv_limp_thr::guarda_cols_ruta_tram(char *path_shp)
|
|||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,ntram*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,ntram* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
//T_TOTAL
|
||||
nt_parc=0;
|
||||
|
|
@ -8142,7 +8128,7 @@ BOOL Colv_limp_thr::guarda_cols_ruta_tram(char *path_shp)
|
|||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,ntram*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,ntram* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
//T_TTO
|
||||
nt_parc=0;
|
||||
|
|
@ -8164,7 +8150,7 @@ BOOL Colv_limp_thr::guarda_cols_ruta_tram(char *path_shp)
|
|||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,ntram*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,ntram* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -8285,7 +8271,7 @@ BOOL Colv_limp_thr::combina_rut_insta()
|
|||
{
|
||||
pp=&planif[is];
|
||||
nt=(int)olv_limp->tramos[is].size();
|
||||
lin.ia=is+1;
|
||||
lin.ia= olv_limp->sec[is].sec_def;
|
||||
lin.pts.n=0;
|
||||
for(it=0;it<nt && !mal;it++)
|
||||
{
|
||||
|
|
@ -8392,12 +8378,12 @@ BOOL Colv_limp_thr::guarda_cols_ruta(char *path_shp)
|
|||
strcpy_s(path_dbf,MAX_PATH,path_shp);
|
||||
//cambiaext(path_dbf,".shp",".dbf");
|
||||
strcpy((Cdir_manager::extension_archivo(path_dbf)),"dbf");
|
||||
info = (char *)malloc(nsec*OLV_SHP_SZ_CAMP_CHAR);
|
||||
info = (char *)malloc(nsec* OLV_SHP_SZ_CAMP_SZ);
|
||||
if(!info)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,nsec*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,nsec* OLV_SHP_SZ_CAMP_SZ);
|
||||
AddColsDbf dataDbf(info);
|
||||
|
||||
//SECTOR ya viene
|
||||
|
|
@ -8417,7 +8403,7 @@ BOOL Colv_limp_thr::guarda_cols_ruta(char *path_shp)
|
|||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,nsec*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,nsec* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
//rellena la info de hora inicial
|
||||
isec_novac=0;
|
||||
|
|
@ -8437,7 +8423,7 @@ BOOL Colv_limp_thr::guarda_cols_ruta(char *path_shp)
|
|||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,nsec*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,nsec* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
//rellena la info de hora final
|
||||
isec_novac=0;
|
||||
|
|
@ -8458,7 +8444,7 @@ BOOL Colv_limp_thr::guarda_cols_ruta(char *path_shp)
|
|||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,nsec*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,nsec* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
//rellena la info de duración total
|
||||
isec_novac=0;
|
||||
|
|
@ -8476,7 +8462,7 @@ BOOL Colv_limp_thr::guarda_cols_ruta(char *path_shp)
|
|||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,nsec*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,nsec* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
//rellena la info de duración de los desplazamientos
|
||||
isec_novac=0;
|
||||
|
|
@ -8494,7 +8480,7 @@ BOOL Colv_limp_thr::guarda_cols_ruta(char *path_shp)
|
|||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,nsec*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,nsec* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
//rellena la info de duración de los descansos
|
||||
isec_novac=0;
|
||||
|
|
@ -8512,7 +8498,7 @@ BOOL Colv_limp_thr::guarda_cols_ruta(char *path_shp)
|
|||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,nsec*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,nsec* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
//rellena la info de duración de la ruta
|
||||
isec_novac=0;
|
||||
|
|
@ -8530,7 +8516,7 @@ BOOL Colv_limp_thr::guarda_cols_ruta(char *path_shp)
|
|||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,nsec*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,nsec* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
//rellena la info de longitud de la ruta
|
||||
isec_novac=0;
|
||||
|
|
@ -8539,25 +8525,35 @@ BOOL Colv_limp_thr::guarda_cols_ruta(char *path_shp)
|
|||
if(olv_limp->sec[i].namb==0)
|
||||
continue;
|
||||
tt=olv_limp->plan[i].m[0]+olv_limp->plan[i].m[1];
|
||||
sprintf_s(&info[isec_novac*OLV_SHP_SZ_CAMP_CHAR],OLV_SHP_SZ_CAMP_CHAR,"%.2f",tt);
|
||||
//para guardar en número
|
||||
((double*)info)[isec_novac] = tt;
|
||||
|
||||
isec_novac++;
|
||||
}
|
||||
if(!dbfmgr.AddCol(path_dbf,"M_RUTA",GdataTable::Tstring,&dataDbf,OLV_SHP_SZ_CAMP_CHAR))
|
||||
if(!dbfmgr.AddCol(path_dbf,"M_RUTA",GdataTable::Tdouble,&dataDbf))
|
||||
{
|
||||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,nsec*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,nsec* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
//rellena primero T DESP, M DESP, VELO DESP, T TRAT, M TRAT, VELO/T TRAT
|
||||
int p;
|
||||
int tipodato, sz;
|
||||
tipodato = GdataTable::Tstring;
|
||||
sz = OLV_SHP_SZ_CAMP_CHAR;
|
||||
for(int k=0;k<OLV_DT_N;k++)
|
||||
{
|
||||
for(p=0;p<3;p++)
|
||||
{
|
||||
tt = 0;
|
||||
sz = 0;
|
||||
isec_novac=0;
|
||||
if(p==0)
|
||||
if(p==0) //T
|
||||
{
|
||||
tipodato = GdataTable::Tstring;
|
||||
sz = OLV_SHP_SZ_CAMP_CHAR;
|
||||
|
||||
strcpy_s(nombia,"T_");
|
||||
|
||||
//rellena la info de h
|
||||
|
|
@ -8571,7 +8567,7 @@ BOOL Colv_limp_thr::guarda_cols_ruta(char *path_shp)
|
|||
isec_novac++;
|
||||
}
|
||||
}
|
||||
else if(p==1)
|
||||
else if(p==1) //M/M2/UDS
|
||||
{
|
||||
if(k==OLV_TTO)
|
||||
{
|
||||
|
|
@ -8593,7 +8589,9 @@ BOOL Colv_limp_thr::guarda_cols_ruta(char *path_shp)
|
|||
if(olv_limp->sec[i].namb==0)
|
||||
continue;
|
||||
tt=olv_limp->sec[i].namb;
|
||||
sprintf_s(&info[isec_novac*OLV_SHP_SZ_CAMP_CHAR],OLV_SHP_SZ_CAMP_CHAR,"%ld",(int)tt);
|
||||
//para guardar en número
|
||||
((int*)info)[isec_novac] = tt;
|
||||
tipodato = GdataTable::Tint;
|
||||
isec_novac++;
|
||||
}
|
||||
}
|
||||
|
|
@ -8604,13 +8602,15 @@ BOOL Colv_limp_thr::guarda_cols_ruta(char *path_shp)
|
|||
if(olv_limp->sec[i].namb==0)
|
||||
continue;
|
||||
tt=olv_limp->plan[i].m[k];
|
||||
sprintf_s(&info[isec_novac*OLV_SHP_SZ_CAMP_CHAR],OLV_SHP_SZ_CAMP_CHAR,"%.2f",tt);
|
||||
//para guardar en número
|
||||
((double*)info)[isec_novac] = tt;
|
||||
tipodato = GdataTable::Tdouble;
|
||||
isec_novac++;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(p==2)
|
||||
else if(p==2) //VELO
|
||||
{
|
||||
if(k==OLV_TTO)
|
||||
{
|
||||
|
|
@ -8635,10 +8635,20 @@ BOOL Colv_limp_thr::guarda_cols_ruta(char *path_shp)
|
|||
{
|
||||
if(olv_limp->sec[i].namb==0)
|
||||
continue;
|
||||
if(tt)
|
||||
sprintf_s(&info[isec_novac*OLV_SHP_SZ_CAMP_CHAR],OLV_SHP_SZ_CAMP_CHAR,"%.1f",tt);
|
||||
else
|
||||
|
||||
if (!tt)
|
||||
{
|
||||
tipodato = GdataTable::Tstring;
|
||||
sz = OLV_SHP_SZ_CAMP_CHAR;
|
||||
sprintf_s(&info[isec_novac * OLV_SHP_SZ_CAMP_CHAR], OLV_SHP_SZ_CAMP_CHAR, "Def. Vias");
|
||||
}
|
||||
else
|
||||
{
|
||||
//sprintf_s(&info[isec_novac * OLV_SHP_SZ_CAMP_CHAR], OLV_SHP_SZ_CAMP_CHAR, "%.1f", tt);
|
||||
((double*)info)[isec_novac] = tt;
|
||||
tipodato = GdataTable::Tdouble;
|
||||
}
|
||||
|
||||
isec_novac++;
|
||||
}
|
||||
}
|
||||
|
|
@ -8650,12 +8660,13 @@ BOOL Colv_limp_thr::guarda_cols_ruta(char *path_shp)
|
|||
{
|
||||
strcat_s(nombia,"DESP");
|
||||
}
|
||||
if(!dbfmgr.AddCol(path_dbf,nombia,GdataTable::Tstring,&dataDbf,OLV_SHP_SZ_CAMP_CHAR))
|
||||
|
||||
if(!dbfmgr.AddCol(path_dbf,nombia,tipodato,&dataDbf,sz))
|
||||
{
|
||||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,nsec*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,nsec* OLV_SHP_SZ_CAMP_SZ);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -8688,12 +8699,12 @@ BOOL Colv_limp_thr::guarda_cols_ctrl(char *path_shp)
|
|||
//cambiaext(path_dbf,".shp",".dbf");
|
||||
strcpy((Cdir_manager::extension_archivo(path_dbf)),"dbf");
|
||||
|
||||
info = (char *)malloc(nsec*olv_limp->npts_ctrl*OLV_SHP_SZ_CAMP_CHAR);
|
||||
info = (char *)malloc(nsec*olv_limp->npts_ctrl* OLV_SHP_SZ_CAMP_SZ);
|
||||
if(!info)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,nsec*olv_limp->npts_ctrl*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,nsec*olv_limp->npts_ctrl* OLV_SHP_SZ_CAMP_SZ);
|
||||
AddColsDbf dataDbf(info);
|
||||
|
||||
//rellena el nombre del tto
|
||||
|
|
@ -8717,7 +8728,7 @@ BOOL Colv_limp_thr::guarda_cols_ctrl(char *path_shp)
|
|||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,nsec*olv_limp->npts_ctrl*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,nsec*olv_limp->npts_ctrl* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
//rellena la info
|
||||
k=0;
|
||||
|
|
@ -8739,7 +8750,7 @@ BOOL Colv_limp_thr::guarda_cols_ctrl(char *path_shp)
|
|||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,nsec*olv_limp->npts_ctrl*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,nsec*olv_limp->npts_ctrl* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
//rellena la info de tiempo
|
||||
k=0;
|
||||
|
|
@ -8802,12 +8813,12 @@ BOOL Colv_limp_thr::guarda_cols_insta(char *path_shp)
|
|||
}
|
||||
}
|
||||
|
||||
info = (char *)malloc(ninsta*OLV_SHP_SZ_CAMP_CHAR);
|
||||
info = (char *)malloc(ninsta* OLV_SHP_SZ_CAMP_SZ);
|
||||
if(!info)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,ninsta*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,ninsta* OLV_SHP_SZ_CAMP_SZ);
|
||||
AddColsDbf dataDbf(info);
|
||||
|
||||
//rellena el nombre del tto
|
||||
|
|
@ -8831,7 +8842,7 @@ BOOL Colv_limp_thr::guarda_cols_insta(char *path_shp)
|
|||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,ninsta*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,ninsta* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
//rellena la info de tipo de trayecto
|
||||
ninsta_parc=0;
|
||||
|
|
@ -8871,7 +8882,7 @@ BOOL Colv_limp_thr::guarda_cols_insta(char *path_shp)
|
|||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,ninsta*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,ninsta* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
//rellena la info de tipo de hora
|
||||
ninsta_parc=0;
|
||||
|
|
@ -8911,7 +8922,7 @@ BOOL Colv_limp_thr::guarda_cols_insta(char *path_shp)
|
|||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,ninsta*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,ninsta* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
//rellena la info de duración
|
||||
ninsta_parc=0;
|
||||
|
|
@ -8937,7 +8948,7 @@ BOOL Colv_limp_thr::guarda_cols_insta(char *path_shp)
|
|||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,ninsta*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,ninsta* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
//rellena la info de longitud
|
||||
ninsta_parc=0;
|
||||
|
|
@ -8950,17 +8961,17 @@ BOOL Colv_limp_thr::guarda_cols_insta(char *path_shp)
|
|||
continue;
|
||||
|
||||
tt=olv_limp->plan[i].planif_insta[insta].m[OLV_DESP];
|
||||
sprintf_s(&info[(insta+ninsta_parc)*OLV_SHP_SZ_CAMP_CHAR],OLV_SHP_SZ_CAMP_CHAR,"%.2f",tt);
|
||||
((double*)info)[insta + ninsta_parc] = tt;
|
||||
ninsta_novac++;
|
||||
}
|
||||
ninsta_parc+=ninsta_novac;
|
||||
}
|
||||
if(!dbfmgr.AddCol(path_dbf,"M_TRAY",GdataTable::Tstring,&dataDbf,OLV_SHP_SZ_CAMP_CHAR))
|
||||
if(!dbfmgr.AddCol(path_dbf,"M_TRAY",GdataTable::Tdouble,&dataDbf))
|
||||
{
|
||||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,ninsta*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,ninsta* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
free(info);
|
||||
return TRUE;
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ public:
|
|||
{
|
||||
if(data)
|
||||
{
|
||||
memcpy(data,(void*)&info[i*OLV_SHP_SZ_CAMP_CHAR],OLV_SHP_SZ_CAMP_CHAR);
|
||||
memcpy(data,(void*)&info[i* size], size);
|
||||
}
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1611,12 +1611,12 @@ BOOL Colv_reco_thr::guarda_cols_ruta(char *path_shp)
|
|||
//cambiaext(path_dbf,".shp",".dbf");
|
||||
strcpy((Cdir_manager::extension_archivo(path_dbf)),"dbf");
|
||||
|
||||
info = (char *)malloc(nsec*OLV_SHP_SZ_CAMP_CHAR);
|
||||
info = (char *)malloc(nsec* OLV_SHP_SZ_CAMP_SZ);
|
||||
if(!info)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,nsec*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,nsec* OLV_SHP_SZ_CAMP_SZ);
|
||||
AddColsDbf dataDbf(info);
|
||||
|
||||
//sustituye la info de hora final
|
||||
|
|
@ -1638,7 +1638,7 @@ BOOL Colv_reco_thr::guarda_cols_ruta(char *path_shp)
|
|||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,nsec*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,nsec* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
//sustituye la columna de uds de tratamiento porque hay contenedores que son varias unidades
|
||||
isec_novac=0;
|
||||
|
|
@ -1649,15 +1649,16 @@ BOOL Colv_reco_thr::guarda_cols_ruta(char *path_shp)
|
|||
tt=0;
|
||||
for(j=0;j<olv_limp->sec[i].namb;j++)
|
||||
tt+=olv_limp->iaso[olv_limp->sec[i].iamb[j]].inf_r.uds;
|
||||
sprintf_s(&info[isec_novac*OLV_SHP_SZ_CAMP_CHAR],OLV_SHP_SZ_CAMP_CHAR,"%ld",(int)tt);
|
||||
//para guardar en número
|
||||
((int*)info)[isec_novac] = tt;
|
||||
isec_novac++;
|
||||
}
|
||||
if(!dbfmgr.AddCol(path_dbf,"UDS_TRAT",GdataTable::Tstring,&dataDbf,OLV_SHP_SZ_CAMP_CHAR))
|
||||
if(!dbfmgr.AddCol(path_dbf,"UDS_TRAT",GdataTable::Tint,&dataDbf))
|
||||
{
|
||||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,nsec*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,nsec* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
//Kg recogidos
|
||||
isec_novac=0;
|
||||
|
|
@ -1666,15 +1667,16 @@ BOOL Colv_reco_thr::guarda_cols_ruta(char *path_shp)
|
|||
if(olv_limp->sec[i].namb==0)
|
||||
continue;
|
||||
tt=olv_limp->sec[i].dis_med;
|
||||
sprintf_s(&info[isec_novac*OLV_SHP_SZ_CAMP_CHAR],OLV_SHP_SZ_CAMP_CHAR,"%.1f",tt);
|
||||
//para guardar en número
|
||||
((double*)info)[isec_novac] = tt;
|
||||
isec_novac++;
|
||||
}
|
||||
if(!dbfmgr.AddCol(path_dbf,"KG_TOT_REC",GdataTable::Tstring,&dataDbf,OLV_SHP_SZ_CAMP_CHAR))
|
||||
if(!dbfmgr.AddCol(path_dbf,"KG_TOT_REC",GdataTable::Tdouble,&dataDbf))
|
||||
{
|
||||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,nsec*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,nsec* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
//número de descargas
|
||||
isec_novac=0;
|
||||
|
|
@ -1683,15 +1685,16 @@ BOOL Colv_reco_thr::guarda_cols_ruta(char *path_shp)
|
|||
if(olv_limp->sec[i].namb==0)
|
||||
continue;
|
||||
tt=(olv_limp->plan[i].ninsta-1)/2;
|
||||
sprintf_s(&info[isec_novac*OLV_SHP_SZ_CAMP_CHAR],OLV_SHP_SZ_CAMP_CHAR,"%ld",(int)tt);
|
||||
//para guardar en número
|
||||
((int*)info)[isec_novac] = tt;
|
||||
isec_novac++;
|
||||
}
|
||||
if(!dbfmgr.AddCol(path_dbf,"N_DESCARG",GdataTable::Tstring,&dataDbf,OLV_SHP_SZ_CAMP_CHAR))
|
||||
if(!dbfmgr.AddCol(path_dbf,"N_DESCARG",GdataTable::Tint,&dataDbf))
|
||||
{
|
||||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,nsec*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,nsec* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
//rellena la info de duración de los desplazamientos a descargar
|
||||
isec_novac=0;
|
||||
|
|
@ -1717,7 +1720,7 @@ BOOL Colv_reco_thr::guarda_cols_ruta(char *path_shp)
|
|||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,nsec*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,nsec* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
free(info);
|
||||
return TRUE;
|
||||
|
|
@ -1756,12 +1759,12 @@ BOOL Colv_reco_thr::guarda_cols_insta(char *path_shp)
|
|||
//cambiaext(path_dbf,".shp",".dbf");
|
||||
strcpy((Cdir_manager::extension_archivo(path_dbf)),"dbf");
|
||||
|
||||
info = (char *)malloc(ninsta*OLV_SHP_SZ_CAMP_CHAR);
|
||||
info = (char *)malloc(ninsta* OLV_SHP_SZ_CAMP_SZ);
|
||||
if(!info)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,ninsta*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,ninsta* OLV_SHP_SZ_CAMP_SZ);
|
||||
AddColsDbf dataDbf(info);
|
||||
|
||||
//kg descargados
|
||||
|
|
@ -1779,17 +1782,17 @@ BOOL Colv_reco_thr::guarda_cols_insta(char *path_shp)
|
|||
else
|
||||
tt=0;
|
||||
|
||||
sprintf_s(&info[(insta+ninsta_parc)*OLV_SHP_SZ_CAMP_CHAR],OLV_SHP_SZ_CAMP_CHAR,"%.1f",tt);
|
||||
((double*)info)[insta + ninsta_parc] = tt;
|
||||
ninsta_novac++;
|
||||
}
|
||||
ninsta_parc+=ninsta_novac;
|
||||
}
|
||||
if(!dbfmgr.AddCol(path_dbf,"KG_DESCARG",GdataTable::Tstring,&dataDbf,OLV_SHP_SZ_CAMP_CHAR))
|
||||
if(!dbfmgr.AddCol(path_dbf,"KG_DESCARG",GdataTable::Tdouble,&dataDbf))
|
||||
{
|
||||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,ninsta*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,ninsta* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
//num de trayecto a descargar
|
||||
ninsta_parc=0;
|
||||
|
|
@ -1814,18 +1817,17 @@ BOOL Colv_reco_thr::guarda_cols_insta(char *path_shp)
|
|||
tt=tt2;
|
||||
else
|
||||
tt=0;
|
||||
|
||||
sprintf_s(&info[(insta+ninsta_parc)*OLV_SHP_SZ_CAMP_CHAR],OLV_SHP_SZ_CAMP_CHAR,"%ld",(int)tt);
|
||||
((int*)info)[insta + ninsta_parc] = tt;
|
||||
ninsta_novac++;
|
||||
}
|
||||
ninsta_parc+=ninsta_novac;
|
||||
}
|
||||
if(!dbfmgr.AddCol(path_dbf,"VIAJE",GdataTable::Tstring,&dataDbf,OLV_SHP_SZ_CAMP_CHAR))
|
||||
if(!dbfmgr.AddCol(path_dbf,"VIAJE",GdataTable::Tint,&dataDbf))
|
||||
{
|
||||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,ninsta*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,ninsta* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
free(info);
|
||||
return TRUE;
|
||||
|
|
@ -1869,12 +1871,12 @@ BOOL Colv_reco_thr::guarda_cols_ruta_tram(char *path_shp)
|
|||
//cambiaext(path_dbf,".shp",".dbf");
|
||||
strcpy((Cdir_manager::extension_archivo(path_dbf)),"dbf");
|
||||
|
||||
info = (char *)malloc(ntram*OLV_SHP_SZ_CAMP_CHAR);
|
||||
info = (char *)malloc(ntram* OLV_SHP_SZ_CAMP_SZ);
|
||||
if(!info)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,ntram*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,ntram* OLV_SHP_SZ_CAMP_SZ);
|
||||
AddColsDbf dataDbf(info);
|
||||
|
||||
//M_DESP
|
||||
|
|
@ -1887,16 +1889,16 @@ BOOL Colv_reco_thr::guarda_cols_ruta_tram(char *path_shp)
|
|||
for(it=0;it<nt;it++)
|
||||
{
|
||||
tt=olv_limp->tramos[i][it].long_tr;
|
||||
sprintf_s(&info[(nt_parc+it)*OLV_SHP_SZ_CAMP_CHAR],OLV_SHP_SZ_CAMP_CHAR,"%.1f",tt);
|
||||
((double*)info)[nt_parc + it] = tt;
|
||||
}
|
||||
nt_parc+=nt;
|
||||
}
|
||||
if(!dbfmgr.AddCol(path_dbf,"M_DESP",GdataTable::Tstring,&dataDbf,OLV_SHP_SZ_CAMP_CHAR))
|
||||
if(!dbfmgr.AddCol(path_dbf,"M_DESP",GdataTable::Tdouble,&dataDbf))
|
||||
{
|
||||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,ntram*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,ntram* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
//N_AMB
|
||||
nt_parc=0;
|
||||
|
|
@ -1908,16 +1910,16 @@ BOOL Colv_reco_thr::guarda_cols_ruta_tram(char *path_shp)
|
|||
for(it=0;it<nt;it++)
|
||||
{
|
||||
tt=olv_limp->tramos[i][it].namb;
|
||||
sprintf_s(&info[(nt_parc+it)*OLV_SHP_SZ_CAMP_CHAR],OLV_SHP_SZ_CAMP_CHAR,"%ld",(int)tt);
|
||||
((int*)info)[nt_parc + it] = tt;
|
||||
}
|
||||
nt_parc+=nt;
|
||||
}
|
||||
if(!dbfmgr.AddCol(path_dbf,"N_AMB",GdataTable::Tstring,&dataDbf,OLV_SHP_SZ_CAMP_CHAR))
|
||||
if(!dbfmgr.AddCol(path_dbf,"N_AMB",GdataTable::Tint,&dataDbf))
|
||||
{
|
||||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,ntram*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,ntram* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
//UDS_TTO
|
||||
nt_parc=0;
|
||||
|
|
@ -1929,16 +1931,16 @@ BOOL Colv_reco_thr::guarda_cols_ruta_tram(char *path_shp)
|
|||
for(it=0;it<nt;it++)
|
||||
{
|
||||
tt=olv_limp->tramos[i][it].ncont;
|
||||
sprintf_s(&info[(nt_parc+it)*OLV_SHP_SZ_CAMP_CHAR],OLV_SHP_SZ_CAMP_CHAR,"%ld",(int)tt);
|
||||
((int*)info)[nt_parc + it] = tt;
|
||||
}
|
||||
nt_parc+=nt;
|
||||
}
|
||||
if(!dbfmgr.AddCol(path_dbf,"UDS_TTO",GdataTable::Tstring,&dataDbf,OLV_SHP_SZ_CAMP_CHAR))
|
||||
if(!dbfmgr.AddCol(path_dbf,"UDS_TTO",GdataTable::Tint,&dataDbf))
|
||||
{
|
||||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,ntram*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,ntram* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
//KG_RECO
|
||||
nt_parc=0;
|
||||
|
|
@ -1950,16 +1952,16 @@ BOOL Colv_reco_thr::guarda_cols_ruta_tram(char *path_shp)
|
|||
for(it=0;it<nt;it++)
|
||||
{
|
||||
tt=olv_limp->plan[i].planif_insta[2*it+1].m[OLV_TTO];
|
||||
sprintf_s(&info[(nt_parc+it)*OLV_SHP_SZ_CAMP_CHAR],OLV_SHP_SZ_CAMP_CHAR,"%.1f",tt);
|
||||
((double*)info)[nt_parc + it] = tt;
|
||||
}
|
||||
nt_parc+=nt;
|
||||
}
|
||||
if(!dbfmgr.AddCol(path_dbf,"KG_RECO",GdataTable::Tstring,&dataDbf,OLV_SHP_SZ_CAMP_CHAR))
|
||||
if(!dbfmgr.AddCol(path_dbf,"KG_RECO",GdataTable::Tdouble,&dataDbf))
|
||||
{
|
||||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,ntram*OLV_SHP_SZ_CAMP_CHAR);
|
||||
memset(info,0,ntram* OLV_SHP_SZ_CAMP_SZ);
|
||||
return TRUE;
|
||||
}
|
||||
//*************************************************************************************
|
||||
|
|
|
|||
|
|
@ -74,9 +74,6 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCm
|
|||
buf.borra();
|
||||
|
||||
//verifica versión-----------------------------------
|
||||
#ifdef _DEBUG
|
||||
system("pause");
|
||||
#endif;
|
||||
ClienteLicencias lic;
|
||||
char strtem[MAX_PATH];
|
||||
app->archi.rellena_dirs_ejecucion();
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
2020-04-05 23:08:31 _tmain Inicio OliviaTask:
|
||||
2020-04-05 23:08:31 _tmain Error al iniciar OliviaTasks para OLIVIA:
|
||||
Error al leer parámetros, menos de los esperados
|
||||
2020-04-05 23:08:31 _tmain Final feliz!!
|
||||
Loading…
Reference in New Issue