diff --git a/OliviaAddInPro.csproj b/OliviaAddInPro.csproj index ed4b0b8..9c95183 100644 --- a/OliviaAddInPro.csproj +++ b/OliviaAddInPro.csproj @@ -130,7 +130,6 @@ - diff --git a/View/DockpaneLimpieza.xaml b/View/DockpaneLimpieza.xaml index 945a429..4227596 100644 --- a/View/DockpaneLimpieza.xaml +++ b/View/DockpaneLimpieza.xaml @@ -9,7 +9,7 @@ xmlns:viewModel="clr-namespace:OliviaAddInPro" xmlns:view="clr-namespace:OliviaAddInPro" mc:Ignorable="d" - d:DesignHeight="300" d:DesignWidth="300" + d:DesignHeight="500" d:DesignWidth="300" d:DataContext="{Binding Path=ui.DockpaneLimpiezaViewModel}"> diff --git a/View/NumberSpin.cs b/View/NumberSpin.cs deleted file mode 100644 index b48c790..0000000 --- a/View/NumberSpin.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Xceed.Wpf.Toolkit; - -namespace OliviaAddInPro -{ - class NumberSpin : IntegerUpDown - { - } -} diff --git a/View/PaneLimpieza.xaml b/View/PaneLimpieza.xaml index 48d653e..1c677ef 100644 --- a/View/PaneLimpieza.xaml +++ b/View/PaneLimpieza.xaml @@ -46,7 +46,7 @@ - + diff --git a/View/PaneLimpiezaSub1.xaml b/View/PaneLimpiezaSub1.xaml index 0c7a330..0567df8 100644 --- a/View/PaneLimpiezaSub1.xaml +++ b/View/PaneLimpiezaSub1.xaml @@ -6,7 +6,7 @@ xmlns:extensions="clr-namespace:ArcGIS.Desktop.Extensions;assembly=ArcGIS.Desktop.Extensions" xmlns:ui="clr-namespace:OliviaAddInPro" mc:Ignorable="d" d:DesignWidth="300" - d:DataContext="{Binding Path=ui.PaneLimpiezaSub1ViewModel}" Height="300"> + d:DataContext="{Binding Path=ui.PaneLimpiezaSub1ViewModel}" Height="350"> @@ -14,7 +14,7 @@ - + + + + + + + + + + + + + + + + + + + diff --git a/View/PaneLimpiezaSub1.xaml.cs b/View/PaneLimpiezaSub1.xaml.cs index 26f8208..d8a3a67 100644 --- a/View/PaneLimpiezaSub1.xaml.cs +++ b/View/PaneLimpiezaSub1.xaml.cs @@ -30,5 +30,14 @@ namespace OliviaAddInPro { } + + private void TextBox_velodespl_PreviewTextInput(object sender, TextCompositionEventArgs e) + { + e.Handled = !PanelGlobal.IsValid(((TextBox)sender).Text + e.Text, 1, 100); + } + private void TextBox_tiempotto_PreviewTextInput(object sender, TextCompositionEventArgs e) + { + e.Handled = !PanelGlobal.IsValid(((TextBox)sender).Text + e.Text, 1, 100); + } } } diff --git a/View/PaneLimpiezaSub2.xaml b/View/PaneLimpiezaSub2.xaml index a15521d..a3f50a7 100644 --- a/View/PaneLimpiezaSub2.xaml +++ b/View/PaneLimpiezaSub2.xaml @@ -29,7 +29,7 @@ - diff --git a/View/PaneLimpiezaSub2.xaml.cs b/View/PaneLimpiezaSub2.xaml.cs index de9932a..b0a1f24 100644 --- a/View/PaneLimpiezaSub2.xaml.cs +++ b/View/PaneLimpiezaSub2.xaml.cs @@ -25,5 +25,11 @@ namespace OliviaAddInPro { InitializeComponent(); } + + private void TextBox_PreviewTextInput(object sender, TextCompositionEventArgs e) + { + e.Handled = !PanelGlobal.IsValid(((TextBox)sender).Text + e.Text,0,9999); + } + } } diff --git a/View/PaneLimpiezaSub3.xaml b/View/PaneLimpiezaSub3.xaml index cbcb500..7c8de59 100644 --- a/View/PaneLimpiezaSub3.xaml +++ b/View/PaneLimpiezaSub3.xaml @@ -17,15 +17,16 @@ + diff --git a/View/PaneLimpiezaSub4.xaml b/View/PaneLimpiezaSub4.xaml index ab5290c..ac24e9e 100644 --- a/View/PaneLimpiezaSub4.xaml +++ b/View/PaneLimpiezaSub4.xaml @@ -4,6 +4,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:extensions="clr-namespace:ArcGIS.Desktop.Extensions;assembly=ArcGIS.Desktop.Extensions" + xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid" xmlns:ui="clr-namespace:OliviaAddInPro" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300" @@ -15,5 +16,56 @@ - + + diff --git a/View/PaneLimpiezaSub4.xaml.cs b/View/PaneLimpiezaSub4.xaml.cs index 64bce09..bfa2918 100644 --- a/View/PaneLimpiezaSub4.xaml.cs +++ b/View/PaneLimpiezaSub4.xaml.cs @@ -25,5 +25,11 @@ namespace OliviaAddInPro { InitializeComponent(); } + + private void TextBox_PreviewTextInput(object sender, TextCompositionEventArgs e) + { + e.Handled = !PanelGlobal.IsValid(((TextBox)sender).Text + e.Text, 0,100); + } + } } diff --git a/ViewModel/PaneLimpiezaSub1ViewModel.cs b/ViewModel/PaneLimpiezaSub1ViewModel.cs index cf790d7..f8c236d 100644 --- a/ViewModel/PaneLimpiezaSub1ViewModel.cs +++ b/ViewModel/PaneLimpiezaSub1ViewModel.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Threading.Tasks; using ArcGIS.Core.CIM; using ArcGIS.Core.Data; +using ArcGIS.Core.Data.UtilityNetwork.Trace; using ArcGIS.Core.Geometry; using ArcGIS.Desktop.Catalog; using ArcGIS.Desktop.Core; @@ -22,6 +23,10 @@ namespace OliviaAddInPro public PaneLimpiezaSub1ViewModel () { lblCapaLimp = Resource1.String_selec_capa; + timeTto = 10; + textVeloDespl = 10; + lblUdsTimeTto = "min"; + lblUdsVeloDespl = "km/h"; } #region Properties @@ -35,7 +40,33 @@ namespace OliviaAddInPro public string LblCapaLimp { get { return lblCapaLimp; } - set { LblCapaLimp=lblCapaLimp; } + set { base.SetProperty(ref lblCapaLimp, value, () => LblCapaLimp); } + } + + private int textVeloDespl; + public int TextVeloDespl + { + get { return textVeloDespl; } + set { base.SetProperty(ref textVeloDespl, value, () => TextVeloDespl); } + } + private string lblUdsVeloDespl; + public string LblUdsVeloDespl + { + get { return lblUdsVeloDespl; } + set { base.SetProperty(ref lblUdsVeloDespl, value, () => LblUdsVeloDespl); } + } + + private int timeTto; + public int TimeTto + { + get { return timeTto; } + set { base.SetProperty(ref timeTto, value, () => TimeTto); } + } + private string lblUdsTimeTto; + public string LblUdsTimeTto + { + get { return lblUdsTimeTto; } + set { base.SetProperty(ref lblUdsTimeTto, value, () => LblUdsTimeTto); } } #endregion Properties diff --git a/ViewModel/PaneLimpiezaSub2ViewModel.cs b/ViewModel/PaneLimpiezaSub2ViewModel.cs index e221c19..0246344 100644 --- a/ViewModel/PaneLimpiezaSub2ViewModel.cs +++ b/ViewModel/PaneLimpiezaSub2ViewModel.cs @@ -22,7 +22,7 @@ namespace OliviaAddInPro public PaneLimpiezaSub2ViewModel() { lblCapaRestr= lblCapaNiv= lblCapaZon= lblCapaInst = Resource1.String_selec_capa; - txtBuffExport = "1000"; + txtBuffExport = 1000; } @@ -37,31 +37,31 @@ namespace OliviaAddInPro public string LblCapaRestr { get { return lblCapaRestr; } - set { LblCapaRestr = lblCapaRestr; } + set { base.SetProperty(ref lblCapaRestr, value, () => LblCapaRestr); } } private string lblCapaNiv; public string LblCapaNiv { get { return lblCapaNiv; } - set { LblCapaNiv = lblCapaNiv; } + set { base.SetProperty(ref lblCapaNiv, value, () => LblCapaNiv); } } private string lblCapaZon; public string LblCapaZon { get { return lblCapaZon; } - set { LblCapaZon = lblCapaZon; } + set { base.SetProperty(ref lblCapaZon, value, () => LblCapaZon); } } private string lblCapaInst; public string LblCapaInst { get { return lblCapaInst; } - set { LblCapaInst = lblCapaInst; } + set { base.SetProperty(ref lblCapaInst, value, () => LblCapaInst); } } - private string txtBuffExport; - public string TxtBuffExport + private int txtBuffExport; + public int TxtBuffExport { get { return txtBuffExport; } - set { TxtBuffExport = txtBuffExport; } + set { base.SetProperty(ref txtBuffExport, value, () => TxtBuffExport); } } #endregion Properties } diff --git a/ViewModel/PaneLimpiezaSub3ViewModel.cs b/ViewModel/PaneLimpiezaSub3ViewModel.cs index 15d9f63..8adf319 100644 --- a/ViewModel/PaneLimpiezaSub3ViewModel.cs +++ b/ViewModel/PaneLimpiezaSub3ViewModel.cs @@ -21,7 +21,8 @@ namespace OliviaAddInPro { public PaneLimpiezaSub3ViewModel() { - + numPtosCtrl = numSect = 3; + checkAjustSect = checkSectAuto = false; } @@ -32,13 +33,34 @@ namespace OliviaAddInPro get { return Resource1.String_ctrol; } } - /*private string lblCapaRestr; - public string LblCapaRestr + private int numPtosCtrl; + public int NumPtosCtrl { - get { return lblCapaRestr; } - set { LblCapaRestr = lblCapaRestr; } - }*/ - + get { return numPtosCtrl; } + set { base.SetProperty(ref numPtosCtrl, value, () => NumPtosCtrl); } + } + + private int numSect; + public int NumSect + { + get { return numSect; } + set { base.SetProperty(ref numSect, value, () => NumSect); } + } + + private bool checkSectAuto; + public bool CheckSectAuto + { + get { return checkSectAuto; } + set { base.SetProperty(ref checkSectAuto, value, () => CheckSectAuto); } + } + + private bool checkAjustSect; + public bool CheckAjustSect + { + get { return checkAjustSect; } + set { base.SetProperty(ref checkAjustSect, value, () => CheckAjustSect); } + } + #endregion Properties } } diff --git a/ViewModel/PaneLimpiezaSub4ViewModel.cs b/ViewModel/PaneLimpiezaSub4ViewModel.cs index b4ae52b..f294557 100644 --- a/ViewModel/PaneLimpiezaSub4ViewModel.cs +++ b/ViewModel/PaneLimpiezaSub4ViewModel.cs @@ -21,7 +21,12 @@ namespace OliviaAddInPro { public PaneLimpiezaSub4ViewModel() { - + textPercentTrafico = 80; + timeCargDesc = 40; + timeDespIniFin = 25; + timeIniJornada = 7 * 60 + 30; + timeJornadaConv = 8 * 60; + timeDescPers = 30; } @@ -32,13 +37,54 @@ namespace OliviaAddInPro get { return Resource1.String_tiempos; } } - /*private string lblCapaRestr; - public string LblCapaRestr + //en minutos + private int timeCargDesc; + public string TimeCargDesc { - get { return lblCapaRestr; } - set { LblCapaRestr = lblCapaRestr; } - }*/ - + get { return PanelGlobal.Hm_int2str(timeCargDesc); } + set { base.SetProperty(ref timeCargDesc, PanelGlobal.Hm_str2int(value), () => TimeCargDesc); } + } + + //en minutos + private int timeDespIniFin; + public int TimeDespIniFin + { + get { return timeDespIniFin; } + set { base.SetProperty(ref timeDespIniFin, value, () => TimeDespIniFin); } + } + + //en minutos desde las 00 horas + private int timeIniJornada; + public int TimeIniJornada + { + get { return timeIniJornada; } + set { base.SetProperty(ref timeIniJornada, value, () => TimeIniJornada); } + } + + //Tráfico, de 0 a 100 + private int textPercentTrafico; + public int TextPercentTrafico + { + get { return textPercentTrafico; } + set { base.SetProperty(ref textPercentTrafico, value, () => TextPercentTrafico); } + } + + //en minutos desde las 00 horas + private int timeJornadaConv; + public int TimeJornadaConv + { + get { return timeJornadaConv; } + set { base.SetProperty(ref timeJornadaConv, value, () => TimeJornadaConv); } + } + + //en minutos + private int timeDescPers; + public int TimeDescPers + { + get { return timeDescPers; } + set { base.SetProperty(ref timeDescPers, value, () => TimeDescPers); } + } + #endregion Properties } } diff --git a/ViewModel/PanelViewModelBase.cs b/ViewModel/PanelViewModelBase.cs index c329665..769df33 100644 --- a/ViewModel/PanelViewModelBase.cs +++ b/ViewModel/PanelViewModelBase.cs @@ -7,14 +7,45 @@ using System.Threading.Tasks; namespace OliviaAddInPro { - public abstract class PanelViewModelBase : PropertyChangedBase + public abstract class PanelViewModelBase : PropertyChangedBase { #region Properties public abstract string DisplayName { get; } - + #endregion Properties } + + //****************************************************** + + public static class PanelGlobal + { + public static bool IsValid(string str, int ini, int fin) + { + int i; + return int.TryParse(str, out i) && i >= ini && i <= fin; + } + /** + * Dado un tiempo en minutos devuelve las horas modulo 60 y los minutos restantes + */ + public static string Hm_int2str(double t) + { + int[] hm = { 0, 0 }; + + hm[0] = (int)(t / 60); + hm[1] = (int)(t - hm[0] * 60); + + return String.Format("%dd:%dd",hm[0], hm[1]); + } + public static int Hm_str2int(string hm) + { + int t=0; + + + return t; + } + } + }