From 9a07f921ceef721015c776e14a4b0dcbea675e35 Mon Sep 17 00:00:00 2001 From: Gerardo Date: Sun, 6 Feb 2022 12:25:31 +0100 Subject: [PATCH] Avance Proceso --- Model/Limpieza.cs | 6 +++++ Services/ConfigServ.cs | 49 +++++++++++++++++++++++++++++++------ Services/ProcesoEjecServ.cs | 2 +- 3 files changed, 49 insertions(+), 8 deletions(-) diff --git a/Model/Limpieza.cs b/Model/Limpieza.cs index 0abf541..aef3624 100644 --- a/Model/Limpieza.cs +++ b/Model/Limpieza.cs @@ -12,6 +12,7 @@ using OliviaAddInPro.Services; using static OliviaAddInPro.Model.ComunDef; using ArcGIS.Desktop.Framework.Contracts; using ArcGIS.Desktop.Framework.Threading.Tasks; +using OliviaAddInPro.Services.LanzaSrv; namespace OliviaAddInPro.Model { @@ -40,6 +41,9 @@ namespace OliviaAddInPro.Model */ public LimpiezaServ Serv { get; set; } = null; + public LanzaLimpSrv LanzaSrv { get; set; } = null; + public ProcesoEjecServ ProceSrv { get; set; } = null; + /** * Ancho de vía, en metros */ @@ -56,6 +60,8 @@ namespace OliviaAddInPro.Model res = Serv.Sectoriza(cps); else if (modo == ModosEjec.Planifica) res = Serv.Planifica(cps); + // + return res; } public async void EjecutaAsync(ModosEjec modo, CancelableProgressorSource cps, Action ffin) diff --git a/Services/ConfigServ.cs b/Services/ConfigServ.cs index 9164b18..d0a718d 100644 --- a/Services/ConfigServ.cs +++ b/Services/ConfigServ.cs @@ -40,6 +40,14 @@ namespace OliviaAddInPro.Services if(res==null) res = Default(); + + res.PathGdbGen = pon_path_absoluto(res.PathGdbGen, res.path_work); + 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_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); @@ -52,12 +60,23 @@ namespace OliviaAddInPro.Services conf.path_temp = pon_path_relativo(conf.path_temp, conf.path_work); conf.path_data = pon_path_relativo(conf.path_data, conf.path_work); + conf.PathGdbGen = pon_path_relativo(conf.PathGdbGen, conf.path_work); + 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); + string jsonString = JsonConvert.SerializeObject(conf); File.WriteAllText(GetPathConfig(), 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); + conf.PathGdbGen = pon_path_absoluto(conf.PathGdbGen, conf.path_work); + 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); } /** * cambia la carpeta referida a directorio de trabajo por los caracteres OliviaDirWork (%dir_work%) @@ -99,19 +118,35 @@ namespace OliviaAddInPro.Services } 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"; + var c = new OliviaConf(); + c.path_work = "C:\\Olivia\\"; + try + { + var path = GetPathConfig(); + if(!string.IsNullOrEmpty(path)) + { + c.path_work = Path.GetDirectoryName(path) + "\\"; + } + + } + catch + { + c.path_work = "C:\\Olivia\\"; + } + + + c.PathGdbGen = @"%dir_work%gdb\\BASE DE DATOS.gdb"; + c.PathSimbVSM = @"%dir_work%styles\\Simbologia.style"; + c.PathSimbESRI = @"%dir_work%styles\\ESRI.style"; + c.PathCartela = @"%dir_work%data\\Plantilla.mxd"; c.consulta_sector = "SECTOR"; c.consulta_secuen = "SECUENCIA"; - c.red_carreteras = @"C:\Proyectos\Olivia\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_work = "C:\\Olivia\\"; + c.path_exe=@"%dir_work%bin\OliviaTasks.exe"; c.path_temp = @"%dir_work%temp\"; c.path_data=@"%dir_work%data\"; diff --git a/Services/ProcesoEjecServ.cs b/Services/ProcesoEjecServ.cs index 86644c3..3eae35c 100644 --- a/Services/ProcesoEjecServ.cs +++ b/Services/ProcesoEjecServ.cs @@ -10,7 +10,7 @@ using System.Threading.Tasks; namespace OliviaAddInPro.Services { - class ProcesoEjecServ + public class ProcesoEjecServ { Cstr_socket soc = null; int m_out;