Avance Proceso

ConfiguracionSimplificada
Gerardo 2022-02-06 12:25:31 +01:00
parent 4eb26ba4ef
commit 9a07f921ce
3 changed files with 49 additions and 8 deletions

View File

@ -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<TareaRes> ffin)

View File

@ -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\";

View File

@ -10,7 +10,7 @@ using System.Threading.Tasks;
namespace OliviaAddInPro.Services
{
class ProcesoEjecServ
public class ProcesoEjecServ
{
Cstr_socket soc = null;
int m_out;