From 734a79cf633c522080356a6756280a36e0002fb2 Mon Sep 17 00:00:00 2001 From: Elena Date: Thu, 29 Jul 2021 13:02:36 +0200 Subject: [PATCH] =?UTF-8?q?Avances=20limpieza,=20no=20se=20muestra=20bot?= =?UTF-8?q?=C3=B3n=20ejecutar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Button/ButtonConfig.cs | 2 +- Button/ButtonLimp.cs | 2 +- Button/ButtonMaq.cs | 2 +- Button/ButtonRec.cs | 2 +- Config.daml | 9 ++++-- Helper/HelperGlobal.cs | 13 +++++--- OliviaAddInPro.csproj | 8 +++++ View/DockpaneLimpieza.xaml | 2 +- View/PaneEjecutar.xaml | 31 ++++++++++++++++++ View/PaneEjecutar.xaml.cs | 30 ++++++++++++++++++ View/PaneLimpieza.xaml | 11 ++++--- View/PaneLimpiezaSub1.xaml | 36 +++++++++++---------- View/PaneLimpiezaSub1.xaml.cs | 13 ++++++-- View/PaneLimpiezaSub2.xaml.cs | 2 +- View/PaneLimpiezaSub3.xaml | 3 +- View/ProWndSelectFields.xaml.cs | 4 +-- ViewModel/PaneEjecutarViewModel.cs | 44 ++++++++++++++++++++++++++ ViewModel/PaneLimpiezaSub1ViewModel.cs | 17 ++++++++-- ViewModel/PaneLimpiezaSub3ViewModel.cs | 6 ++++ ViewModel/PaneLimpiezaViewModel.cs | 9 ++++++ ViewModel/ShowProWndSelectFields.cs | 4 +-- 21 files changed, 205 insertions(+), 45 deletions(-) create mode 100644 View/PaneEjecutar.xaml create mode 100644 View/PaneEjecutar.xaml.cs create mode 100644 ViewModel/PaneEjecutarViewModel.cs diff --git a/Button/ButtonConfig.cs b/Button/ButtonConfig.cs index 8d500ad..7916eb9 100644 --- a/Button/ButtonConfig.cs +++ b/Button/ButtonConfig.cs @@ -31,7 +31,7 @@ namespace OliviaAddInPro } else { - HelperGlobal.ponMsg(Resource1.String_existe_ejec, MessageType.Warning); + HelperGlobal.ponMsg(Resource1.String_existe_ejec, System.Windows.MessageBoxImage.Warning); } } } diff --git a/Button/ButtonLimp.cs b/Button/ButtonLimp.cs index 3875446..3d8ab2d 100644 --- a/Button/ButtonLimp.cs +++ b/Button/ButtonLimp.cs @@ -32,7 +32,7 @@ namespace OliviaAddInPro } else { - HelperGlobal.ponMsg(Resource1.String_existe_ejec, MessageType.Warning); + HelperGlobal.ponMsg(Resource1.String_existe_ejec, System.Windows.MessageBoxImage.Warning); } } } diff --git a/Button/ButtonMaq.cs b/Button/ButtonMaq.cs index bc8935b..9c7e629 100644 --- a/Button/ButtonMaq.cs +++ b/Button/ButtonMaq.cs @@ -31,7 +31,7 @@ namespace OliviaAddInPro } else { - HelperGlobal.ponMsg(Resource1.String_existe_ejec, MessageType.Warning); + HelperGlobal.ponMsg(Resource1.String_existe_ejec, System.Windows.MessageBoxImage.Warning); } } } diff --git a/Button/ButtonRec.cs b/Button/ButtonRec.cs index 7929e28..a8fe161 100644 --- a/Button/ButtonRec.cs +++ b/Button/ButtonRec.cs @@ -32,7 +32,7 @@ namespace OliviaAddInPro } else { - HelperGlobal.ponMsg(Resource1.String_existe_ejec, MessageType.Warning); + HelperGlobal.ponMsg(Resource1.String_existe_ejec, System.Windows.MessageBoxImage.Warning); } } } diff --git a/Config.daml b/Config.daml index d0c0405..74e317f 100644 --- a/Config.daml +++ b/Config.daml @@ -24,7 +24,7 @@ + + @@ -53,7 +56,7 @@ - + \ No newline at end of file diff --git a/Helper/HelperGlobal.cs b/Helper/HelperGlobal.cs index 1af1daf..c2fe388 100644 --- a/Helper/HelperGlobal.cs +++ b/Helper/HelperGlobal.cs @@ -5,17 +5,20 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using ArcGIS.Desktop.Internal.Framework.Controls; +using ArcGIS.Desktop.Framework.Dialogs; +using System.Windows; namespace OliviaAddInPro.Helper { public static class HelperGlobal { - public static ErrorMessageDialog msg; - public static void ponMsg(String mensaje, MessageType tipo, String titulo = "OLIVIA") - { - msg = new ErrorMessageDialog(titulo, mensaje, tipo); - msg.ShowDialog(); + public static void ponMsg(String mensaje, System.Windows.MessageBoxImage icon = MessageBoxImage.Information, + String titulo = "OLIVIA", + MessageBoxButton button= MessageBoxButton.OK) + { + //MessageBoxResult Show(string messageText, string caption, MessageBoxButton button, MessageBoxImage icon); + ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show(mensaje, titulo, button, icon); } public static string RevisaText(string text) { diff --git a/OliviaAddInPro.csproj b/OliviaAddInPro.csproj index 318f3b6..92ade20 100644 --- a/OliviaAddInPro.csproj +++ b/OliviaAddInPro.csproj @@ -138,11 +138,15 @@ + + + PaneEjecutar.xaml + PaneLimpiezaSub4.xaml @@ -200,6 +204,10 @@ + + MSBuild:Compile + Designer + MSBuild:Compile Designer diff --git a/View/DockpaneLimpieza.xaml b/View/DockpaneLimpieza.xaml index 4227596..6a707c1 100644 --- a/View/DockpaneLimpieza.xaml +++ b/View/DockpaneLimpieza.xaml @@ -22,7 +22,7 @@ - + diff --git a/View/PaneEjecutar.xaml b/View/PaneEjecutar.xaml new file mode 100644 index 0000000..d50e971 --- /dev/null +++ b/View/PaneEjecutar.xaml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + - diff --git a/View/PaneLimpiezaSub1.xaml.cs b/View/PaneLimpiezaSub1.xaml.cs index aa9f780..05e42da 100644 --- a/View/PaneLimpiezaSub1.xaml.cs +++ b/View/PaneLimpiezaSub1.xaml.cs @@ -47,10 +47,15 @@ namespace OliviaAddInPro if (!string.IsNullOrEmpty(capa)) { label_capalimp.Content = System.IO.Path.GetFileNameWithoutExtension(capa); - ((PaneLimpiezaSub1ViewModel)DataContext).AbiertaCapa(capa); + if (DataContext is PaneLimpiezaSub1ViewModel mod) + mod.AbiertaCapa(capa); } else + { label_capalimp.Content = Resource1.String_selec_capa; + if (DataContext is PaneLimpiezaSub1ViewModel mod) + mod.CapaAbierta = false; + } } private void comboBox_tto_SelectionChanged(object sender, SelectionChangedEventArgs e) @@ -58,7 +63,8 @@ namespace OliviaAddInPro int i = -1; if (sender is ComboBox combo) i = combo.SelectedIndex; - ((PaneLimpiezaSub1ViewModel)DataContext).ComboTtoSel(i); + if(DataContext is PaneLimpiezaSub1ViewModel mod) + mod.ComboTtoSel(i); } @@ -67,7 +73,8 @@ namespace OliviaAddInPro int i = -1; if (sender is ComboBox combo) i = combo.SelectedIndex; - ((PaneLimpiezaSub1ViewModel)DataContext).ComboAmbSel(i); + if (DataContext is PaneLimpiezaSub1ViewModel mod) + mod.ComboAmbSel(i); } } } diff --git a/View/PaneLimpiezaSub2.xaml.cs b/View/PaneLimpiezaSub2.xaml.cs index 5ea1f3d..ee146d3 100644 --- a/View/PaneLimpiezaSub2.xaml.cs +++ b/View/PaneLimpiezaSub2.xaml.cs @@ -57,7 +57,7 @@ namespace OliviaAddInPro { texto = Resource1.String_selec_capa; if (HelperGdb.OutStr.Length > 0) - HelperGlobal.ponMsg(HelperGdb.OutStr, MessageType.Error); + HelperGlobal.ponMsg(HelperGdb.OutStr, System.Windows.MessageBoxImage.Error); } _texto = texto; diff --git a/View/PaneLimpiezaSub3.xaml b/View/PaneLimpiezaSub3.xaml index dd57f0b..bbc5091 100644 --- a/View/PaneLimpiezaSub3.xaml +++ b/View/PaneLimpiezaSub3.xaml @@ -38,6 +38,7 @@ - + + diff --git a/View/ProWndSelectFields.xaml.cs b/View/ProWndSelectFields.xaml.cs index 9f5b99a..3237bf3 100644 --- a/View/ProWndSelectFields.xaml.cs +++ b/View/ProWndSelectFields.xaml.cs @@ -51,9 +51,9 @@ namespace OliviaAddInPro.View if (elems.Count == 0) { if (HelperGdb.OutStr.Length > 0) - HelperGlobal.ponMsg(HelperGdb.OutStr, MessageType.Error); + HelperGlobal.ponMsg(HelperGdb.OutStr, System.Windows.MessageBoxImage.Error); else - HelperGlobal.ponMsg(Resource1.String_error_elems_tabla, MessageType.Warning); + HelperGlobal.ponMsg(Resource1.String_error_elems_tabla, System.Windows.MessageBoxImage.Warning); } listBoxAttributes.ItemsSource = elems; } diff --git a/ViewModel/PaneEjecutarViewModel.cs b/ViewModel/PaneEjecutarViewModel.cs new file mode 100644 index 0000000..f00d15a --- /dev/null +++ b/ViewModel/PaneEjecutarViewModel.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using ArcGIS.Core.CIM; +using ArcGIS.Core.Data; +using ArcGIS.Core.Geometry; +using ArcGIS.Desktop.Catalog; +using ArcGIS.Desktop.Core; +using ArcGIS.Desktop.Editing; +using ArcGIS.Desktop.Extensions; +using ArcGIS.Desktop.Framework; +using ArcGIS.Desktop.Framework.Contracts; +using ArcGIS.Desktop.Framework.Dialogs; +using ArcGIS.Desktop.Framework.Threading.Tasks; +using ArcGIS.Desktop.Mapping; + +namespace OliviaAddInPro +{ + internal class PaneEjecutarViewModel : PanelViewModelBase + { + public PaneEjecutarViewModel() + { + + } + + + #region Properties + + public override string DisplayName + { + get { return "Ejecutar"; } + } + + private int numPtosCtrl; + public int NumPtosCtrl + { + get { return numPtosCtrl; } + set { base.SetProperty(ref numPtosCtrl, value, () => NumPtosCtrl); } + } + + #endregion Properties + } +} diff --git a/ViewModel/PaneLimpiezaSub1ViewModel.cs b/ViewModel/PaneLimpiezaSub1ViewModel.cs index 240d042..fdaf9f4 100644 --- a/ViewModel/PaneLimpiezaSub1ViewModel.cs +++ b/ViewModel/PaneLimpiezaSub1ViewModel.cs @@ -31,6 +31,7 @@ namespace OliviaAddInPro private int selOpAmb = -1; private ObservableCollection> ambitos = new ObservableCollection>(); private bool[] ambitosSel; + private bool capaAbierta = false; /** @@ -159,6 +160,15 @@ namespace OliviaAddInPro base.NotifyPropertyChanged("OpsAmbs"); } } + public bool CapaAbierta + { + get { return capaAbierta; } + set + { + capaAbierta = value; + base.NotifyPropertyChanged("CapaAbierta"); + } + } #endregion Properties public PaneLimpiezaSub1ViewModel(Limpieza _limp) @@ -177,11 +187,12 @@ namespace OliviaAddInPro public void AbiertaCapa(string capa) { limp.CapaElems = capa; + CapaAbierta = false; //comprueba los campos de limpieza if (!limp.CompruebaCamposLimp()) { string ss = limp.ErrStr; - HelperGlobal.ponMsg(ss, ArcGIS.Desktop.Internal.Framework.Controls.MessageType.Warning); + HelperGlobal.ponMsg(ss, System.Windows.MessageBoxImage.Warning); return; } @@ -198,13 +209,13 @@ namespace OliviaAddInPro if (!hay_alguno) { HelperGlobal.ponMsg(Resource1.String_error_elems_tabla, - ArcGIS.Desktop.Internal.Framework.Controls.MessageType.Warning); + System.Windows.MessageBoxImage.Warning); return; } //hay elementos en la gdb OpsAmbs.Clear(); Ambitos.Clear(); - + CapaAbierta = true; } /** diff --git a/ViewModel/PaneLimpiezaSub3ViewModel.cs b/ViewModel/PaneLimpiezaSub3ViewModel.cs index 8adf319..05803c9 100644 --- a/ViewModel/PaneLimpiezaSub3ViewModel.cs +++ b/ViewModel/PaneLimpiezaSub3ViewModel.cs @@ -60,6 +60,12 @@ namespace OliviaAddInPro get { return checkAjustSect; } set { base.SetProperty(ref checkAjustSect, value, () => CheckAjustSect); } } + private bool checkIgnoAis; + public bool CheckIgnoAis + { + get { return checkIgnoAis; } + set { base.SetProperty(ref checkIgnoAis, value, () => CheckIgnoAis); } + } #endregion Properties } diff --git a/ViewModel/PaneLimpiezaViewModel.cs b/ViewModel/PaneLimpiezaViewModel.cs index 4fb5cbc..be881ce 100644 --- a/ViewModel/PaneLimpiezaViewModel.cs +++ b/ViewModel/PaneLimpiezaViewModel.cs @@ -15,12 +15,14 @@ namespace OliviaAddInPro private PaneLimpiezaSub2ViewModel _subPanel2ViewModel; private PaneLimpiezaSub3ViewModel _subPanel3ViewModel; private PaneLimpiezaSub4ViewModel _subPanel4ViewModel; + private PaneEjecutarViewModel _subPanelEjecutar; public PaneLimpiezaViewModel() { _subPanel1ViewModel = new PaneLimpiezaSub1ViewModel(OliviaGlob.Limp); _subPanel2ViewModel = new PaneLimpiezaSub2ViewModel(); _subPanel3ViewModel = new PaneLimpiezaSub3ViewModel(); _subPanel4ViewModel = new PaneLimpiezaSub4ViewModel(); + _subPanelEjecutar = new PaneEjecutarViewModel(); OptionsMenu = new ObservableCollection { @@ -49,6 +51,13 @@ namespace OliviaAddInPro set { SetProperty(ref _currentSubPanelPage, value, () => CurrentSubPanelPage); } } + private PanelViewModelBase _subPanelEjec; + public PanelViewModelBase SubPanelEjec + { + get { return _subPanelEjec; } + set { SetProperty(ref _subPanelEjec, value, () => SubPanelEjec); } + } + private OptionsMenuItem _selectionOption; public OptionsMenuItem SelectedOption { diff --git a/ViewModel/ShowProWndSelectFields.cs b/ViewModel/ShowProWndSelectFields.cs index 0ecc20b..a9ea72a 100644 --- a/ViewModel/ShowProWndSelectFields.cs +++ b/ViewModel/ShowProWndSelectFields.cs @@ -42,9 +42,9 @@ namespace OliviaAddInPro.View if (fields.Count == 0) { if (HelperGdb.OutStr.Length > 0) - HelperGlobal.ponMsg(HelperGdb.OutStr, MessageType.Error); + HelperGlobal.ponMsg(HelperGdb.OutStr, System.Windows.MessageBoxImage.Error); else - HelperGlobal.ponMsg(Resource1.String_error_elems_tabla, MessageType.Warning); + HelperGlobal.ponMsg(Resource1.String_error_elems_tabla, System.Windows.MessageBoxImage.Warning); } else {