Comienzo cambios modificación VSM campos shp y csv
parent
319243b188
commit
7d216b4bc2
|
|
@ -8145,7 +8145,7 @@ BOOL Colv_limp_thr::guarda_cols_ruta_tram(char *path_shp)
|
|||
}
|
||||
nt_parc+=nt;
|
||||
}
|
||||
if(!dbfmgr.AddCol(path_dbf,"T_TTO",GdataTable::Tstring,&dataDbf,OLV_SHP_SZ_CAMP_CHAR))
|
||||
if(!dbfmgr.AddCol(path_dbf,"T_TRAT",GdataTable::Tstring,&dataDbf,OLV_SHP_SZ_CAMP_CHAR))
|
||||
{
|
||||
free(info);
|
||||
return FALSE;
|
||||
|
|
@ -8230,7 +8230,7 @@ void Colv_limp_thr::rellena_tramos()
|
|||
tramo->t_ini = (float)(olv_limp->t_ini+olv_limp->t_sal+pp->planif_insta[0].elem[pp->planif_insta[0].nelem-1].coste);
|
||||
else
|
||||
tramo->t_ini = (float)(pp->planif_insta[2*it].t[OLV_TTO]+pp->planif_insta[2*it].elem[pp->planif_insta[2*it].nelem-1].coste);
|
||||
tramo->t_fin = (float)pp->planif_insta[2*it+1].t[OLV_TTO];
|
||||
tramo->t_fin = (float)pp->planif_insta[2 * it + 1].t[OLV_TTO];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -8433,7 +8433,7 @@ BOOL Colv_limp_thr::guarda_cols_ruta(char *path_shp)
|
|||
{
|
||||
continue;
|
||||
}
|
||||
tt=olv_limp->t_ini+ olv_limp->sec[i].cost_ac + olv_limp->t_desc;
|
||||
tt=olv_limp->t_ini+ olv_limp->sec[i].cost_ac + olv_limp->t_desc + 2*olv_limp->t_sal;
|
||||
|
||||
dame_h_m_s(tt, &h, &m, &s);
|
||||
sprintf_s(&info[isec_novac*OLV_SHP_SZ_CAMP_CHAR],OLV_SHP_SZ_CAMP_CHAR,"%02d:%02d:%02d h",h,m,s);
|
||||
|
|
@ -8452,7 +8452,7 @@ BOOL Colv_limp_thr::guarda_cols_ruta(char *path_shp)
|
|||
{
|
||||
if(olv_limp->sec[i].namb==0)
|
||||
continue;
|
||||
tt=olv_limp->sec[i].cost_ac+olv_limp->t_desc;
|
||||
tt=olv_limp->sec[i].cost_ac+olv_limp->t_desc + 2 * olv_limp->t_sal;
|
||||
dame_h_m_s(tt, &h, &m, &s);
|
||||
sprintf_s(&info[isec_novac*OLV_SHP_SZ_CAMP_CHAR],OLV_SHP_SZ_CAMP_CHAR,"%02d:%02d:%02d h",h,m,s);
|
||||
isec_novac++;
|
||||
|
|
@ -8470,7 +8470,7 @@ BOOL Colv_limp_thr::guarda_cols_ruta(char *path_shp)
|
|||
{
|
||||
if(olv_limp->sec[i].namb==0)
|
||||
continue;
|
||||
tt=olv_limp->sec[i].t_despl[0]+olv_limp->sec[i].t_despl[1];
|
||||
tt= olv_limp->sec[i].t_despl[0]+olv_limp->sec[i].t_despl[1];
|
||||
dame_h_m_s(tt, &h, &m, &s);
|
||||
sprintf_s(&info[isec_novac*OLV_SHP_SZ_CAMP_CHAR],OLV_SHP_SZ_CAMP_CHAR,"%02d:%02d:%02d h",h,m,s);
|
||||
isec_novac++;
|
||||
|
|
@ -8500,24 +8500,6 @@ BOOL Colv_limp_thr::guarda_cols_ruta(char *path_shp)
|
|||
}
|
||||
memset(info,0,nsec* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
//rellena la info de duración de la ruta
|
||||
isec_novac=0;
|
||||
for(i=0;i<olv_limp->nsec;i++)
|
||||
{
|
||||
if(olv_limp->sec[i].namb==0)
|
||||
continue;
|
||||
tt=olv_limp->plan[i].elem[olv_limp->plan[i].nelem-1].coste;
|
||||
dame_h_m_s(tt, &h, &m, &s);
|
||||
sprintf_s(&info[isec_novac*OLV_SHP_SZ_CAMP_CHAR],OLV_SHP_SZ_CAMP_CHAR,"%02d:%02d:%02d h",h,m,s);
|
||||
isec_novac++;
|
||||
}
|
||||
if(!dbfmgr.AddCol(path_dbf,"T_RUTA",GdataTable::Tstring,&dataDbf,OLV_SHP_SZ_CAMP_CHAR))
|
||||
{
|
||||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
memset(info,0,nsec* OLV_SHP_SZ_CAMP_SZ);
|
||||
|
||||
//rellena la info de longitud de la ruta
|
||||
isec_novac=0;
|
||||
for(i=0;i<olv_limp->nsec;i++)
|
||||
|
|
@ -8919,7 +8901,7 @@ BOOL Colv_limp_thr::guarda_cols_insta(char *path_shp)
|
|||
}
|
||||
ninsta_parc+=ninsta_novac;
|
||||
}
|
||||
if(!dbfmgr.AddCol(path_dbf,"H_TRAY",GdataTable::Tstring,&dataDbf,OLV_SHP_SZ_CAMP_CHAR))
|
||||
if(!dbfmgr.AddCol(path_dbf,"H_INI",GdataTable::Tstring,&dataDbf,OLV_SHP_SZ_CAMP_CHAR))
|
||||
{
|
||||
free(info);
|
||||
return FALSE;
|
||||
|
|
@ -8945,7 +8927,7 @@ BOOL Colv_limp_thr::guarda_cols_insta(char *path_shp)
|
|||
}
|
||||
ninsta_parc+=ninsta_novac;
|
||||
}
|
||||
if(!dbfmgr.AddCol(path_dbf,"T_TRAY",GdataTable::Tstring,&dataDbf,OLV_SHP_SZ_CAMP_CHAR))
|
||||
if(!dbfmgr.AddCol(path_dbf,"T_TOTAL",GdataTable::Tstring,&dataDbf,OLV_SHP_SZ_CAMP_CHAR))
|
||||
{
|
||||
free(info);
|
||||
return FALSE;
|
||||
|
|
@ -8968,7 +8950,7 @@ BOOL Colv_limp_thr::guarda_cols_insta(char *path_shp)
|
|||
}
|
||||
ninsta_parc+=ninsta_novac;
|
||||
}
|
||||
if(!dbfmgr.AddCol(path_dbf,"M_TRAY",GdataTable::Tdouble,&dataDbf))
|
||||
if(!dbfmgr.AddCol(path_dbf,"M_TOTAL",GdataTable::Tdouble,&dataDbf))
|
||||
{
|
||||
free(info);
|
||||
return FALSE;
|
||||
|
|
@ -8989,11 +8971,13 @@ BOOL Colv_limp_thr::genera_list_rut_ctrl()
|
|||
Colv_csv cc;
|
||||
char tto_desp[32],observ[32],calle[1024],path_csv[MAX_PATH],fila[256],fila0[256];
|
||||
int i,j,h,m,seg,ii,dt;
|
||||
double ltot,ltot0,tt,t0;
|
||||
double ltot,ltot0,tt,t0,linst[2];
|
||||
BOOL mal;
|
||||
|
||||
double lttt;
|
||||
|
||||
linst[0] = linst[1] = 0;
|
||||
|
||||
mal=FALSE;
|
||||
strcpy_s(path_csv,MAX_PATH,olv_limp->olv->paths.path_data);
|
||||
//cambiaext(path_csv,".shp","_L.csv");
|
||||
|
|
@ -9020,21 +9004,33 @@ BOOL Colv_limp_thr::genera_list_rut_ctrl()
|
|||
continue;
|
||||
ii=1;
|
||||
i=0;
|
||||
t0=olv_limp->t_ini + olv_limp->sec[s].t_despl[0];
|
||||
t0=olv_limp->t_ini + olv_limp->sec[s].t_despl[0] + olv_limp->t_sal;
|
||||
|
||||
if ((olv_limp->nod_instal != -1) && (pp->ninsta>0))
|
||||
{
|
||||
linst[0] = pp->planif_insta[0].m[OLV_DESP];
|
||||
linst[1] = pp->planif_insta[pp->ninsta-1].m[OLV_DESP];
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////
|
||||
//primer punto de control e instalación
|
||||
if(i==0)
|
||||
{
|
||||
dame_h_m_s(olv_limp->t_ini, &h, &m, &seg);
|
||||
sprintf_s(fila0,256,"%02d;%04d;%s;%s;%s;%s;%02d:%02d:%02d;\r\n",s+1,ii,"","","Instalación","",h,m,seg);
|
||||
sprintf_s(fila0, 256, "%02d;%04d;%s;%s;%s;%s;%02d:%02d:%02d;\r\n", s + 1, ii, "", "", "Inicio", "", h, m, seg);
|
||||
|
||||
dame_h_m_s(olv_limp->t_ini + olv_limp->t_sal, &h, &m, &seg);
|
||||
if(linst[0] ==0)
|
||||
sprintf_s(fila0,256,"%02d;%04d;%s;%s;%s;%s;%02d:%02d:%02d;\r\n",s+1,ii,"","","Ida desde instalación","",h,m,seg);
|
||||
else
|
||||
sprintf_s(fila0, 256, "%02d;%04d;%s;%s;%s;%.1f;%02d:%02d:%02d;\r\n", s + 1, ii, "", "", "Ida desde instalación", linst[0], h, m, seg);
|
||||
if(!cc.escribe(fila0))
|
||||
{
|
||||
mal=TRUE;
|
||||
continue;;
|
||||
}
|
||||
dame_h_m_s(t0, &h, &m, &seg);
|
||||
sprintf_s(fila0,256,"%02d;%04d;%s;%s;%s;%s;%02d:%02d:%02d;\r\n",s+1,ii,"","","Control","",h,m,seg);
|
||||
sprintf_s(fila0,256,"%02d;%04d;%s;%s;%s;%s;%02d:%02d:%02d;\r\n",s+1,ii,"","","Control - Inicio","",h,m,seg);
|
||||
if(!cc.escribe(fila0))
|
||||
{
|
||||
mal=TRUE;
|
||||
|
|
@ -9132,7 +9128,7 @@ ctrl:
|
|||
tt+=olv_limp->t_desc/(olv_limp->npts_ctrl-2);
|
||||
pp->pts_ctrl[j].cost = tt;
|
||||
dame_h_m_s(tt, &h, &m, &seg);
|
||||
sprintf_s(fila0,256,"%02d;%04d;%s;%s;%s;%s;%02d:%02d:%02d;\r\n",s+1,ii,"","","Control","",h,m,seg);
|
||||
sprintf_s(fila0,256,"%02d;%04d;%s;%s;%s;%s;%02d:%02d:%02d;\r\n",s+1,ii,"","","Control - Medio","",h,m,seg);
|
||||
if(!cc.escribe(fila0))
|
||||
{
|
||||
mal=TRUE;
|
||||
|
|
@ -9158,10 +9154,11 @@ ctrl:
|
|||
//último punto de control e instalación
|
||||
if((i==(pp->nelem))&& !mal)
|
||||
{
|
||||
tt=olv_limp->t_ini+ olv_limp->sec[s].cost_ac + olv_limp->t_desc-olv_limp->sec[s].t_despl[1];
|
||||
//REVISAR
|
||||
tt=olv_limp->t_ini+ olv_limp->sec[s].cost_ac + olv_limp->t_desc + 2 * olv_limp->t_sal - olv_limp->sec[s].t_despl[1];
|
||||
quita_t_ult_desc(s,&tt);
|
||||
dame_h_m_s(tt, &h, &m, &seg);
|
||||
sprintf_s(fila0,256,"%02d;%04d;%s;%s;%s;%s;%02d:%02d:%02d;\r\n",s+1,ii,calle,"","Control","",h,m,seg);
|
||||
sprintf_s(fila0,256,"%02d;%04d;%s;%s;%s;%s;%02d:%02d:%02d;\r\n",s+1,ii,calle,"","Control - Fin","",h,m,seg);
|
||||
if(!cc.escribe(fila0))
|
||||
{
|
||||
mal=TRUE;
|
||||
|
|
@ -9179,14 +9176,29 @@ ctrl:
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//final
|
||||
tt = olv_limp->t_ini + olv_limp->sec[s].cost_ac + olv_limp->t_desc + 2 * olv_limp->t_sal;
|
||||
//////////////////////////////////////////////
|
||||
dame_h_m_s(tt- olv_limp->t_sal - olv_limp->t_despl[1], &h, &m, &seg);
|
||||
if (linst[1] == 0)
|
||||
sprintf_s(fila0, 256, "%02d;%04d;%s;%s;%s;%s;%02d:%02d:%02d;\r\n", s + 1, ii, "", "", "Vuelta a instalación", "", h, m, seg);
|
||||
else
|
||||
sprintf_s(fila0, 256, "%02d;%04d;%s;%s;%s;%.1f;%02d:%02d:%02d;\r\n", s + 1, ii, "", "", "Vuelta a instalación", linst[1], h, m, seg);
|
||||
|
||||
if (!cc.escribe(fila0))
|
||||
{
|
||||
mal = TRUE;
|
||||
continue;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////
|
||||
tt=olv_limp->t_ini+ olv_limp->sec[s].cost_ac + olv_limp->t_desc;
|
||||
dame_h_m_s(tt, &h, &m, &seg);
|
||||
sprintf_s(fila0,256,"%02d;%04d;%s;%s;%s;%s;%02d:%02d:%02d;\r\n",s+1,ii,"","","Instalación","",h,m,seg);
|
||||
sprintf_s(fila0, 256, "%02d;%04d;%s;%s;%s;%s;%02d:%02d:%02d;\r\n", s + 1, ii, "", "", "Fin", "", h, m, seg);
|
||||
if(!cc.escribe(fila0))
|
||||
{
|
||||
mal=TRUE;
|
||||
continue;;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -681,7 +681,7 @@ double Colv_reco_thr::dame_coste( Secu_amb * sec, int ini, int fin, Info_sec *s,
|
|||
if(ini==0)//si ini es 0 falta sumar el coste de la planta a el primer ambito
|
||||
{
|
||||
d+=olv_limp->arch_dj.dame_dis(olv_limp->arch_dj.id_instal, 0, s->iamb[sec[ini].iamb],0);
|
||||
d+=olv_reco->t_sal;
|
||||
//d+=olv_reco->t_sal;
|
||||
}
|
||||
|
||||
cap_t+=olv_limp->iaso[olv_limp->carto.get(id_ambf).entity()->ref].inf_r.kg;//suma a la carga total la basura del primer ambito
|
||||
|
|
@ -707,7 +707,7 @@ double Colv_reco_thr::dame_coste( Secu_amb * sec, int ini, int fin, Info_sec *s,
|
|||
d+=olv_reco->ord_sec_plan[OLV_PLANT].ctnod[0][olv_reco->iaso[olv_limp->carto.get(id_ambf).entity()->ref].inod[0]].dis;//suma el coste de ir del ultimo ambito a la planta
|
||||
d+=olv_reco->t_descarg;//suma el coste de descargar
|
||||
d+=olv_reco->ord_sec_plan[OLV_INSTAL].ctnod[0][olv_reco->nod_plant].dis;//suma el coste de ir de planta a instalacion
|
||||
d+=olv_reco->t_sal;//suma el coste de la llegada
|
||||
//d+=olv_reco->t_sal;//suma el coste de la llegada
|
||||
|
||||
int iold=-1;
|
||||
BOOL errores=FALSE;
|
||||
|
|
@ -876,7 +876,7 @@ double Colv_reco_thr::dame_coste_pon_viajes( Secu_amb * sec, int ini, int fin, I
|
|||
if(ini==0)//si ini es 0 falta sumar el coste de la planta a el primer ambito
|
||||
{
|
||||
d+=olv_limp->arch_dj.dame_dis(olv_limp->arch_dj.id_instal, 0, s->iamb[sec[ini].iamb],0);
|
||||
d+=olv_reco->t_sal;//suma el coste de la llegada
|
||||
//d+=olv_reco->t_sal;//suma el coste de la llegada
|
||||
}
|
||||
|
||||
cap_t+=olv_limp->iaso[olv_limp->carto.get(id_ambf).entity()->ref].inf_r.kg;//suma a la carga total la basura del primer ambito
|
||||
|
|
@ -907,7 +907,7 @@ double Colv_reco_thr::dame_coste_pon_viajes( Secu_amb * sec, int ini, int fin, I
|
|||
d+=olv_reco->ord_sec_plan[OLV_PLANT].ctnod[0][olv_reco->iaso[olv_limp->carto.get(id_ambf).entity()->ref].inod[0]].dis;//suma el coste de ir del ultimo ambito a la planta
|
||||
d+=olv_reco->ord_sec_plan[OLV_INSTAL].ctnod[0][olv_reco->nod_plant].dis;//suma el coste de ir de planta a instalacion
|
||||
d+=olv_reco->t_descarg;//suma el coste de descargar
|
||||
d+=olv_reco->t_sal;//suma el coste de la llegada
|
||||
//d+=olv_reco->t_sal;//suma el coste de la llegada
|
||||
///////////////////////////
|
||||
coste=MAYUSCULO;
|
||||
|
||||
|
|
@ -1519,7 +1519,7 @@ BOOL Colv_reco_thr::genera_list_fila_vaci(Colv_csv *cc, char *fila0, int ielem,
|
|||
*t0+=cost_despl+olv_reco->t_descarg;
|
||||
tt+=cost_despl+olv_reco->t_descarg;
|
||||
dame_h_m_s(tt, &h, &m, &seg);
|
||||
sprintf_s(fila0,256,"%02d;%04d;%s;%.1f;%s;%.1f;%02d:%02d:%02d;\r\n",isec+1,secu,"",kgac,"Descarga",ltot,h,m,seg);
|
||||
sprintf_s(fila0,256,"%02d;%04d;%s;%.1f;%s;%.1f;%02d:%02d:%02d;\r\n",isec+1,secu,"",kgac,"Ida a descargar",ltot,h,m,seg);
|
||||
if(!cc->escribe(fila0))
|
||||
{
|
||||
return FALSE;
|
||||
|
|
@ -1545,7 +1545,7 @@ BOOL Colv_reco_thr::genera_list_fila_vaci(Colv_csv *cc, char *fila0, int ielem,
|
|||
*t0+=cost_despl;
|
||||
tt+=cost_despl;
|
||||
dame_h_m_s(tt, &h, &m, &seg);
|
||||
sprintf_s(fila0,256,"%02d;%04d;%s;%s;%s;%.1f;%02d:%02d:%02d;\r\n",isec+1,secu,"","","Vuelta de Descarga",ltot,h,m,seg);
|
||||
sprintf_s(fila0,256,"%02d;%04d;%s;%s;%s;%.1f;%02d:%02d:%02d;\r\n",isec+1,secu,"","","Vuelta de descargar",ltot,h,m,seg);
|
||||
if(!cc->escribe(fila0))
|
||||
{
|
||||
return FALSE;
|
||||
|
|
@ -1800,22 +1800,15 @@ BOOL Colv_reco_thr::guarda_cols_insta(char *path_shp)
|
|||
for(int i=0;i<olv_limp->nsec;i++)
|
||||
{
|
||||
ninsta_novac=0;
|
||||
tt2=0;
|
||||
tt=1;
|
||||
for(insta=0;insta<olv_limp->plan[i].ninsta;insta++)
|
||||
{
|
||||
if(olv_limp->plan[i].planif_insta[insta].nelem==0)
|
||||
continue;
|
||||
|
||||
if(olv_limp->plan[i].planif_insta[insta].ninsta==OLV_IDA_PLANT ||
|
||||
olv_limp->plan[i].planif_insta[insta].ninsta==OLV_VUELTA_INST)
|
||||
{
|
||||
tt2++;
|
||||
tt=tt2;
|
||||
}
|
||||
else if(olv_limp->plan[i].planif_insta[insta].ninsta==OLV_VUELTA_PLANT)
|
||||
tt=tt2;
|
||||
else
|
||||
tt=0;
|
||||
if(olv_limp->plan[i].planif_insta[insta].ninsta==OLV_VUELTA_PLANT)
|
||||
tt++;
|
||||
|
||||
((int*)info)[insta + ninsta_parc] = tt;
|
||||
ninsta_novac++;
|
||||
}
|
||||
|
|
@ -1892,7 +1885,7 @@ BOOL Colv_reco_thr::guarda_cols_ruta_tram(char *path_shp)
|
|||
}
|
||||
nt_parc+=nt;
|
||||
}
|
||||
if(!dbfmgr.AddCol(path_dbf,"M_DESP",GdataTable::Tdouble,&dataDbf))
|
||||
if(!dbfmgr.AddCol(path_dbf,"M_RUTA",GdataTable::Tdouble,&dataDbf))
|
||||
{
|
||||
free(info);
|
||||
return FALSE;
|
||||
|
|
@ -1934,7 +1927,7 @@ BOOL Colv_reco_thr::guarda_cols_ruta_tram(char *path_shp)
|
|||
}
|
||||
nt_parc+=nt;
|
||||
}
|
||||
if(!dbfmgr.AddCol(path_dbf,"UDS_TTO",GdataTable::Tint,&dataDbf))
|
||||
if(!dbfmgr.AddCol(path_dbf,"UDS_TRAT",GdataTable::Tint,&dataDbf))
|
||||
{
|
||||
free(info);
|
||||
return FALSE;
|
||||
|
|
@ -1955,7 +1948,7 @@ BOOL Colv_reco_thr::guarda_cols_ruta_tram(char *path_shp)
|
|||
}
|
||||
nt_parc+=nt;
|
||||
}
|
||||
if(!dbfmgr.AddCol(path_dbf,"KG_RECO",GdataTable::Tdouble,&dataDbf))
|
||||
if(!dbfmgr.AddCol(path_dbf,"KG_TOT_REC",GdataTable::Tdouble,&dataDbf))
|
||||
{
|
||||
free(info);
|
||||
return FALSE;
|
||||
|
|
|
|||
Loading…
Reference in New Issue