diff --git a/Model/Limpieza.cs.bak b/Model/Limpieza.cs.bak new file mode 100644 index 0000000..c86c163 --- /dev/null +++ b/Model/Limpieza.cs.bak @@ -0,0 +1,78 @@ +using ArcGIS.Core.Geometry; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using OliviaAddInPro.Helper; +using System.Collections.ObjectModel; +using ArcGIS.Core.CIM; +using ArcGIS.Core.Data; +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 +{ + public class Limpieza : TratamientoComun + { + //********************************************** + //Se recogen en PaneLimpiezaSub1 + /** + * Ámbitos de trabajo elegidos + */ + public bool[] AmbitosSel { get; set; } = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; + /** + * Indica si respeta el sentido de circulación o no + */ + public bool RespCirc { get; set; } = false; + /** + * Tipo de unidades del tiempo de tto + */ + public int UdsTTto { get; set; } = (int)GeneralDef.OlvTiposTto.OlvTipTtoNoDef; + /** + * Instancia para las funciones de exportación y demás + */ + + public LimpiezaServ Serv { get; set; } = null; + public LanzaLimpSrv LanzaSrv { get; set; } = null; + + /** + * Ancho de vía, en metros + */ + public double AnchoVia { get; set; } = LimpiezaDef.Parametros.ancho_via; + public Limpieza() + { + Serv = new LimpiezaServ(this); + LanzaSrv = new LanzaLimpSrv(); +<<<<<<< HEAD +======= + ProceSrv = new ProcesoEjecServ(); + ProgrSrc = new MyCancelableProgressorSource(OliviaGlob.progrDialog.GetViewModel()); +>>>>>>> Gerardo/MarchandoUnaDe + } + + public override Respuesta Ejecuta(ModosEjec modo) + { + Respuesta res = new Respuesta { Value=false}; + Respuesta res2 = new Respuesta (){ Value = TiposEjecucion.FinEjecNOk }; + res = Serv.Ejecuta(modo); + if (res.Value) + { + res=LanzaSrv.ejec(this, modo, TipoTtoStr); + if (res.Value) + { + ProceSrv.ConfigConex(); + res2 = ProceSrv.start(LanzaSrv.str_cfg, ProgrSrc._ProgrSrc); + } + } + if (res.HasError) + { + res2.Error.AddRange(res.Error); + } + return res2; + } + } +} diff --git a/Model/Recogida.cs.bak b/Model/Recogida.cs.bak new file mode 100644 index 0000000..92a718c --- /dev/null +++ b/Model/Recogida.cs.bak @@ -0,0 +1,105 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using OliviaAddInPro.Helper; +using OliviaAddInPro.Services; +using ArcGIS.Core.Geometry; +using static OliviaAddInPro.Model.ComunDef; +using ArcGIS.Desktop.Framework.Threading.Tasks; +using OliviaAddInPro.Services.LanzaSrv; + +namespace OliviaAddInPro.Model +{ + class Recogida : TratamientoComun + { + //********************************************** + //Se recogen en PaneRecogidaSub1 + /** + * Tipo de fracción + */ + public int TipoFrac { get; set; } = -1; + /** + * Tipo de fracción + */ + public string TipoFracStr { get; set; } = string.Empty; + /** + * Tipo de carga + */ + public int TipoCarg { get; set; } = -1; + /** + * Tipo de carga + */ + public string TipoCargStr { get; set; } = string.Empty; + /** + * Tipo de Vehículo + */ + public int TipoVehic { get; set; } = -1; + /** + * Tipo de Lateralidad + */ + public int TipoLate { get; set; } = -1; + /** + * kg capac camión + */ + public int KgMaxVehic { get; set; } = 0; + /** + * dens contenedor + */ + public int DensCont { get; set; } = 0; + /** + * Tiempo de vaciado del contenedor, en seg + */ + public int TVaciCont { get; set; } = 0; + /** + * kg de carga en cada contenedor + */ + public int KgCont { get; set; } = 0; + /** + * grados en º de giro del vehículo + */ + public int GiroVehic { get; set; } = 0; + + /* + * + * */ + public double AnchoVehiculo + { + get; + set; + } + public RecogidaServ Serv { get; set; } = null; + public LanzaRecoSrv LanzaSrv { get; set; } = null; + public Recogida() + { + Serv = new RecogidaServ(this); +<<<<<<< HEAD + LanzaSrv = new LanzaRecoSrv(); +======= + ProgrSrc = new MyCancelableProgressorSource(OliviaGlob.progrDialog.GetViewModel()); +>>>>>>> Gerardo/MarchandoUnaDe + } + + public override Respuesta Ejecuta(ModosEjec modo) + { + Respuesta res = new Respuesta { Value = false }; + Respuesta res2 = new Respuesta() { Value = TiposEjecucion.FinEjecNOk }; + res = Serv.Ejecuta(modo); + if (res.Value) + { + res = LanzaSrv.ejec(this, modo, TipoTtoStr); + if (res.Value) + { + ProceSrv.ConfigConex(); + res2 = ProceSrv.start(LanzaSrv.str_cfg, ProgrSrc._ProgrSrc); + } + } + if (res.HasError) + { + res2.Error.AddRange(res.Error); + } + return res2; + } + } +} diff --git a/Model/TratamientoComun.cs b/Model/TratamientoComun.cs index 6410e45..e0c2924 100644 --- a/Model/TratamientoComun.cs +++ b/Model/TratamientoComun.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; using ArcGIS.Core.Geometry; using ArcGIS.Desktop.Internal.Layouts.Utilities; using OliviaAddInPro.Helper; +using OliviaAddInPro.Model.contract; using OliviaAddInPro.Services; using static OliviaAddInPro.Model.ComunDef; @@ -138,7 +139,7 @@ namespace OliviaAddInPro.Model public TratamientoComun() { - ProgrSrc = new MyCancelableProgressorSource(OliviaGlob.progrDialog); + ProgrSrc = new MyCancelableProgressorSource(OliviaGlob.progrDialog.GetViewModel()); ProceSrv = new ProcesoEjecServ(); FinProceSrv = new FinProcServ(); } diff --git a/Services/ProcesoEjecServ.cs b/Services/ProcesoEjecServ.cs index 2667ee0..fc05fb0 100644 --- a/Services/ProcesoEjecServ.cs +++ b/Services/ProcesoEjecServ.cs @@ -51,7 +51,7 @@ namespace OliviaAddInPro.Services { } - public Respuesta start(string cfg, CancelableProgressorSource cps) + public Respuesta start(string cfg, IprocessManager cps) { this.cps = cps; soc = new Cstr_socket(); diff --git a/Services/ProcesoEjecServ.cs.bak b/Services/ProcesoEjecServ.cs.bak new file mode 100644 index 0000000..e9d2a33 --- /dev/null +++ b/Services/ProcesoEjecServ.cs.bak @@ -0,0 +1,511 @@ +using ArcGIS.Desktop.Framework.Threading.Tasks; +using OliviaAddIn; +using OliviaAddInPro.Model; +using OliviaAddInPro.Model.contract; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace OliviaAddInPro.Services +{ + public class ProcesoEjecServ + { + Cstr_socket soc = null; + int m_out=0; + int m_miliseconds=200; + int m_tm_progr=1000; + int modo_fin = 0; + bool cancela = false; + bool cancela_fin = false; + bool conectado = false; + bool permu = false; + bool cancela_permu = false; + int progr = 0; + string args = ""; + string str_cfg = ""; + string tarea = ""; + public string err_str = ""; + double x, y; + IprocessManager cps; + enum TiposActu + { + ActuMal, + ActuNoActu, + ActuBien, + ActuPermu, + ActuMulti, + ActuFinOk, + ActuSect, + ActuPlan, + ActuFinNOk, + ActuN, + } + + public string Ip { get; set; } + public int Puerto { get; set; } + + public ProcesoEjecServ() + { + + } +<<<<<<< HEAD + public Respuesta start(string cfg, CancelableProgressorSource cps) +======= + public Respuesta start(string cfg, IprocessManager cps) +>>>>>>> Gerardo/MarchandoUnaDe + { + this.cps = cps; + soc = new Cstr_socket(); + + str_cfg = cfg; + /* + await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() => + { + run(); + };*/ + return run(); + } + private Respuesta run() + { + int nint = 0; + int nint_max = 5; + bool sal = false; + bool first_send_cfg = true; + bool fin = false; + int lastprog = 0; + var res = new Respuesta() { Value = TiposEjecucion.FinEjecNOk }; + + try + { + do + { + Thread.Sleep(m_miliseconds); + + if (first_send_cfg)//a continuación envía la configuración + { + Thread.Sleep(500); + if (!envia_cfg()) + { + if (nint >= nint_max) + { + res.Error.Add("Error en la comunicación con OliviaTask"); + var act = new Respuesta() { Value = TiposActu.ActuFinNOk }; + act.Error.AddRange(res.Error); + actualiza(act); + sal = true; + } + else + nint++; + } + else + { + first_send_cfg = false; + nint = 0; + } + } + + if (cps.Getcancelled()) //mira a ver si ha cancelado el usuario + { + //se ha cancelado, lo envía al OliviaTask + envia_cancel(); + if (!cancela_permu) + sal = true; + else + { + cancela_permu = false; + } + } + else if (!first_send_cfg && ((Math.Abs(Environment.TickCount) - lastprog) >= m_tm_progr) && !fin) //en caso normal, todo va bien, pide el progreso y la tarea + { + //solo pide la programación cada m_tm_progr milis + var pp = pide_progr(); + if (pp .Value> TiposActu.ActuFinOk) + fin = true; + if(pp.HasError) + { + if (nint >= nint_max) + { + res.Error.Add(pp.Error.FirstOrDefault()); + sal = true; + } + else + nint++; + } + actualiza(pp); + lastprog = Environment.TickCount; + } + + } while (!sal); + + } + catch (Exception e) + { + res.Error.Add(e.Message); + //MessageBox.Show("Error durante el proceso.", "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Error); + return res; + } + if (!res.HasError) + res.Value = TiposEjecucion.FinEjecOk; + return res; + } + //funciones auxiliares---------------------------------------- + private bool conecta() + { + if (!conectado) + { + if (!soc.conecta(Ip, Puerto)) + { + conectado = false; + return false; + } + conectado = true; + } + return true; + } + /** + * Envía la información de la configuración por socket a OliviaTask + */ + public bool envia_cfg() + { + string args; + + try + { + if (!conecta()) + return false; + + if (str_cfg == null || str_cfg.Length == 0) + return false; + + if (!soc.envia(str_cfg)) + { + conectado = false; + return false; + } + + args = soc.recibe(); + if ((args.Length == 0) || (args != GeneralDef.SockConfOk)) + return false; + + return true; + } + catch (Exception) + { + return false; + } + } + /** + * Pide por socket la información de sectorización a OliviaTask + */ + private bool pide_sect() + { + //pide sectorización porque ya ha sido avisado de que ha terminado + try + { + if (!conecta()) + return false; + + //pide secto + if (!soc.envia(GeneralDef.SockSect)) + { + conectado = false; + return false; + } + + //recibe sectorización + args = soc.recibe(); + if (args.Length == 0) + return false; + + return true; + } + catch (Exception) + { + return false; + } + } + /** + * Pide por socket la información de progreso a OliviaTask + * Devuelve 0 si ha ido mal, 1 si ha ido bien, 2 si ha recibido que hay que pedir sectorización + */ + private Respuesta pide_progr() + { + TiposActu tt; + int i; + var res = new Respuesta { Value = TiposActu.ActuMal }; + //pide progreso y tarea por la que va + try + { + if (!conecta()) + { + res.Error.Add("Error en la comunicación con OliviaTask"); + return res; + } + + //pide progreso + if (!soc.envia(GeneralDef.SockProgr)) + { + conectado = false; + res.Error.Add("Error en la comunicación con OliviaTask"); + return res; + } + + //recibe progreso + args = soc.recibe(); + if (args.Length == 0) + { + res.Value = TiposActu.ActuNoActu; + return res; + } + + //comprueba progreso + try + { + progr = Convert.ToInt32(args); + if (progr < 0 || progr > GeneralDef.ProgrMax) + { + res.Value = TiposActu.ActuNoActu; + return res; + } + } + catch + { + res.Value = TiposActu.ActuNoActu; + return res; + } + + //pide tarea + if (!soc.envia(GeneralDef.SockTarea)) + { + res.Error.Add( ""); + return res; + } + + //recibe tarea + args = soc.recibe(); + if (args.Length == 0) + { + res.Error.Add("Error recibe tarea mal"); + return res; + } + if (args == "0") //se ha mezclado el progreso, vuelve a recibir la tarea + args = soc.recibe(); + if (args.Length == 0) + { + res.Error.Add("Error recibe tarea mal"); + return res; + } + + i = 0; + tt = TiposActu.ActuBien; + //comprueba tarea + if (args.StartsWith(GeneralDef.SockSectFin)) + { + i = GeneralDef.SockSectFin.Length; + tt = TiposActu.ActuSect; + } + else if (args.StartsWith(GeneralDef.SockPlanFin)) + { + i = GeneralDef.SockPlanFin.Length; + tt = TiposActu.ActuPlan; + } + else if (args.StartsWith(GeneralDef.SockFinOk)) + { + i = GeneralDef.SockFinOk.Length; + tt = TiposActu.ActuFinOk; + } + else if (args.StartsWith(GeneralDef.SockFinNOk)) + { + i = GeneralDef.SockFinNOk.Length; + tt = TiposActu.ActuFinNOk; + } + else if (args.Contains("permutaciones")) + { + tt = TiposActu.ActuPermu; + } + else if (args.Contains("multitask")) + { + tt = TiposActu.ActuMulti; + } + modo_fin = (int)tt; + + tarea = args.Substring(i); + res.Value = tt; + return res; + } + catch (Exception) + { + res.Error.Add("Error al preguntar por el progreso."); + return res; + } + } + /** + * Envía a OliviaTask la orden de cancelar el proceso + */ + private Respuesta envia_cancel() + { + var res = new Respuesta { Value = false }; + try + { + if (!conectado) + return res; + + //envía cancel + if (!soc.envia(GeneralDef.SockCanc)) + return res; + + //recibe respuesta + args = soc.recibe(); + if (args.Length == 0) + return res; + + //comprueba que ok + if (args != GeneralDef.SockCancOk) + return res; + res.Value = true; + return res; + } + catch (Exception) + { + res.Error.Add("Error al cancelar el progreso."); + res.Value = false; + //MessageBox.Show("Error al cancelar el progreso.", "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Error); + return res; + } + } + /** + * Actualiza la barra de progreso + * bool fallo_soc : indica si ha habido fallo en el socket + */ + private void actualiza(Respuesta actu) + { + try + { + permu = false; + //actualiza la barra de tarea y el texto + switch (actu.Value) + { + case TiposActu.ActuBien: + { + pon_progr(progr); + pon_texto(tarea); + break; + } + case TiposActu.ActuMal: + { + if (actu.HasError) + pon_texto(actu.Error.FirstOrDefault()); + else + pon_texto(tarea); + break; + } + case TiposActu.ActuFinOk: + { + pon_progr(100); + pon_texto("Finalizado proceso con éxito"); + break; + } + case TiposActu.ActuFinNOk: + { + pon_progr(100); + err_str = "Finalizado proceso con fallos\n" + tarea; + pon_texto(err_str); + break; + } + case TiposActu.ActuSect: + { + pon_progr(100); + pon_texto("Finalizada sectorización\n" + tarea); + break; + } + case TiposActu.ActuPlan: + { + pon_progr(100); + pon_texto("Finalizada planificación\n" + tarea); + break; + } + case TiposActu.ActuPermu: + { + permu = true; + pon_texto(tarea); + //pon_estilo(ProgressBarStyle.Marquee); + break; + } + case TiposActu.ActuMulti: + { + pon_texto(tarea); + //pon_estilo(ProgressBarStyle.Marquee); + break; + } + default: + return; + } + /* + if (actu != TiposActu.ActuPermu && actu != TiposActu.ActuMulti) + pon_estilo(ProgressBarStyle.Continuous);*/ + pon_barstate(actu.Value); + } + catch (Exception) + { + //MessageBox.Show("Error al actualizar el progreso.", "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + /* + * Para poder actualizar el texto de la ventana de progreso hay que llamar a invoke + * porque está desde otro thread + */ + private void pon_texto(String txt) + { + cps.SetEstado(txt); + } + /* + * Para poder actualizar la barra de progreso hay que llamar a invoke + * porque está desde otro thread + * Actualiza el tipo de progreso y el texto + */ + private void pon_estilo() + { + //cps.Status + } + /* + * Para poder actualizar la barra de progreso hay que llamar a invoke + * porque está desde otro thread + * Actualiza el estilo para indicar que ha habido error + */ + private void pon_barstate(TiposActu actu) + { + int col = 1; + + + if ((actu == TiposActu.ActuMal) || (actu == TiposActu.ActuFinNOk)) + cps.SetProceso("Proceso Finalizado con errores."); + else if(actu == TiposActu.ActuFinOk) + cps.SetProceso("Proceso Finalizado."); + + if (actu > TiposActu.ActuFinOk) + cps.SetEstado("Calculando..."); + if ((actu == TiposActu.ActuPermu) && !cancela) + cps.SetEstado("Calculando Permutaciones..."); + } + /* + * Para poder actualizar la barra de progreso hay que llamar a invoke + * porque está desde otro thread + * Actualiza el progreso + */ + private void pon_progr(int pro) + { + cps.SetProgress( pro); + } + + //configura los parámetros de la conexión + public void ConfigConex() + { + var conf = ConfigServ.Serv.Leer(); + Puerto = conf.Puerto; + Ip = conf.Ip; + } + } +} \ No newline at end of file diff --git a/ViewModel/Limpieza/PaneLimpiezaViewModel.cs b/ViewModel/Limpieza/PaneLimpiezaViewModel.cs index 1070f90..090046e 100644 --- a/ViewModel/Limpieza/PaneLimpiezaViewModel.cs +++ b/ViewModel/Limpieza/PaneLimpiezaViewModel.cs @@ -174,12 +174,12 @@ namespace OliviaAddInPro /** * Acciones para comenzar ejecucin */ - public void Ejecuta(OliviaAddInPro.Services.ModosEjec modo) + public void Ejecuta(OliviaAddInPro.Services.ModosEjec modo) { string err = ""; //marchando - - + + OliviaGlob.Limp.ProgrSrc = new MyCancelableProgressorSource(OliviaGlob.progrDialog.GetViewModel()); OliviaGlob.progrDialog.Show(); @@ -191,10 +191,8 @@ namespace OliviaAddInPro HelperGlobal.ponMsg(err); return; } - - Action ac = OliviaGlob.finEjecuta; - OliviaGlob.Limp.EjecutaAsync(modo, ac); - + OliviaGlob.limp.ComienzaEjec(modo); + } } } diff --git a/ViewModel/Limpieza/PaneLimpiezaViewModel.cs.bak b/ViewModel/Limpieza/PaneLimpiezaViewModel.cs.bak index 830fd96..219c848 100644 --- a/ViewModel/Limpieza/PaneLimpiezaViewModel.cs.bak +++ b/ViewModel/Limpieza/PaneLimpiezaViewModel.cs.bak @@ -10,12 +10,14 @@ using OliviaAddInPro.Helper; using static OliviaAddInPro.Model.ComunDef; using ArcGIS.Desktop.Framework.Threading.Tasks; using ArcGIS.Desktop.Framework.Contracts; + namespace OliviaAddInPro { class PaneLimpiezaViewModel : PanelViewModelBase { private PaneLimpiezaSub1ViewModel _subPanel1ViewModel; - + Limpieza limp; + public MarchandoUnaDe marchando; public PaneLimpiezaViewModel() { _subPanel1ViewModel = new PaneLimpiezaSub1ViewModel(); @@ -30,8 +32,8 @@ namespace OliviaAddInPro new OptionsMenuItem(new BitmapImage(new Uri("pack://application:,,,/OliviaAddInPro;component/Resources/ptosctrl.png")), Resource1.String_ctrol, _subPanel3ViewModel), new OptionsMenuItem(new BitmapImage(new Uri("pack://application:,,,/OliviaAddInPro;component/Resources/time.png")), Resource1.String_tiempos, _subPanel4ViewModel) }; - SelectedOption = OptionsMenu[0]; - // OliviaGlob.limp = OliviaGlob.Limp; + SelectedOption = OptionsMenu[0]; + limp = OliviaGlob.Limp; } public override string DisplayName { @@ -77,7 +79,12 @@ namespace OliviaAddInPro err_str = "No se ha seleccionado ninguna Capa de Limpieza"; return false; } - OliviaGlob.limp.CapaElems = _subPanel1ViewModel.CapaElems; + limp.CapaElems = _subPanel1ViewModel.CapaElems; + //pone que la capa de elementos es la red navegable, que es la que va a exportar + if (_subPanel1ViewModel.SelOpAmb == 1) + { + limp.CapaElems = OliviaGlob.Paths.PathGdbNw; + } //lee el tipo tto if (_subPanel1ViewModel.TipoTto == (int)LimpiezaDef.TiposTto.TtoNoDef) @@ -85,31 +92,26 @@ namespace OliviaAddInPro err_str = "No se ha seleccionado ningn Tipo de Tratamiento"; return false; } -<<<<<<< HEAD - OliviaGlob.limp.TipoTto = _subPanel1ViewModel.TipoTto; - -======= limp.TipoTto = _subPanel1ViewModel.TipoTto; limp.TipoTtoStr = LimpiezaDef.tto_gdb[_subPanel1ViewModel.TipoTto]; ->>>>>>> Elena/reco //lee el/los mbito seleccionado if (!_subPanel1ViewModel.lee_ambitos()) { err_str = "No se ha seleccionado ningn mbito de trabajo"; return false; } - OliviaGlob.limp.AmbitosSel = _subPanel1ViewModel.AmbitosSel; + limp.AmbitosSel = _subPanel1ViewModel.AmbitosSel; int i = 0; - for (i = 0; i < OliviaGlob.limp.AmbitosSel.Length; i++) - if (OliviaGlob.limp.AmbitosSel[i]) + for (i = 0; i < limp.AmbitosSel.Length; i++) + if (limp.AmbitosSel[i]) break; - if(i>= OliviaGlob.limp.AmbitosSel.Length) + if(i>= limp.AmbitosSel.Length) { err_str = "No se ha seleccionado ningn mbito de trabajo"; return false; } //lee si respeta circulacion - OliviaGlob.limp.RespCirc = _subPanel1ViewModel.RespCirc; + limp.RespCirc = _subPanel1ViewModel.RespCirc; //lee velo de desplazamiento int vv = -1; @@ -123,7 +125,7 @@ namespace OliviaAddInPro err_str = "La velocidad de desplazamiento no est dentro de los lmites configurados"; return false; } - OliviaGlob.limp.VDespl = vv; + limp.VDespl = vv; //lee tiempo de tto if ((_subPanel1ViewModel.TimeTto == 0) || @@ -132,11 +134,31 @@ namespace OliviaAddInPro err_str = "El tiempo de tratamiento no est dentro de los lmites configurados"; return false; } - OliviaGlob.limp.Ttto = _subPanel1ViewModel.TimeTto; - OliviaGlob.limp.UdsTTto = _subPanel1ViewModel.UdsTTto; + limp.Ttto = _subPanel1ViewModel.TimeTto; + limp.UdsTTto = _subPanel1ViewModel.UdsTTto; + + //lee el ancho medio de la va si est visible (se ha seleccionado la opcin genrica Eje de calles) + limp.AnchoVia = LimpiezaDef.Parametros.ancho_via; + if (_subPanel1ViewModel.VisTextAnchoVia == System.Windows.Visibility.Visible) + { + try + { + limp.AnchoVia = Convert.ToDouble(_subPanel1ViewModel.TextAnchoVia); + if ((limp.AnchoVia == 0) || (limp.AnchoVia > LimpiezaDef.Parametros.ancho_viaM) || (limp.AnchoVia < LimpiezaDef.Parametros.ancho_viam)) + { + err_str = "El ancho de la va no est dentro de los lmites configurados"; + return false; + } + } + catch (FormatException) + { + err_str = "El formato introducido para el ancho de la va no es vlido."; + return false; + } + } //lee las propiedades comunes a recogida - if (!LeeComun(OliviaGlob.limp,out err_str)) + if (!LeeComun(limp,out err_str)) { return false; } @@ -155,28 +177,32 @@ namespace OliviaAddInPro public void Ejecuta(OliviaAddInPro.Services.ModosEjec modo) { string err = ""; +<<<<<<< HEAD + //comprueba datos de la ventana +======= + //marchando - + + OliviaGlob.Limp.ProgrSrc = new MyCancelableProgressorSource(OliviaGlob.progrDialog.GetViewModel()); OliviaGlob.progrDialog.Show(); - var progSrc = new CancelableProgressorSource(OliviaGlob.progrDialog); + //oculta la ventana + OliviaGlob.ShowHidePane(false); +>>>>>>> Gerardo/MarchandoUnaDe if (!Lee(out err)) { HelperGlobal.ponMsg(err); return; } +<<<<<<< HEAD + OliviaGlob.Limp.ComienzaEjec(modo); +======= - Action ac = finEjecuta; - OliviaGlob.Limp.EjecutaAsync(modo, progSrc, ac); - } - public void finEjecuta(TareaRes res) - { - OliviaGlob.progrDialog.Hide(); - if (res.Errores) - { - HelperGlobal.ponMsg(res.msg); - } + Action ac = OliviaGlob.finEjecuta; + OliviaGlob.Limp.EjecutaAsync(modo, ac); + +>>>>>>> Gerardo/MarchandoUnaDe } } }