From f1444fd25a9b347723fc6c91048b5341f77351df Mon Sep 17 00:00:00 2001 From: Gerardo Date: Mon, 4 Dec 2023 22:02:32 +0100 Subject: [PATCH] Versionado de configuracion --- Config.daml | 4 ++-- Model/OliviaConf.cs | 17 +++++++++++++++-- Services/ConfigServ.cs | 13 +++++++------ Services/EjecServ.cs | 30 +++++++++++++++--------------- 4 files changed, 39 insertions(+), 25 deletions(-) diff --git a/Config.daml b/Config.daml index 3270b75..4c638ab 100644 --- a/Config.daml +++ b/Config.daml @@ -1,12 +1,12 @@  - + OliviaAddInPro AddIn de Optimización de la Limpieza Viaria para ArcGIs Pro Images\AddinDesktop32.png VSM VSM - Narvaling - 09/11/2023 12:00:00, 2023 + 27/11/2023 12:00:00, 2023 Framework diff --git a/Model/OliviaConf.cs b/Model/OliviaConf.cs index 6daa837..7ab85a1 100644 --- a/Model/OliviaConf.cs +++ b/Model/OliviaConf.cs @@ -94,8 +94,13 @@ namespace OliviaAddInPro.Model TiempoOutSocket = 20; } - #region PropiedadesOcultas - #region parametrosConexion + #region PropiedadesOcultas + #region parametrosConexion + /** + * Version de las configuraciones + */ + [Browsable(false)] + public string Version { get; set; } /** * IP donde va a realizar la conexión a OliviaTask, se inicializa al arrancar con la local */ @@ -618,21 +623,25 @@ namespace OliviaAddInPro.Model #endregion #region 06CambosNW + [Browsable(false)] [Category("Campos Red Navegable")] [DisplayName("Sentido de la vía")] [Description("Nombre del campo que indica si la vía es de doble sentido o no")] public string cons_onew { get; set; } + [Browsable(false)] [Category("Campos Red Navegable")] [DisplayName("Velocidad de la vía")] [Description("Nombre del campo que indica la velociad máxima permitida de la vía")] public string cons_kph { get; set; } + [Browsable(false)] [Category("Campos Red Navegable")] [DisplayName("Tipo de vía")] [Description("Nombre del campo que indica el tipo de la vía (usado para ver si es vía peatonal).")] public string cons_fow { get; set; } + [Browsable(false)] [Category("Campos Red Navegable")] [DisplayName("Nombre de la vía")] [Description("Nombre del campo que indica el nombre de la vía")] @@ -640,24 +649,28 @@ namespace OliviaAddInPro.Model #endregion #region 07AtrNw + [Browsable(false)] [Category("Atributos Red Navegable")] [PropertyOrder(1)] [DisplayName("To-From")] [Description("Valor del campo 'Sentido de la vía' que indica sentido de la vía To-From")] public string atr_TF { get; set; } + [Browsable(false)] [Category("Atributos Red Navegable")] [PropertyOrder(2)] [DisplayName("From-To")] [Description("Valor del campo 'Sentido de la vía' que indica sentido de la vía From-To")] public string atr_FT { get; set; } + [Browsable(false)] [Category("Atributos Red Navegable")] [PropertyOrder(3)] [DisplayName("Sin circulación")] [Description("Valor del campo 'Sentido de la vía' que indica no circulación")] public string atr_N { get; set; } + [Browsable(false)] [Category("Atributos Red Navegable")] [PropertyOrder(4)] [DisplayName("Peatonal")] diff --git a/Services/ConfigServ.cs b/Services/ConfigServ.cs index 458d528..a1d8136 100644 --- a/Services/ConfigServ.cs +++ b/Services/ConfigServ.cs @@ -19,7 +19,7 @@ namespace OliviaAddInPro.Services public const string OlvRegKey = "SOFTWARE\\Narvaling\\Olivia_3_1"; public const string OlvRegName = "workdir"; public const string OlvConfigName = "olv.conf"; - + public const string VersionConfiguracion = "1.1.0.0"; public static ConfigServ Serv { get { @@ -42,8 +42,9 @@ namespace OliviaAddInPro.Services var ee = e; res = null; } - if(res==null) + if(res==null || res.Version==null || res.Version != VersionConfiguracion) res = Default(); + EnumOpsNWToString.ListaNw = res.ListaNw; //pilla la IP if (res.Ip.CompareTo("0.0.0.0")==0) @@ -169,8 +170,8 @@ namespace OliviaAddInPro.Services { c.path_work = "C:\\Olivia\\"; } - - + + c.Version = VersionConfiguracion; c.PathGdbGen = @"%dir_work%gdb\\BASE DE DATOS.gdb"; c.PathSimbVSM = @"%dir_work%styles\\Simbologia.style"; c.PathSimbESRI = @"%dir_work%styles\\ESRI.style"; @@ -420,8 +421,8 @@ namespace OliviaAddInPro.Services campo_peatonal = "IIF( $feature.FT_RST_AUT == 'Y' && $feature.TF_RST_AUT == 'Y', 1, 0)", campo_sentidoFT = "IIf( $feature.FT_RST_AUT == 'N', 1, 0)", campo_sentidoTf = "IIf( $feature.TF_RST_AUT == 'N', 1, 0)", - campo_elevacion_from = "IIf( $feature.F_ZLEV != null, $feature.F_ZLEV, 0", - campo_elevacion_to = "IIf( $feature.T_ZLEV != null, $feature.T_ZLEV, 0", + campo_elevacion_from = "IIf( $feature.F_ZLEV != null, $feature.F_ZLEV, 0)", + campo_elevacion_to = "IIf( $feature.T_ZLEV != null, $feature.T_ZLEV, 0)", comprueba_elevacion = false, revisa_topologia = true }); diff --git a/Services/EjecServ.cs b/Services/EjecServ.cs index 0f199ed..9bbc75b 100644 --- a/Services/EjecServ.cs +++ b/Services/EjecServ.cs @@ -390,14 +390,26 @@ namespace OliviaAddInPro.Services fields[i].Alias = ComunDef.CamposNW.cons_kph; fields[i].Tipo = "FLOAT"; fields[i].Length = 0; - i++; - + + fields[i].Name = ComunDef.CamposNW.cons_ele_f; + fields[i].Alias = ComunDef.CamposNW.cons_ele_f; + fields[i].Tipo = "FLOAT"; + fields[i].Length = 0; + i++; + + fields[i].Name = ComunDef.CamposNW.cons_ele_t; + fields[i].Alias = ComunDef.CamposNW.cons_ele_t; + fields[i].Tipo = "FLOAT"; + fields[i].Length = 0; + i++; + fields[i].Name = ComunDef.CamposNW.cons_fow; fields[i].Alias = ComunDef.CamposNW.cons_fow; fields[i].Tipo = "LONG"; fields[i].Length = 0; i++; + fields[i].Name = ComunDef.CamposNW.cons_onewFT; fields[i].Alias = ComunDef.CamposNW.cons_onewFT; fields[i].Tipo = "LONG"; @@ -420,19 +432,7 @@ namespace OliviaAddInPro.Services fields[i].Alias = ComunDef.CamposNW.cons_name; fields[i].Tipo = "TEXT"; fields[i].Length = 128; - i++; - - fields[i].Name = ComunDef.CamposNW.cons_ele_f; - fields[i].Alias = ComunDef.CamposNW.cons_ele_f; - fields[i].Tipo = "FLOAT"; - fields[i].Length = 0; - i++; - fields[i].Name = ComunDef.CamposNW.cons_ele_t; - fields[i].Alias = ComunDef.CamposNW.cons_ele_t; - fields[i].Tipo = "FLOAT"; - fields[i].Length = 0; - - i++; + if (!HelperGdb.AddFieldsSync(pathNW, fields))