diff --git a/Button/ButtonLimp.cs b/Button/ButtonLimp.cs index c27e700..855fcc1 100644 --- a/Button/ButtonLimp.cs +++ b/Button/ButtonLimp.cs @@ -32,6 +32,7 @@ namespace OliviaAddInPro if (OliviaGlob.TipoEjec == TiposEjecucion.Ninguno) { ///Comprueba que existe la red navegable configurada + if (HelperGdb.GetGdb(OliviaGlob.Paths.PathGdbNw).Result == null) { HelperGlobal.ponMsg("No encuentra Gdb de red navegable, cambie Configuración: " + HelperGdb.OutStr, diff --git a/Model/OliviaConf.cs b/Model/OliviaConf.cs index d979592..ad9078a 100644 --- a/Model/OliviaConf.cs +++ b/Model/OliviaConf.cs @@ -1,4 +1,5 @@ using Newtonsoft.Json; +using OliviaAddInPro.View.Configuracion; using System; using System.Collections.Generic; using System.ComponentModel; @@ -6,6 +7,7 @@ using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; +using System.Windows; using Xceed.Wpf.Toolkit.PropertyGrid; using Xceed.Wpf.Toolkit.PropertyGrid.Editors; @@ -190,11 +192,19 @@ namespace OliviaAddInPro.Model #endregion #region General [Category("General")] + [DisplayName("Eje via de red de carreteras")] + [Description("Eje de via de red de carreteras que se usara para la navegación")] + [Editor(typeof(PropertyGridFilePickerLine), typeof(PropertyGridFilePickerLine))] + //[Editor(typeof(EditorFilePickerDefinition), typeof(EditorFilePickerDefinition))] + public string Path_Eje_via { get; set; } + /* + [Category("General")] [DisplayName("Red de carreteras")] [Description("Red de carreteras que se usara para la navegación")] + [Editor(typeof(PropertyGridFilePickerGDB), typeof(PropertyGridFilePickerGDB))] //[Editor(typeof(EditorFilePickerDefinition), typeof(EditorFilePickerDefinition))] public string red_carreteras { get; set; } - + */ [Category("General")] [DisplayName("Puerto")] [Description("Puerto de conexión con el proceso olivia")] @@ -207,17 +217,20 @@ namespace OliviaAddInPro.Model #endregion #region CAPAS_GENERALES + /* [Category("Capas Generales")] [DisplayName("Eje de via")] [Description("Capa de eje de via que se usara")] + [Editor(typeof(PropertyGridFilePickerLine), typeof(PropertyGridFilePickerLine))] public string eje_via { get; set; } [Category("Capas Generales")] [DisplayName("Capa municipios")] [Description("Capa municipios")] public string municipios { get; set; } + */ #endregion - + #region CamposGenerales [Category("Campos Generales")] [DisplayName("Sector")] diff --git a/Model/OliviaGlob.cs b/Model/OliviaGlob.cs index 09c629e..f46ca54 100644 --- a/Model/OliviaGlob.cs +++ b/Model/OliviaGlob.cs @@ -71,6 +71,7 @@ namespace OliviaAddInPro.Model */ public struct Capas { + public static string pathEjeVia; public static string ftclass_ejes; // + + PropertyGridFilePickerLine.xaml + + + PropertyGridFilePickerGDB.xaml + PaneRecogidaSub1.xaml @@ -234,6 +240,14 @@ + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + MSBuild:Compile Designer diff --git a/Services/ConfigServ.cs b/Services/ConfigServ.cs index d0a718d..f07bc7f 100644 --- a/Services/ConfigServ.cs +++ b/Services/ConfigServ.cs @@ -45,7 +45,7 @@ namespace OliviaAddInPro.Services res.PathSimbVSM = pon_path_absoluto(res.PathSimbVSM, res.path_work); res.PathSimbESRI = pon_path_absoluto(res.PathSimbESRI, res.path_work); res.PathCartela = pon_path_absoluto(res.PathCartela, res.path_work); - res.red_carreteras = pon_path_absoluto(res.red_carreteras, res.path_work); + res.Path_Eje_via = pon_path_absoluto(res.Path_Eje_via, res.path_work); res.path_exe = pon_path_absoluto(res.path_exe, res.path_work); @@ -64,7 +64,7 @@ namespace OliviaAddInPro.Services conf.PathSimbVSM = pon_path_relativo(conf.PathSimbVSM, conf.path_work); conf.PathSimbESRI = pon_path_relativo(conf.PathSimbESRI, conf.path_work); conf.PathCartela = pon_path_relativo(conf.PathCartela, conf.path_work); - conf.red_carreteras = pon_path_relativo(conf.red_carreteras, conf.path_work); + conf.Path_Eje_via = pon_path_relativo(conf.Path_Eje_via, conf.path_work); string jsonString = JsonConvert.SerializeObject(conf); File.WriteAllText(GetPathConfig(), jsonString); @@ -76,14 +76,14 @@ namespace OliviaAddInPro.Services conf.PathSimbVSM = pon_path_absoluto(conf.PathSimbVSM, conf.path_work); conf.PathSimbESRI = pon_path_absoluto(conf.PathSimbESRI, conf.path_work); conf.PathCartela = pon_path_absoluto(conf.PathCartela, conf.path_work); - conf.red_carreteras = pon_path_absoluto(conf.red_carreteras, conf.path_work); + conf.Path_Eje_via = pon_path_absoluto(conf.Path_Eje_via, 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) + if (string.IsNullOrEmpty(DirWork) || string.IsNullOrEmpty(path)) return path; return path.Replace( DirWork, nameDirWork); } @@ -93,7 +93,7 @@ namespace OliviaAddInPro.Services */ private string pon_path_absoluto(string path, string DirWork) { - if (DirWork == null || DirWork[0] == 0) + if (string.IsNullOrEmpty(DirWork) || string.IsNullOrEmpty(path)) return path; return path.Replace( nameDirWork, DirWork); } @@ -143,16 +143,16 @@ namespace OliviaAddInPro.Services c.consulta_sector = "SECTOR"; c.consulta_secuen = "SECUENCIA"; - c.red_carreteras = @"%dir_work%Datos\gdbs\TomTom_Q4_2015.gdb"; + //c.red_carreteras = @"%dir_work%Datos\gdbs\TomTom_Q4_2015.gdb"; c.puerto = 19995; c.buffer_export = 1000; c.path_exe=@"%dir_work%bin\OliviaTasks.exe"; c.path_temp = @"%dir_work%temp\"; c.path_data=@"%dir_work%data\"; - - c.eje_via = "TomTom_Q4_2015___nw"; - c.municipios = "TomTom_Q4_2015___a8"; + c.Path_Eje_via = @"%dir_work%Datos\gdbs\TomTom_Q4_2015.gdb\TomTom_Q4_2015___nw"; + /*c.eje_via = "TomTom_Q4_2015___nw"; + c.municipios = "TomTom_Q4_2015___a8";*/ c.cons_tip_ent= "NOM_TIPO_ENTIDAD"; c.cons_mecaniz= "MECANIZABLE"; diff --git a/Services/EjecServ.cs b/Services/EjecServ.cs index a8628aa..2546475 100644 --- a/Services/EjecServ.cs +++ b/Services/EjecServ.cs @@ -194,7 +194,7 @@ namespace OliviaAddInPro.Services //Prepara naombre de exportación com.NombreShpExportNw = prefNameExportNw + fechaHora + extShp; //exporta los datos de entrada - string capaNw =System.IO.Path.Combine(OliviaGlob.Paths.PathGdbNw, OliviaGlob.Capas.ftclass_ejes); + string capaNw =OliviaGlob.Paths.PathGdbNw; //if (!HelperGdb.ExportShp(capaNw, filtroEspacial, com.NombreShpExportNw, OliviaGlob.Paths.DirData, cps, out ErrStr)) if (!HelperGdb.ExportShp2(capaNw, filtroEspacial, com.NombreShpExportNw, OliviaGlob.Paths.DirData, cps)) { diff --git a/View/Configuracion/PropertyGridFilePickerGDB.xaml b/View/Configuracion/PropertyGridFilePickerGDB.xaml new file mode 100644 index 0000000..6771e87 --- /dev/null +++ b/View/Configuracion/PropertyGridFilePickerGDB.xaml @@ -0,0 +1,14 @@ + + +