From 93b5ffc4fb5b7ad22e8548e0ba13fddabe3ef87e Mon Sep 17 00:00:00 2001 From: Gerardo Date: Mon, 27 Sep 2021 00:40:53 +0200 Subject: [PATCH] Inyeccion configuracion a parametros limpieza --- Model/OliviaConf.cs | 150 +++++++++++++++++++++------- Model/OliviaGlob.cs | 217 +++++++++++++++++++++-------------------- Services/ConfigServ.cs | 39 +++++++- 3 files changed, 260 insertions(+), 146 deletions(-) diff --git a/Model/OliviaConf.cs b/Model/OliviaConf.cs index 2ce0f50..4c5e524 100644 --- a/Model/OliviaConf.cs +++ b/Model/OliviaConf.cs @@ -92,6 +92,7 @@ namespace OliviaAddInPro.Model #endregion #region ParametrosReco_Ocultos + [Browsable(false)] public int t_vaciado_max { get; set; } [Browsable(false)] @@ -113,6 +114,19 @@ namespace OliviaAddInPro.Model [Browsable(false)] public int R_t_descanso_min { get; set; } #endregion + #region OtrasConfiguraciones + [Browsable(false)] + public string PathGdbGen { get; set; } + + [Browsable(false)] + public string PathCartela { get; set; } + + [Browsable(false)] + public string PathSimbVSM { get; set; } + + [Browsable(false)] + public string PathSimbESRI { get; set; } + #endregion #endregion #region General [Category("General")] @@ -142,6 +156,19 @@ namespace OliviaAddInPro.Model [Description("Capa municipios")] public string municipios { get; set; } #endregion + + #region CamposGenerales + [Category("Campos Generales")] + [DisplayName("Sector")] + [Description("Nombre del campo sector")] + public string consulta_sector { get; set; } + + [Category("Campos Generales")] + [DisplayName("Secuencia")] + [Description("Nombre del campo secuencia")] + public string consulta_secuen { get; set; } + + #endregion #region CAMPOS_LIMP [Category("Campos Limpieza")] [DisplayName("Tipo entidad")] @@ -521,87 +548,97 @@ namespace OliviaAddInPro.Model #region OtrosParametros [Category("Otros parametros")] - [DisplayName("")] - [Description("")] + [DisplayName("Ancho calle peatonal")] + [Description("Ancho por defecto calle peatonal. En metros")] public double Ancho_peat_def { get; set; } [Category("Otros parametros")] - [DisplayName("")] - [Description("")] + [DisplayName("Ancho Acera")] + [Description("Ancho de acera por defecto. En metros")] public double Ancho_acera_def { get; set; } [Category("Otros parametros")] - [DisplayName("")] - [Description("")] + [DisplayName("Ancho aparcamiento linea")] + [Description("Ancho por defecto del aparcamiento en linea. En metros")] public double Ancho_ap_lin_def { get; set; } [Category("Otros parametros")] - [DisplayName("")] - [Description("")] + [DisplayName("Ancho aparcamiento bateria")] + [Description("Ancho por defecto del aparcamiento en bateria. En metros")] public double Ancho_ap_bat_def { get; set; } [Category("Otros parametros")] - [DisplayName("")] - [Description("")] + [DisplayName("Ancho bordillo libre")] + [Description("Ancho por defecto del bordillo libre. en metros")] public double Ancho_bord_lib_def { get; set; } [Category("Otros parametros")] - [DisplayName("")] - [Description("")] + [DisplayName("Desviación máxima relativa")] + [Description("Desviacion maxima relativa permitida para la sectorización")] public double Desv_max { get; set; } [Category("Otros parametros")] - [DisplayName("")] - [Description("")] + [DisplayName("Desviación maxima absoluta")] + [Description("Desviacion maxima absoluta permitida en la sectorización. en segundos")] public double Desv_max_abs { get; set; } [Category("Otros parametros")] - [DisplayName("")] - [Description("")] + [DisplayName("Giro maximo vehículo")] + [Description("Giro maximo permitido al vehiculo. En grados")] public double Giro_max_vehiculo { get; set; } #endregion #region CamposRecogida - + [Browsable(false)] [Category("Campos Recogida")] [DisplayName("")] [Description("")] public string id { get; set; } + [Browsable(false)] [Category("Campos Recogida")] [DisplayName("")] [Description("")] public string nomrec { get; set; } + [Browsable(false)] [Category("Campos Recogida")] [DisplayName("")] [Description("")] public string lateralidad { get; set; } + [Browsable(false)] [Category("Campos Recogida")] [DisplayName("")] [Description("")] public string frac { get; set; } + [Browsable(false)] [Category("Campos Recogida")] [DisplayName("")] [Description("")] public string capac { get; set; } + [Browsable(false)] [Category("Campos Recogida")] [DisplayName("")] [Description("")] public string uds { get; set; } + [Browsable(false)] [Category("Campos Recogida")] [DisplayName("")] [Description("")] public string kgrec { get; set; } + [Browsable(false)] [Category("Campos Recogida")] [DisplayName("")] [Description("")] public int kgrec_val { get; set; } + [Browsable(false)] [Category("Campos Recogida")] [DisplayName("")] [Description("")] public int is_lleno { get; set; } + [Browsable(false)] [Category("Campos Recogida")] [DisplayName("")] [Description("")] public int is_campo { get; set; } + #endregion #region AtributosRecogida [Category("Atributos recogida")] @@ -665,138 +702,172 @@ namespace OliviaAddInPro.Model #endregion #region ParametrosRecogida + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public int t_llega_sale { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public int t_descarga { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public int R_t_convenio { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public int R_t_descanso { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public int R_hora_inicio { get; set; } //ES UNA HORA, SON LOS MINUTOS DESDE LAS 00, PERO TIENE QUE APARECER CON FORMATO DE TIME 07:30, POR EJEMPLO + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public int dens_vehi_org { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public int dens_vehi_res { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public int dens_vehi_env { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public int dens_vehi_pap { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public int dens_vehi_vid { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public int dens_vehi_otr { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public int dens_cont_org { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public int dens_cont_res { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public int dens_cont_env { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public int dens_cont_pap { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public int dens_cont_vid { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public int dens_cont_otr { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public double anch_vehi_3 { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public double anch_vehi_2 { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public double anch_vehi_s { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public double radio_giro_3 { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public double radio_giro_2 { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public double radio_giro_s { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public int t_vaci_trasera { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public int t_vaci_lateral { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public int t_vaci_superior { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public int t_vaci_bilateral { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public int t_vaci_bolseo { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public int t_vaci_lavado { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public int t_vaci_otra { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public int kgmax_max { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public int kgmax_min { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] public int carga_max_max { get; set; } + [Browsable(false)] [Category("Parametros Recogida")] [DisplayName("")] [Description("")] @@ -806,36 +877,41 @@ namespace OliviaAddInPro.Model #region CambosNW [Category("Campos network")] - [DisplayName("")] - [Description("")] + [DisplayName("Sentido de la calle")] + [Description("Nombre de la columna que indica si la calle es de doble sentido o no.")] public string cons_onew { get; set; } + [Category("Campos network")] - [DisplayName("")] - [Description("")] + [DisplayName("Velocidad calle")] + [Description("Nombre de la columna que indica la velociad de la calle")] public string cons_kph { get; set; } + [Category("Campos network")] - [DisplayName("")] - [Description("")] + [DisplayName("Tipo calle")] + [Description("Nombre de la columna que india el tipo de calle.")] public string cons_fow { get; set; } + [Category("Campos network")] - [DisplayName("")] - [Description("")] + [DisplayName("Nombre calle")] + [Description("Nombre de la columna que indica el nombre de la calle")] public string cons_name { get; set; } - [Category("Campos network")] - [DisplayName("")] - [Description("")] + + [Category("Atributos network")] + [DisplayName("To-From")] + [Description("Valor que indica la dirección To-From")] public string atr_TF { get; set; } - [Category("Campos network")] - [DisplayName("")] - [Description("")] + + [Category("Atributos network")] + [DisplayName("From-To")] + [Description("Valor que indica la dirección From-To")] public string atr_FT { get; set; } - [Category("Campos network")] - [DisplayName("")] - [Description("")] + [Category("Atributos network")] + [DisplayName("Sin circulación")] + [Description("Valor que indica no circulación")] public string atr_N { get; set; } - [Category("Campos network")] - [DisplayName("")] - [Description("")] + [Category("Atributos network")] + [DisplayName("Peatonal")] + [Description("Valor que indica que es calle peatonal")] public int atr_pedes { get; set; } #endregion diff --git a/Model/OliviaGlob.cs b/Model/OliviaGlob.cs index 00d7c6f..1d7f307 100644 --- a/Model/OliviaGlob.cs +++ b/Model/OliviaGlob.cs @@ -124,25 +124,26 @@ namespace OliviaAddInPro.Model */ public static void IniDefault() { - Paths.PathWork = "C:\\Olivia\\"; - Paths.PathExeOlivia = "C:\\Olivia\\release\\OliviaTasks.exe"; - Paths.DirData = "C:\\Olivia\\data\\"; - Paths.PathTemp = "C:\\Olivia\\temp\\"; - Paths.PathCartela = "C:\\olivia\\data\\Plantilla.mxd"; + var c = ConfigServ.Serv.Leer(); + Paths.PathWork = c.path_work; + Paths.PathExeOlivia = c.path_exe; + Paths.DirData = c.path_data; + Paths.PathTemp = c.path_temp; + c.PathCartela = c.PathCartela; - Paths.PathGdbGen = "C:\\Olivia\\gdb\\BASE DE DATOS.gdb"; - Paths.PathGdbNw = "C:\\Datos ejemplo\\BUENO\\Multinet_Q4_2015\\TomTom_Q4_2015.gdb"; - Paths.PathSimbVSM = "C:\\Olivia\\styles\\Simbologia.style"; - Paths.PathSimbESRI = "C:\\Olivia\\styles\\ESRI.style"; - //puerto = 19995; - //buff_export = 1000; + Paths.PathGdbGen = c.PathGdbGen; + Paths.PathGdbNw = c.red_carreteras; + Paths.PathSimbVSM = c.PathSimbVSM; + Paths.PathSimbESRI = c.PathSimbESRI; + //puerto = c.puerto; + //buff_export = c.buffer_export; /////////////////////////////////////// //Capas, consultas y filtros GENERALES - /*Capas.ftclass_ejes = "TomTom_Q4_2015___nw"; + /*Capas.ftclass_ejes = c.eje_via; Capas.ftclass_zonas = "SubNiveles"; Capas.ftclass_restri = "TomTom_Q4_2015___rs"; - Capas.ftclass_muni = "TomTom_Q4_2015___a8";*/ + Capas.ftclass_muni = c.municipios;*/ /////////////////////////////////////// //Capas, consultas, atributos y filtros de LIMPIEZA @@ -152,106 +153,106 @@ namespace OliviaAddInPro.Model LimpiezaDef.Capas.ftclass_limp_mec = "b_LimpMececanica"; LimpiezaDef.Capas.ftclass_instala = "c_Instalaciones"; - LimpiezaDef.Campos.consulta_entidad = "NOM_TIPO_ENTIDAD"; - LimpiezaDef.Campos.consulta_mecan = "MECANIZABLE"; - LimpiezaDef.Campos.consulta_observ = "OBSERVACIONES"; - LimpiezaDef.Campos.consulta_anch_tip = "ANCHO_TIPO"; - LimpiezaDef.Campos.consulta_tipolo = "TIPOLOGIA"; - LimpiezaDef.Campos.consulta_sector = "SECTOR"; - LimpiezaDef.Campos.consulta_secuen = "SECUENCIA"; + LimpiezaDef.Campos.consulta_entidad = c.cons_tip_ent; + LimpiezaDef.Campos.consulta_mecan = c.cons_mecaniz; + LimpiezaDef.Campos.consulta_observ = c.cons_obser; + LimpiezaDef.Campos.consulta_anch_tip = c.cons_anch_tip; + LimpiezaDef.Campos.consulta_tipolo = c.cons_tipolo; + LimpiezaDef.Campos.consulta_sector = c.consulta_sector; + LimpiezaDef.Campos.consulta_secuen = c.consulta_secuen; - LimpiezaDef.Atributos.atr_esca = "Escaleras"; - LimpiezaDef.Atributos.atr_fuent = "Fuentes"; - LimpiezaDef.Atributos.atr_infan = "JuegosInfantiles"; - LimpiezaDef.Atributos.atr_pape = "Papelera"; - LimpiezaDef.Atributos.atr_paso_niv = "Paso_Dist_Nivel"; - LimpiezaDef.Atributos.atr_pipi = "Pipican"; - LimpiezaDef.Atributos.atr_sane = "Sanecan"; - LimpiezaDef.Atributos.atr_acera = "Aceras"; - LimpiezaDef.Atributos.atr_aparc = "Banda Aparcamiento"; - LimpiezaDef.Atributos.atr_bord = "Bordillo Libre"; - LimpiezaDef.Atributos.atr_hoja = "Caida Hoja"; - LimpiezaDef.Atributos.atr_peat = "Peatonales"; - LimpiezaDef.Atributos.atr_terri = "Areas Terrizas"; - LimpiezaDef.Atributos.atr_ocio = "Ocio"; - LimpiezaDef.Atributos.atr_org_ofi = "Organismos_Oficiales"; - LimpiezaDef.Atributos.atr_parq = "Parques"; - LimpiezaDef.Atributos.atr_park = "Parquin"; - LimpiezaDef.Atributos.atr_play = "Playa"; - LimpiezaDef.Atributos.atr_polid = "Polideportivo"; - LimpiezaDef.Atributos.atr_turis = "Puntos_Interes_Turistico"; - LimpiezaDef.Atributos.atr_solar = "Solares"; - LimpiezaDef.Atributos.atr_suelo = "Uso_Suelos"; - LimpiezaDef.Atributos.atr_ap_lin = "Linea"; - LimpiezaDef.Atributos.atr_ap_bat = "Bateria"; + LimpiezaDef.Atributos.atr_esca = c.atr_esca; + LimpiezaDef.Atributos.atr_fuent = c.atr_fuent; + LimpiezaDef.Atributos.atr_infan = c.atr_infan; + LimpiezaDef.Atributos.atr_pape = c.atr_pape; + LimpiezaDef.Atributos.atr_paso_niv = c.atr_paso_niv; + LimpiezaDef.Atributos.atr_pipi = c.atr_pipi; + LimpiezaDef.Atributos.atr_sane = c.atr_sane; + LimpiezaDef.Atributos.atr_acera = c.atr_acera; + LimpiezaDef.Atributos.atr_aparc = c.atr_aparc; + LimpiezaDef.Atributos.atr_bord = c.atr_bord; + LimpiezaDef.Atributos.atr_hoja = c.atr_hoja; + LimpiezaDef.Atributos.atr_peat = c.atr_peat; + LimpiezaDef.Atributos.atr_terri = c.atr_terri; + LimpiezaDef.Atributos.atr_ocio = c.atr_ocio; + LimpiezaDef.Atributos.atr_org_ofi = c.atr_org_ofi; + LimpiezaDef.Atributos.atr_parq = c.atr_parq; + LimpiezaDef.Atributos.atr_park = c.atr_park; + LimpiezaDef.Atributos.atr_play = c.atr_play; + LimpiezaDef.Atributos.atr_polid = c.atr_polid; + LimpiezaDef.Atributos.atr_turis = c.atr_turis; + LimpiezaDef.Atributos.atr_solar = c.atr_solar; + LimpiezaDef.Atributos.atr_suelo = c.atr_suelo; + LimpiezaDef.Atributos.atr_ap_lin = c.atr_ap_lin; + LimpiezaDef.Atributos.atr_ap_bat = c.atr_ap_bat; //para el grupo PARAMETROS de LIMPIEZA - LimpiezaDef.Parametros.t_ttoM = 40000; - LimpiezaDef.Parametros.t_ttom = 0; - LimpiezaDef.Parametros.v_despM = 40000; - LimpiezaDef.Parametros.v_despm = 0; - LimpiezaDef.Parametros.t_cardescM = 40000; - LimpiezaDef.Parametros.t_cardescm = 0; - LimpiezaDef.Parametros.t_cardesc = 40; - LimpiezaDef.Parametros.t_despM = 40000; - LimpiezaDef.Parametros.t_despm = 0; - LimpiezaDef.Parametros.t_desp = 25; - LimpiezaDef.Parametros.t_convM = 40000; - LimpiezaDef.Parametros.t_convm = 0; - LimpiezaDef.Parametros.t_conv = 60 * 8; - LimpiezaDef.Parametros.t_descansoM = 40000; - LimpiezaDef.Parametros.t_descansom = 0; - LimpiezaDef.Parametros.t_descanso = 30; - LimpiezaDef.Parametros.h_inicio = 420; - LimpiezaDef.Parametros.ancho_viaM = 2000; - LimpiezaDef.Parametros.ancho_viam = 0; - LimpiezaDef.Parametros.ancho_via = 2; - LimpiezaDef.Parametros.ttoBarMan = 2900; - LimpiezaDef.Parametros.ttoBarManMant = 2900; - LimpiezaDef.Parametros.ttoBarMMot = 3500; - LimpiezaDef.Parametros.ttoBarMC = 4000; - LimpiezaDef.Parametros.ttoBarMAP = 4200; - LimpiezaDef.Parametros.ttoBarMix = 5600; - LimpiezaDef.Parametros.ttoBalMan = 4000; - LimpiezaDef.Parametros.ttoBalMC = 5000; - LimpiezaDef.Parametros.ttoBalMAP = 4200; - LimpiezaDef.Parametros.ttoBalMix = 5600; - LimpiezaDef.Parametros.ttoBL = 4000; - LimpiezaDef.Parametros.ttoCH = 5600; - LimpiezaDef.Parametros.ttoVPap = 1; - LimpiezaDef.Parametros.ttoLPap = 5; - LimpiezaDef.Parametros.ttoLC = 5; - LimpiezaDef.Parametros.ttoLZI = 30; - LimpiezaDef.Parametros.ttoLPip = 30; - LimpiezaDef.Parametros.ttoLS = 5; - LimpiezaDef.Parametros.vdespBarMan = 5; - LimpiezaDef.Parametros.vdespBarManMant = 5; - LimpiezaDef.Parametros.vdespBarMMot = 25; - LimpiezaDef.Parametros.vdespBarMC = 15; - LimpiezaDef.Parametros.vdespBarMAP = 15; - LimpiezaDef.Parametros.vdespBarMix = 15; - LimpiezaDef.Parametros.vdespBalMan = 15; - LimpiezaDef.Parametros.vdespBalMC = 0; - LimpiezaDef.Parametros.vdespBalMAP = 15; - LimpiezaDef.Parametros.vdespBalMix = 15; - LimpiezaDef.Parametros.vdespBL = 5; - LimpiezaDef.Parametros.vdespCH = 15; - LimpiezaDef.Parametros.vdespVPap = 0; - LimpiezaDef.Parametros.vdespLPap = 0; - LimpiezaDef.Parametros.vdespLC = 0; - LimpiezaDef.Parametros.vdespLZI = 0; - LimpiezaDef.Parametros.vdespLPip = 0; - LimpiezaDef.Parametros.vdespLS = 0; + LimpiezaDef.Parametros.t_ttoM = c.t_tratamiento_max; + LimpiezaDef.Parametros.t_ttom = c.t_tratamiento_min; + LimpiezaDef.Parametros.v_despM = c.v_desplaz_max; + LimpiezaDef.Parametros.v_despm = c.v_desplaz_min; + LimpiezaDef.Parametros.t_cardescM = c.t_carga_desc_max; + LimpiezaDef.Parametros.t_cardescm = c.t_carga_desc_min; + LimpiezaDef.Parametros.t_cardesc = c.t_carga_desc; + LimpiezaDef.Parametros.t_despM = c.t_carga_desc_max; + LimpiezaDef.Parametros.t_despm = c.t_carga_desc_min; + LimpiezaDef.Parametros.t_desp = c.t_desplaz; + LimpiezaDef.Parametros.t_convM = c.t_convenio_max; + LimpiezaDef.Parametros.t_convm = c.t_convenio_min; + LimpiezaDef.Parametros.t_conv = c.t_convenio; + LimpiezaDef.Parametros.t_descansoM = c.t_descanso_max; + LimpiezaDef.Parametros.t_descansom = c.t_descanso_min; + LimpiezaDef.Parametros.t_descanso = c.t_descanso; + LimpiezaDef.Parametros.h_inicio = c.hora_inicio; + LimpiezaDef.Parametros.ancho_viaM = c.ancho_via_max; + LimpiezaDef.Parametros.ancho_viam = c.ancho_via_min; + LimpiezaDef.Parametros.ancho_via = c.ancho_via; + LimpiezaDef.Parametros.ttoBarMan = c.t_tratamiento_BarMan; + LimpiezaDef.Parametros.ttoBarManMant = c.t_tratamiento_BarManMant; + LimpiezaDef.Parametros.ttoBarMMot = c.t_tratamiento_BarMMot; + LimpiezaDef.Parametros.ttoBarMC = c.t_tratamiento_BarMC; + LimpiezaDef.Parametros.ttoBarMAP = c.t_tratamiento_BarMAP; + LimpiezaDef.Parametros.ttoBarMix = c.t_tratamiento_BarMix; + LimpiezaDef.Parametros.ttoBalMan = c.t_tratamiento_BalMan; + LimpiezaDef.Parametros.ttoBalMC = c.t_tratamiento_BalMC; + LimpiezaDef.Parametros.ttoBalMAP = c.t_tratamiento_BalMAP; + LimpiezaDef.Parametros.ttoBalMix = c.t_tratamiento_BalMix; + LimpiezaDef.Parametros.ttoBL = c.t_tratamiento_BL; + LimpiezaDef.Parametros.ttoCH = c.t_tratamiento_CH; + LimpiezaDef.Parametros.ttoVPap = c.t_tratamiento_VPap; + LimpiezaDef.Parametros.ttoLPap = c.t_tratamiento_LPap; + LimpiezaDef.Parametros.ttoLC = c.t_tratamiento_LC; + LimpiezaDef.Parametros.ttoLZI = c.t_tratamiento_LZI; + LimpiezaDef.Parametros.ttoLPip = c.t_tratamiento_LPip; + LimpiezaDef.Parametros.ttoLS = c.t_tratamiento_LS; + LimpiezaDef.Parametros.vdespBarMan = c.v_desp_BarMan; + LimpiezaDef.Parametros.vdespBarManMant = c.v_desp_BarManMant; + LimpiezaDef.Parametros.vdespBarMMot = c.v_desp_BarMMot; + LimpiezaDef.Parametros.vdespBarMC = c.v_desp_BarMC; + LimpiezaDef.Parametros.vdespBarMAP = c.v_desp_BarMAP; + LimpiezaDef.Parametros.vdespBarMix = c.v_desp_BarMix; + LimpiezaDef.Parametros.vdespBalMan = c.v_desp_BalMan; + LimpiezaDef.Parametros.vdespBalMC = c.v_desp_BalMC; + LimpiezaDef.Parametros.vdespBalMAP = c.v_desp_BalMAP; + LimpiezaDef.Parametros.vdespBalMix = c.v_desp_BalMix; + LimpiezaDef.Parametros.vdespBL = c.v_desp_BL; + LimpiezaDef.Parametros.vdespCH = c.v_desp_CH; + LimpiezaDef.Parametros.vdespVPap = c.v_desp_VPap; + LimpiezaDef.Parametros.vdespLPap = c.v_desp_LPap; + LimpiezaDef.Parametros.vdespLC = c.v_desp_LC; + LimpiezaDef.Parametros.vdespLZI = c.v_desp_LZI; + LimpiezaDef.Parametros.vdespLPip = c.v_desp_LPip; + LimpiezaDef.Parametros.vdespLS = c.v_desp_LS; LimpiezaDef.Parametros.umbral_reco = 80; - LimpiezaDef.OtrosParam.giro_max = 175; - LimpiezaDef.OtrosParam.anch_peat = 6; - LimpiezaDef.OtrosParam.anch_ace = 1.5; - LimpiezaDef.OtrosParam.anch_aplin = 2; - LimpiezaDef.OtrosParam.anch_apbat = 4; - LimpiezaDef.OtrosParam.anch_bordlib = 1.5; - LimpiezaDef.OtrosParam.desv_max = 0.15; - LimpiezaDef.OtrosParam.desv_max_abs = 1800; + LimpiezaDef.OtrosParam.giro_max = c.Giro_max_vehiculo; + LimpiezaDef.OtrosParam.anch_peat = c.Ancho_peat_def; + LimpiezaDef.OtrosParam.anch_ace = c.Ancho_acera_def; + LimpiezaDef.OtrosParam.anch_aplin = c.Ancho_ap_lin_def; + LimpiezaDef.OtrosParam.anch_apbat = c.Ancho_ap_bat_def; + LimpiezaDef.OtrosParam.anch_bordlib = c.Ancho_bord_lib_def; + LimpiezaDef.OtrosParam.desv_max = c.Desv_max; + LimpiezaDef.OtrosParam.desv_max_abs = c.Desv_max_abs; /////////////////////////////////////// //Capas, consultas, atributos y filtros de RECOGIDA diff --git a/Services/ConfigServ.cs b/Services/ConfigServ.cs index 9df6dc6..e097697 100644 --- a/Services/ConfigServ.cs +++ b/Services/ConfigServ.cs @@ -13,7 +13,7 @@ namespace OliviaAddInPro.Services { private static string pathConfig = "F:\\temp\\olv\\olv.conf"; private static ConfigServ configServ=null; - + private static string nameDirWork = "%dir_work%"; public static ConfigServ Serv { @@ -38,18 +38,55 @@ namespace OliviaAddInPro.Services if(res==null) res = Default(); + res.path_exe = pon_path_absoluto(res.path_exe, res.path_work); + res.path_temp = pon_path_absoluto(res.path_temp, res.path_work); + res.path_data = pon_path_absoluto(res.path_data, res.path_work); return res; } public void Guardar(OliviaConf conf) { + conf.path_exe = pon_path_relativo(conf.path_exe, conf.path_work); + conf.path_temp = pon_path_relativo(conf.path_temp, conf.path_work); + conf.path_data = pon_path_relativo(conf.path_data, conf.path_work); + string jsonString = JsonConvert.SerializeObject(conf); File.WriteAllText(pathConfig, jsonString); + + conf.path_exe = pon_path_absoluto(conf.path_exe, conf.path_work); + conf.path_temp = pon_path_absoluto(conf.path_temp, conf.path_work); + conf.path_data = pon_path_absoluto(conf.path_data, conf.path_work); + } + /** + * cambia la carpeta referida a directorio de trabajo por los caracteres OliviaDirWork (%dir_work%) + */ + private string pon_path_relativo(string path, string DirWork) + { + if (DirWork == null || DirWork[0] == 0) + return path; + return path.Replace(nameDirWork, DirWork); } + /** + * cambia los caracteres OliviaDirWork (%dir_work%) por la ruta correspondiente en el disco duro + */ + private string pon_path_absoluto(string path, string DirWork) + { + if (DirWork == null || DirWork[0] == 0) + return path; + return path.Replace(DirWork, nameDirWork); + } private OliviaConf Default() { var c= new OliviaConf(); + c.PathGdbGen = "C:\\Olivia\\gdb\\BASE DE DATOS.gdb"; + c.PathSimbVSM = "C:\\Olivia\\styles\\Simbologia.style"; + c.PathSimbESRI = "C:\\Olivia\\styles\\ESRI.style"; + c.PathCartela = "C:\\olivia\\data\\Plantilla.mxd"; + + c.consulta_sector = "SECTOR"; + c.consulta_secuen = "SECUENCIA"; + c.red_carreteras = @"C:\Proyectos\Olivia\Datos\gdbs\TomTom_Q4_2015.gdb"; c.puerto = 19995; c.buffer_export = 1000;