Version_1_1_0_12-entrega-valoriza-24-3-2019
Elena 2019-02-10 19:00:56 +01:00
parent aa7667c072
commit c5432d6e5a
188 changed files with 22764 additions and 0 deletions

3
.gitignore vendored
View File

@ -3,3 +3,6 @@
################################################################################
/OliviaAddIn/bin
/OliviaDef/bin
/OliviaDef/obj/x86
/.vs/OliviaAddIn/v15

48
OliviaAddIn.sln Normal file
View File

@ -0,0 +1,48 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OliviaAddIn", "OliviaAddIn\OliviaAddIn.csproj", "{DB9A28BA-37A9-4D46-8CFF-06A444FCDEF7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OliviaDef", "OliviaDef\OliviaDef.csproj", "{B395D0F3-766D-46C5-BDE9-FBDEE1582259}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|Win32 = Debug|Win32
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
Release|Win32 = Release|Win32
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DB9A28BA-37A9-4D46-8CFF-06A444FCDEF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DB9A28BA-37A9-4D46-8CFF-06A444FCDEF7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DB9A28BA-37A9-4D46-8CFF-06A444FCDEF7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{DB9A28BA-37A9-4D46-8CFF-06A444FCDEF7}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{DB9A28BA-37A9-4D46-8CFF-06A444FCDEF7}.Debug|Win32.ActiveCfg = Debug|Any CPU
{DB9A28BA-37A9-4D46-8CFF-06A444FCDEF7}.Debug|x86.ActiveCfg = Debug|Any CPU
{DB9A28BA-37A9-4D46-8CFF-06A444FCDEF7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DB9A28BA-37A9-4D46-8CFF-06A444FCDEF7}.Release|Any CPU.Build.0 = Release|Any CPU
{DB9A28BA-37A9-4D46-8CFF-06A444FCDEF7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{DB9A28BA-37A9-4D46-8CFF-06A444FCDEF7}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{DB9A28BA-37A9-4D46-8CFF-06A444FCDEF7}.Release|Win32.ActiveCfg = Release|Any CPU
{DB9A28BA-37A9-4D46-8CFF-06A444FCDEF7}.Release|x86.ActiveCfg = Release|Any CPU
{B395D0F3-766D-46C5-BDE9-FBDEE1582259}.Debug|Any CPU.ActiveCfg = Debug|x86
{B395D0F3-766D-46C5-BDE9-FBDEE1582259}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{B395D0F3-766D-46C5-BDE9-FBDEE1582259}.Debug|Mixed Platforms.Build.0 = Debug|x86
{B395D0F3-766D-46C5-BDE9-FBDEE1582259}.Debug|Win32.ActiveCfg = Debug|x86
{B395D0F3-766D-46C5-BDE9-FBDEE1582259}.Debug|x86.ActiveCfg = Debug|x86
{B395D0F3-766D-46C5-BDE9-FBDEE1582259}.Debug|x86.Build.0 = Debug|x86
{B395D0F3-766D-46C5-BDE9-FBDEE1582259}.Release|Any CPU.ActiveCfg = Release|x86
{B395D0F3-766D-46C5-BDE9-FBDEE1582259}.Release|Mixed Platforms.ActiveCfg = Release|x86
{B395D0F3-766D-46C5-BDE9-FBDEE1582259}.Release|Mixed Platforms.Build.0 = Release|x86
{B395D0F3-766D-46C5-BDE9-FBDEE1582259}.Release|Win32.ActiveCfg = Release|x86
{B395D0F3-766D-46C5-BDE9-FBDEE1582259}.Release|x86.ActiveCfg = Release|x86
{B395D0F3-766D-46C5-BDE9-FBDEE1582259}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

BIN
OliviaAddIn.suo Normal file

Binary file not shown.

135
OliviaAddIn/ButtonInicio.cs Normal file
View File

@ -0,0 +1,135 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Windows.Forms;
namespace OliviaAddIn
{
/**
* @file ButtonInicio.cs
* Clase del botón del AddIn OLIVIA para ArcMap.
* Contiene el manejo de sus eventos como el Click o la actualización de su estado.
*/
/**
* Clase del botón del AddIn OLIVIA para ArcMap.
* Contiene el manejo de sus eventos como el Click o la actualización de su estado.
*/
public class ButtonInicio : ESRI.ArcGIS.Desktop.AddIns.Button
{
//*************************************************************************************
//Variables
//*************************************************************************************
//Métodos
public ButtonInicio()
{
}
protected override void OnClick()
{
try
{
bool ini_bien = true;
try
{
string err_str = "";
if (!OliviaGlob.lee_ini_gen(out err_str))
{
ini_bien = false;
MessageBox.Show(err_str, "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
ini_bien = true;
}
catch (Exception)
{
MessageBox.Show("Error al iniciar Olivia. No se puede acceder al archivo de configuración: cfg.ini. Comprobar accesibilidad a la carpeta.", "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
if (!ini_bien)
return;
if (!coge_ip())
return; //FALTA loguear error...
if (!comprueba_dlls())
return;
////////////////////////////
Application.EnableVisualStyles();
ArcMap.Application.CurrentTool = null;
//abre la ventana de configuración inicial
OliviaGlob.inidlg = new InicioDlg();
OliviaGlob.ya_open_app = true;
OliviaGlob.inidlg.Show();
}
catch (Exception e)
{
MessageBox.Show(e.Message, "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
protected override void OnUpdate()
{
Enabled = !OliviaGlob.ya_open_app;
}
/**
* Coge la ip local para la comunicación con geofoto
*/
protected bool coge_ip()
{
try
{
string[] ips = OliviaGlob.dame_local_ips();
if (ips != null && ips.Length > 0)
OliviaGlob.ip = ips[0];
else
OliviaGlob.ip = "127.0.0.1";
return true;
}
catch (Exception)
{
MessageBox.Show("Error al coger la IP.", "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
}
/**
* La primera vez copia las dlls necesarias en el directorio del arcmap
*/
protected bool comprueba_dlls()
{
string path_dll_dest = null, dll = null;
try
{
//comprueba igt_base.dll
dll = "igt_base.dll";
path_dll_dest = Path.Combine(Application.StartupPath, dll);
if (!File.Exists(path_dll_dest))
{
MessageBox.Show("No se encuentran las librerías necesarias, compruebe la instalación", "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
return true;
}
catch (Exception)
{
MessageBox.Show("Error al comprobar las dll " + dll + "ubicada en:" + path_dll_dest, "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
}
}
}

View File

@ -0,0 +1 @@

267
OliviaAddIn/Comun.cs Normal file
View File

@ -0,0 +1,267 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.DataSourcesGDB;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.Catalog;
namespace OliviaAddIn
{
/**
* Elementos comunes a Limpieza y Recogida
*/
public class Comun
{
//*************************************************************************************
//Variables
/**
* Texto cuando no se ha seleccionado instalación
*/
public string text_selec_instal = "Instalación de salida/llegada";
/**
* Coordenadas de la instalación de partida, si las huibiera, 0 si no
*/
public double[] coords_instala = new double[2];
/**
* Texto cuando no se ha seleccionado capa de restricciones
*/
public string text_selec_rest = "Capa de restric. circ.";
/**
* Geometría que componen las restricciones de acceso, null si nunguna
*/
public IGeometry geom_rest_acces = null;
/**
* Texto cuando no se ha seleccionado capa de zonas
*/
public string text_selec_zonas = "Capa de zonas";
/**
* Geometría que componen las zonas seleccionadas, null si nunguna
*/
public IGeometry geom_zonas = null;
/**
* Texto cuando no se ha seleccionado capa de limpieza otra
*/
public string text_capa_limp = "Cambiar capa de limpieza...";
/**
* String de errores de ejecución
*/
public string err_st = null;
/**
* Tiempo de trabajo al día por convenio, en minutos
*/
public double t_conv = LimpiezaDef.Parametros.t_conv;
/**
* Tiempo de descanso del personal, en minutos
*/
public double t_descan = LimpiezaDef.Parametros.t_descanso;
/**
* Tiempo de carga y descarga, en minutos
*/
public double t_descarg = LimpiezaDef.Parametros.t_cardesc;
/**
* Tiempo de desplazamiento inicio/fin a las instalaciones, en minutos
*/
public double t_despl_insta = LimpiezaDef.Parametros.t_desp;
/**
* hora de inicio de la jornada de trabajo, en minutos
*/
public double h_ini = LimpiezaDef.Parametros.h_inicio;
/**
* Porcentaje de tráfico que se estima, ya que si no los vehículos irían siempre a la velocida máxima permitida por la vía
*/
public double trafico = 80;
/**
* Número de puntos de control
*/
public int n_ptsctrl = 3;
/**
* Número de sectores por defecto
*/
public int n_secdef = 3;
/**
* Parámentro que indica si se tendrán en cuenta en el estudio los elementos aislados. Si 1 se descartan aislados. Si 0 se tienen en cuenta en el cálculo.
*/
public int aislados = -1;
/**
* String que almacena qué zonas se han seleccionado
*/
public string text_zon = "";
/**
* String que almacena qué restricciones se han seleccionado
*/
public string text_restr = "";
/**
* Path de la clase de los ámbitos
*/
//*************************************************************************************
//Funciones
/**
* Para la selección de puntos de instalación
* Abre el dialogo de selección de capa y el form para seleccionar campo a leer y valor del campo
*/
public bool selec_instal(string title, int wnd_handle, out string text_sal, out double x, out double y)
{
ListCamposVal list;
IFeature f = null;
IFeatureClass fc = null;
IGeometry geom = null;
list = new ListCamposVal(title, wnd_handle, esriGeometryType.esriGeometryPoint);
text_sal = "";
x = y = 0;
try
{
IPoint instalacion;
string campo, clase_path, st;
int elem;
int[] ids;
clase_path = null;
campo = st="";
ids = null;
elem = -1;
clase_path = list.selec_capa();
if (clase_path != null)
{
elem = list.selec_campo(out campo);
if (elem > -1 && campo != null)
{
elem = list.selec_valor_campo(campo, out st);
if (elem > -1)
{
ids = FunGDB.dame_ids_consulta(clase_path, ""); //consulta todos
if (ids != null)
{
fc=FunGDB.abre_ftclass(clase_path);
if (fc != null)
{
f = fc.GetFeature(ids[elem]);
geom = f.Shape;
geom = FunGDB.reproyecta(geom, OliviaGlob.coorsys);//reproyecta por si hace falta
instalacion = (IPoint)geom;
x = instalacion.X;
y = instalacion.Y;
text_sal = st;
}
}
}
}
}
}
catch (Exception)
{
x = 0;
}
FunGDB.libera(fc);
FunGDB.libera(geom);
FunGDB.libera(f);
if (x==0) //algo ha ido mal
{
MessageBox.Show("Error al seleccionar capa de instalaciones. " + list.err_st, "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
return true;
}
/**
* Para la selección de capas de polígonos
* Abre el dialogo de selección de capa y el form para seleccionar campo a leer y valor del campo
* Permite multiselección
* Tiene que mostrar valores únicos, no repetidos
* Devuelve la geom resultante
* En text_sal van concatenados los valores que se han seleccionado unidos por '_'
*/
public bool selec_polig(string title, int wnd_handle, out string text_sal, out IGeometry geom_sal)
{
ListCamposVal list;
IFeature f = null;
IFeatureClass fc = null;
IGeometry geom = null;
list = new ListCamposVal(title, wnd_handle, esriGeometryType.esriGeometryPolygon);
text_sal = "";
geom_sal = null;
try
{
string campo, clase_path, consulta;
string[] val_st;
int nval;
int[] ids, val_ids;
int i,j;
bool is_str = true;
clase_path=null;
campo=consulta="";
val_st=null;
val_ids=ids=null;
nval=-1;
clase_path = list.selec_capa();
if (clase_path != null)
{
nval = list.selec_campo(out campo);
if (nval > -1 && campo != null)
{
//mira a ver si el campo es str
is_str = FunGDB.is_str_field(clase_path,campo);
nval = list.selec_valores_campo(campo,out val_ids, out val_st);//valores únicos
if (nval > 0)
{
//se embucla para unir las geoms
for (i = 0; i < nval; i++)
{
if(is_str)
consulta = campo + " = '" + val_st[i] + "'";
else
consulta = campo + " = " + val_st[i];
ids = FunGDB.dame_ids_consulta(clase_path, consulta);
fc = FunGDB.abre_ftclass(clase_path);
if ((ids != null) && (fc != null))
{
for(j=0;j<ids.Length;j++)
{
f = fc.GetFeature(ids[j]);
geom = f.Shape;
geom_sal = FunGDB.une_geoms(geom_sal, geom);
FunGDB.libera(f);
}
geom_sal = FunGDB.reproyecta(geom_sal, OliviaGlob.coorsys);//reproyecta por si hace falta
}
FunGDB.libera(fc);
//Actualiza el texto de salida
text_sal = text_sal + val_st[i].Replace(" ", string.Empty);
/*if(i<(nval-1))//si es el último no le pone '_'
text_sal = text_sal + "_";*/
}
}
}
}
}
catch (Exception)
{
geom_sal = null;
}
FunGDB.libera(fc);
FunGDB.libera(f);
if (geom_sal==null)
{
MessageBox.Show("Error al seleccionar capa de polígonos. " + list.err_st, "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
return true;
}
}
}

BIN
OliviaAddIn/Config.Designer.cs generated Normal file

Binary file not shown.

View File

@ -0,0 +1,22 @@
<ESRI.Configuration xmlns="http://schemas.esri.com/Desktop/AddIns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Name>OLIVIA AddIn</Name>
<AddInID>{0718b3b3-5422-4d80-97ad-f72b18a3e476}</AddInID>
<Description>Add-In de ArcMap para la herramienta de optimización de la limpieza viaria, OLIVIA.</Description>
<Version>1.1.0.8</Version>
<Image>Images\OliviaAddIn.png</Image>
<Author>Intergeo Tecnología</Author>
<Company>Intergeo Tecnología</Company>
<Date>11/12/2018</Date>
<Targets>
<Target name="Desktop" version="10.2" />
</Targets>
<AddIn language="CLR4.0" library="OliviaAddIn.dll" namespace="OliviaAddIn">
<ArcMap>
<Commands>
<Button id="Intergeo_Tecnología_OliviaAddIn_ButtonInicio" class="ButtonInicio" message="Add-In para ArcMap de la herramienta de optimización de la limpieza viaria, OLIVIA." caption="OLIVIA" tip="OLIVIA - Optimización de la Limpieza Viaria" category="OLVIA Add-In Controls" image="Images\ButtonInicio.png">
<Help heading="OLIVIA AddIn - Optimización de la Limpieza Viaria">Add-In para ArcMap desarrollado por Intergeo Tecnología para la herramienta de optimización de la limpieza viaria, OLIVIA.</Help>
</Button>
</Commands>
</ArcMap>
</AddIn>
</ESRI.Configuration>

243
OliviaAddIn/DatosCsv.Designer.cs generated Normal file
View File

@ -0,0 +1,243 @@
namespace OliviaAddIn
{
partial class DatosCsv
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DatosCsv));
this.button_abrir = new System.Windows.Forms.Button();
this.dateTimePicker_fin = new System.Windows.Forms.DateTimePicker();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.comboBox_media = new System.Windows.Forms.ComboBox();
this.label2 = new System.Windows.Forms.Label();
this.textBox_id = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.dateTimePicker_ini = new System.Windows.Forms.DateTimePicker();
this.btn_acept = new System.Windows.Forms.Button();
this.button_reset = new System.Windows.Forms.Button();
this.label5 = new System.Windows.Forms.Label();
this.textBox_llen = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.textBox_fecha = new System.Windows.Forms.TextBox();
this.lbl_csv = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// button_abrir
//
this.button_abrir.Location = new System.Drawing.Point(29, 22);
this.button_abrir.Name = "button_abrir";
this.button_abrir.Size = new System.Drawing.Size(75, 23);
this.button_abrir.TabIndex = 1;
this.button_abrir.Text = "Abrir";
this.button_abrir.UseVisualStyleBackColor = true;
this.button_abrir.Click += new System.EventHandler(this.button_abrir_Click);
//
// dateTimePicker_fin
//
this.dateTimePicker_fin.CustomFormat = "dd/MM/yyyy - H:mm";
this.dateTimePicker_fin.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dateTimePicker_fin.Location = new System.Drawing.Point(66, 245);
this.dateTimePicker_fin.Name = "dateTimePicker_fin";
this.dateTimePicker_fin.Size = new System.Drawing.Size(156, 20);
this.dateTimePicker_fin.TabIndex = 20;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(29, 228);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(65, 13);
this.label4.TabIndex = 19;
this.label4.Text = "Fecha Final:";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(29, 183);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(68, 13);
this.label3.TabIndex = 18;
this.label3.Text = "Fecha Inicio:";
//
// comboBox_media
//
this.comboBox_media.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBox_media.Location = new System.Drawing.Point(122, 155);
this.comboBox_media.Name = "comboBox_media";
this.comboBox_media.Size = new System.Drawing.Size(100, 21);
this.comboBox_media.TabIndex = 17;
this.comboBox_media.SelectedIndexChanged += new System.EventHandler(this.comboBox_media_SelectedIndexChanged);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(29, 158);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(36, 13);
this.label2.TabIndex = 16;
this.label2.Text = "Media";
//
// textBox_id
//
this.textBox_id.Location = new System.Drawing.Point(122, 64);
this.textBox_id.Name = "textBox_id";
this.textBox_id.Size = new System.Drawing.Size(100, 20);
this.textBox_id.TabIndex = 15;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(26, 66);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(54, 13);
this.label1.TabIndex = 14;
this.label1.Text = "Campo ID";
//
// dateTimePicker_ini
//
this.dateTimePicker_ini.CustomFormat = "dd/MM/yyyy - H:mm";
this.dateTimePicker_ini.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dateTimePicker_ini.Location = new System.Drawing.Point(66, 201);
this.dateTimePicker_ini.Name = "dateTimePicker_ini";
this.dateTimePicker_ini.Size = new System.Drawing.Size(156, 20);
this.dateTimePicker_ini.TabIndex = 13;
//
// btn_acept
//
this.btn_acept.Location = new System.Drawing.Point(115, 271);
this.btn_acept.Name = "btn_acept";
this.btn_acept.Size = new System.Drawing.Size(75, 23);
this.btn_acept.TabIndex = 12;
this.btn_acept.Text = "Aceptar";
this.btn_acept.UseVisualStyleBackColor = true;
this.btn_acept.Click += new System.EventHandler(this.btn_acept_Click);
//
// button_reset
//
this.button_reset.Location = new System.Drawing.Point(34, 271);
this.button_reset.Name = "button_reset";
this.button_reset.Size = new System.Drawing.Size(75, 23);
this.button_reset.TabIndex = 11;
this.button_reset.Text = "Reset";
this.button_reset.UseVisualStyleBackColor = true;
this.button_reset.Click += new System.EventHandler(this.button_reset_Click);
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(26, 93);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(81, 13);
this.label5.TabIndex = 21;
this.label5.Text = "Campo Llenado";
//
// textBox_llen
//
this.textBox_llen.Location = new System.Drawing.Point(122, 90);
this.textBox_llen.Name = "textBox_llen";
this.textBox_llen.Size = new System.Drawing.Size(100, 20);
this.textBox_llen.TabIndex = 22;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(29, 126);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(73, 13);
this.label6.TabIndex = 23;
this.label6.Text = "Campo Fecha";
//
// textBox_fecha
//
this.textBox_fecha.Location = new System.Drawing.Point(122, 123);
this.textBox_fecha.Name = "textBox_fecha";
this.textBox_fecha.Size = new System.Drawing.Size(100, 20);
this.textBox_fecha.TabIndex = 24;
//
// lbl_csv
//
this.lbl_csv.AutoSize = true;
this.lbl_csv.Location = new System.Drawing.Point(119, 27);
this.lbl_csv.Name = "lbl_csv";
this.lbl_csv.Size = new System.Drawing.Size(87, 13);
this.lbl_csv.TabIndex = 25;
this.lbl_csv.Text = "Seleccionar CSV";
//
// DatosCsv
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 313);
this.Controls.Add(this.lbl_csv);
this.Controls.Add(this.textBox_fecha);
this.Controls.Add(this.label6);
this.Controls.Add(this.textBox_llen);
this.Controls.Add(this.label5);
this.Controls.Add(this.dateTimePicker_fin);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.comboBox_media);
this.Controls.Add(this.label2);
this.Controls.Add(this.textBox_id);
this.Controls.Add(this.label1);
this.Controls.Add(this.dateTimePicker_ini);
this.Controls.Add(this.btn_acept);
this.Controls.Add(this.button_reset);
this.Controls.Add(this.button_abrir);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "DatosCsv";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "DatosCsv";
this.TopMost = true;
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.DatosCsv_FormClosed);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button button_abrir;
private System.Windows.Forms.DateTimePicker dateTimePicker_fin;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.ComboBox comboBox_media;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox textBox_id;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.DateTimePicker dateTimePicker_ini;
private System.Windows.Forms.Button btn_acept;
private System.Windows.Forms.Button button_reset;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox textBox_llen;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox textBox_fecha;
private System.Windows.Forms.Label lbl_csv;
}
}

351
OliviaAddIn/DatosCsv.cs Normal file
View File

@ -0,0 +1,351 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Excel = Microsoft.Office.Interop.Excel;
using System.IO;
namespace OliviaAddIn
{
public partial class DatosCsv : Form
{
Recogida reco = null;
string id, lleno, csv, fecha, aux, auxi;
string[] combo = new string[] { "No", "Si" };
DateTime f_ini, f_fin;
public static DateTime fe;
int y, mo, d, h, mi, ind;
public bool acept = false;
////////////////////////////////////////////////////
public DatosCsv(Recogida reco)
{
try
{
InitializeComponent();
reinicia();
comboBox_media.Items.AddRange(combo);
dateTimePicker_fin.Enabled = false;
this.reco = reco;
textBox_id.Enabled = false;
textBox_fecha.Enabled = false;
textBox_llen.Enabled = false;
comboBox_media.Enabled = false;
dateTimePicker_ini.Enabled = false;
dateTimePicker_fin.Enabled = false;
button_reset.Enabled = false;
btn_acept.Enabled = false;
}
catch (Exception)
{
MessageBox.Show("Error al iniciar la ventana de campos de CSV", "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
private void reinicia()
{
id = RecogidaDef.campos.cons_id_csv;
lleno = RecogidaDef.campos.cons_llen_csv;
fecha = RecogidaDef.campos.cons_fecha_csv;
ind = RecogidaDef.campos.cons_fechai_csv.IndexOf("/");
auxi = RecogidaDef.campos.cons_fechai_csv.Substring(0, ind);
d = Convert.ToInt32(auxi);
aux = RecogidaDef.campos.cons_fechai_csv.Substring(ind + 1);
ind = aux.IndexOf("/");
auxi = aux.Substring(0, ind);
mo = Convert.ToInt32(auxi);
aux = aux.Substring(ind + 1);
ind = aux.IndexOf(" ");
auxi = aux.Substring(0, ind);
y = Convert.ToInt32(auxi);
aux = aux.Substring(ind + 1);
ind = aux.IndexOf(":");
auxi = aux.Substring(0, ind);
h = Convert.ToInt32(auxi);
aux = aux.Substring(ind + 1);
mi = Convert.ToInt32(aux);
RecogidaDef.campos.fechai_csv = new DateTime(y, mo, d, h, mi, 0);
f_ini = RecogidaDef.campos.fechai_csv;
ind = RecogidaDef.campos.cons_fechaf_csv.IndexOf("/");
auxi = RecogidaDef.campos.cons_fechaf_csv.Substring(0, ind);
d = Convert.ToInt32(auxi);
aux = RecogidaDef.campos.cons_fechaf_csv.Substring(ind + 1);
ind = aux.IndexOf("/");
auxi = aux.Substring(0, ind);
mo = Convert.ToInt32(auxi);
aux = aux.Substring(ind + 1);
ind = aux.IndexOf(" ");
auxi = aux.Substring(0, ind);
y = Convert.ToInt32(auxi);
aux = aux.Substring(ind + 1);
ind = aux.IndexOf(":");
auxi = aux.Substring(0, ind);
h = Convert.ToInt32(auxi);
aux = aux.Substring(ind + 1);
mi = Convert.ToInt32(aux);
RecogidaDef.campos.fechaf_csv = new DateTime(y, mo, d, h, mi, 0);
f_fin = RecogidaDef.campos.fechaf_csv;
//se rellenan los datos en el dialogo
textBox_id.Text = id;
textBox_fecha.Text = fecha;
textBox_llen.Text = lleno;
dateTimePicker_ini.Value = f_ini;
dateTimePicker_ini.MinDate = new DateTime(0001, 01, 01, 00, 00, 00);
dateTimePicker_ini.MaxDate = new DateTime(2050, 01, 01, 00, 00, 00);
dateTimePicker_fin.Value = f_fin;
dateTimePicker_fin.MinDate = new DateTime(0001, 01, 01, 00, 00, 00);
dateTimePicker_fin.MaxDate = new DateTime(2050, 01, 01, 00, 00, 00);
}
private void button_abrir_Click(object sender, EventArgs e)
{
try
{
System.Windows.Forms.OpenFileDialog openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
openFileDialog1.Filter = "CSV(*.csv)|*.csv";
openFileDialog1.Title = "Abrir tabla de datos";
// Show the Dialog.
if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
csv = openFileDialog1.FileName;
textBox_id.Enabled = true;
textBox_fecha.Enabled = true;
textBox_llen.Enabled = true;
comboBox_media.Enabled = true;
dateTimePicker_ini.Enabled = true;
button_reset.Enabled = true;
btn_acept.Enabled = true;
lbl_csv.Text = System.IO.Path.GetFileName(openFileDialog1.FileName);
//dateTimePicker_fin.Enabled = true;
}
else
{
textBox_id.Enabled = false;
textBox_fecha.Enabled = false;
textBox_llen.Enabled = false;
comboBox_media.Enabled = false;
dateTimePicker_ini.Enabled = false;
dateTimePicker_fin.Enabled = false;
button_reset.Enabled = false;
btn_acept.Enabled = false;
lbl_csv.Text = "Seleccionar CSV";
}
}
catch (Exception)
{
MessageBox.Show("Error al seleccionar el CSV", "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
/*
* Se validan los campos modificados y se guarda en memoria los nombres de los nuevos campos.
* También se guardará en el archivo .INI una vez se vaya a ejecutar el proceso.
*/
private void btn_acept_Click(object sender, EventArgs e)
{
List<string> title = new List<string>();
List<string> time = new List<string>();
List<string> lectura = new List<string>();
List<string> num = new List<string>();
string aux;
int veces = 0, nveces = 0, ind, dia, mon, year, hor, min, col_id = -1, col_lleno = -1, col_fech = -1;
double carg = 0;
try
{
//se inicializan las listas doned se pondrán los iedntificadores y sus respectivas cargas que cumplan los requisitos de las fechas
reco.id = new List<int>();
reco.cargas = new List<double>();
acept = true;
//se recogen los datos introducidos en el dialogo
RecogidaDef.campos.cons_id_csv = textBox_id.Text;
reco.id_csv = RecogidaDef.campos.cons_id_csv;
RecogidaDef.campos.cons_llen_csv = textBox_llen.Text;
reco.llen_csv = RecogidaDef.campos.cons_llen_csv;
RecogidaDef.campos.cons_fecha_csv = textBox_fecha.Text;
reco.fecha_csv = RecogidaDef.campos.cons_fecha_csv;
f_ini = dateTimePicker_ini.Value;
if (dateTimePicker_fin.Enabled == true)
f_fin = dateTimePicker_fin.Value;
RecogidaDef.campos.fechai_csv = f_ini;
if (comboBox_media.SelectedIndex == 1)
RecogidaDef.campos.fechaf_csv = f_fin;
else if (comboBox_media.SelectedIndex == 0)
RecogidaDef.campos.fechaf_csv = new DateTime(2049, 01, 01, 00, 01, 00);
else
{
MessageBox.Show("Hay que seleccionar si se requiere hacer la media de fechas", "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
if (RecogidaDef.campos.fechai_csv > RecogidaDef.campos.fechaf_csv)
{
MessageBox.Show("La fecha final no puede ser menor que la fecha inicial", "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
RecogidaDef.campos.cons_fechai_csv = RecogidaDef.campos.fechai_csv.ToString("dd/MM/yyyy") + " " + RecogidaDef.campos.fechai_csv.ToString("H:mm");
reco.fechai_csv = RecogidaDef.campos.cons_fechai_csv;
RecogidaDef.campos.cons_fechaf_csv = RecogidaDef.campos.fechaf_csv.ToString("dd/MM/yyyy") + " " + RecogidaDef.campos.fechaf_csv.ToString("H:mm");
reco.fechaf_csv = RecogidaDef.campos.cons_fechaf_csv;
using (var reader = new StreamReader(csv, Encoding.Default))
{
Encoding enc = reader.CurrentEncoding;
while (!reader.EndOfStream)
{
veces++;
var line = reader.ReadLine();
var values = line.Split(';');
if (veces == 1)
{
title.AddRange(values);
for (int i = 0; i < title.Count; i++)
{
if (title[i] == reco.id_csv)
col_id = i;
else if (title[i] == reco.fecha_csv)
col_fech = i;
else if (title[i] == reco.llen_csv)
col_lleno = i;
}
if (col_id == -1)
{
MessageBox.Show(string.Format("El nombre del campo {0} para los indetificadores no es correcto", reco.id_csv), "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
if (col_fech == -1)
{
MessageBox.Show(string.Format("El nombre del campo {0} para las fechas no es correcto", reco.fecha_csv), "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
if (col_lleno == -1)
{
MessageBox.Show(string.Format("El nombre del campo {0} para los porcentajes de llenado no es correcto", reco.llen_csv), "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
continue;
}
time.Add(values[col_fech]);
lectura.Add(values[col_lleno]);
num.Add(values[col_id]);
}
}
if (dateTimePicker_fin.Enabled == true)
{
for (int i = 0; i < time.Count; i++)
{
ind = time[i].IndexOf("/");
dia = Convert.ToInt32(time[i].Substring(0, ind));
aux = time[i].Substring(ind + 1);
ind = aux.IndexOf("/");
mon = Convert.ToInt32(aux.Substring(0, ind));
aux = aux.Substring(ind + 1);
ind = aux.IndexOf(" ");
year = Convert.ToInt32(aux.Substring(0, ind));
aux = aux.Substring(ind + 1);
ind = aux.IndexOf(":");
hor = Convert.ToInt32(aux.Substring(0, ind));
min = Convert.ToInt32(aux.Substring(ind + 1));
fe = new DateTime(year, mon, dia, hor, min, 0);
if ((fe >= f_ini) && (fe <= f_fin))
{
nveces++;
if (lectura[i] == "")
lectura[i] = "100";
carg = carg + Convert.ToDouble(lectura[i], System.Globalization.CultureInfo.InvariantCulture);
}
if ((i == time.Count - 1) || (num[i] != num[i + 1]))
{
reco.id.Add(Convert.ToInt32(num[i]));
reco.cargas.Add(carg / nveces);
nveces = 0;
carg = 0;
}
}
}
else
{
for (int i = 0; i < time.Count; i++)
{
if (time[i] == reco.fechai_csv)
{
reco.id.Add(Convert.ToInt32(num[i]));
if (lectura[i] == "")
lectura[i] = "100";
reco.cargas.Add(Convert.ToDouble(lectura[i], System.Globalization.CultureInfo.InvariantCulture));
continue;
}
}
}
Close();
}
catch (Exception)
{
MessageBox.Show("Error al validar los datos introducidos en la ventana", "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
private void comboBox_media_SelectedIndexChanged(object sender, EventArgs e)
{
if (comboBox_media.SelectedIndex == 1)
dateTimePicker_fin.Enabled = true;
else if (comboBox_media.SelectedIndex == 0)
dateTimePicker_fin.Enabled = false;
else
MessageBox.Show("Hay que seleccionar si se requiere hacer la media de fechas", "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
private void DatosCsv_FormClosed(object sender, FormClosedEventArgs e)
{
if (acept == false)
{
reco.id_csv = null;
reco.llen_csv = null;
reco.fecha_csv = null;
reco.fechai_csv = null;
reco.fechaf_csv = null;
reco.id = null;
reco.cargas = null;
}
}
private void button_reset_Click(object sender, EventArgs e)
{
try
{
reinicia();
}
catch (Exception)
{
MessageBox.Show("Error al resetear", "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
}

145
OliviaAddIn/DatosCsv.resx Normal file
View File

@ -0,0 +1,145 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAEBAAAAAAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAAAAAAAAAAAAAAAAAAAAA
AAD///8B////Af///wH///8BOoFqBTqBamE6gWq9OoFq7zqBapU6gWq9OoFqvzqBamM6gWoF////Af//
/wH///8B////Af///wH///8BOoFqJTqBatE6gWr/OoFq/zqBav86gWqTOoFq9TqBav86gWr/OoFq0zqB
ain///8B////Af///wH///8BOoFqJTqBaus6gWr/OoFq/zqBav86gWr9OoFqqzqBauk6gWr9OoFq/zqB
av86gWrrOoFqJ////wH///8BOoFqAzqBas86gWr7OoFqzTqBaqk6gWqtOoFqYzqBask6gWpJOoFqXTqB
ass6gWr7OoFq/zqBatE6gWoF////ATqBalc6gWrpOoFq4zqBap86gWoNOoFqCzqBanM6gWrROoFqqzqB
ajk6gWoNOoFqezqBavk6gWr/OoFqW////wE6gWq1OoFqpTqBats6gWp7OoFqOzqBahs6gWrxOoFq8zqB
av86gWqVOoFqFTqBanM6gWqJOoFq0TqBarf///8BOoFq6zqBal86gWqFOoFqezqBais6gWpHOoFq8TqB
av86gWr/OoFqdTqBaj86gWopOoFqhTqBask6gWqF////ATqBauM6gWo1OoFqHzqBamX///8BOoFqiTqB
av86gWrhOoFq/zqBal////8BOoFqYTqBaok6gWrhOoFq/////wE6gWpFOoFqFzqBakU6gWov////ATqB
apk6gWr/OoFq8TqBav86gWrbOoFqE////wE6gWpVOoFqtzqBapv///8BOoFqeTqBaos6gWpj////Af//
/wE6gWpXOoFq+zqBav86gWr/OoFq3TqBahE6gWozOoFqiTqBauU6gWol////ATqBaj86gWoV////Af//
/wH///8BOoFqfTqBaus6gWr3OoFq9zqBajs6gWo7OoFqczqBat86gWphOoFqA////wH///8B////Af//
/wH///8B////ATqBapM6gWr/OoFq/zqBav86gWpbOoFqSTqBatM6gWqVOoFqeTqBahP///8B////Af//
/wH///8B////Af///wE6gWofOoFq1zqBav86gWr/OoFqff///wH///8B////Af///wH///8B////Af//
/wH///8B////Af///wH///8B////ATqBark6gWr/OoFqwzqBagf///8B////Af///wH///8B////Af//
/wH///8B////Af///wH///8B////Af///wE6gWo3OoFq6zqBaiP///8B////Af///wH///8B////Af//
/wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
/wH///8BAAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA
//8AAP//AAD//w==
</value>
</data>
</root>

2716
OliviaAddIn/DatosGDB.cs Normal file

File diff suppressed because it is too large Load Diff

27
OliviaAddIn/DatosGDBEx.cs Normal file
View File

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using ESRI.ArcGIS.ArcMap;
using ESRI.ArcGIS.DataSourcesFile;
using ESRI.ArcGIS.DataSourcesGDB;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.GeoDatabaseUI;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.AnalysisTools;
using ESRI.ArcGIS.Geoprocessor;
using ESRI.ArcGIS.Geoprocessing;
using ESRI.ArcGIS.Display;
using ESRI.ArcGIS.Framework;
namespace OliviaAddIn
{
public static class DatosGDBEx
{
}
}

525
OliviaAddIn/DatosGDBLimp.cs Normal file
View File

@ -0,0 +1,525 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OliviaDef;
using System.Windows.Forms;
using ESRI.ArcGIS.ArcMap;
using ESRI.ArcGIS.DataSourcesFile;
using ESRI.ArcGIS.DataSourcesGDB;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.Carto;
using System.IO;
using ESRI.ArcGIS.GeoDatabaseUI;
namespace OliviaAddIn
{
/**
* @file DatosGDBLimp.cs
* Clase con funciones para lectura de GDB relacionado con limpieza viaria.
* Contiene definiciones y funciones necesarias para exportar los datos de GDB a SHP, y viceversa
* concretados con las opciones de configuración de la limpieza viaria.
*/
/**
* Clase con funciones para lectura de GDB relacionado con limpieza viaria.
* Contiene definiciones y funciones necesarias para exportar los datos de GDB a SHP, y viceversa
* concretados con las opciones de configuración de la limpieza viaria.
*/
public class DatosGDBLimp : DatosGDB
{
//*************************************************************************************
//Variables
//*************************************************************************************
//Métodos
public DatosGDBLimp()
{
rellena_ftclass();
}
/**
* Rellenea el array ftclass con el nombre de las tablas de las que se extraerán datos
*/
public void rellena_ftclass()
{
int i;
LimpiezaDef.ftclass[(int)LimpiezaDef.AmbitsTra.AmbEjeCalle] = OliviaGlob.Capas.ftclass_ejes;
for(i = (int)LimpiezaDef.AmbitsTra.AmbBordLibreMec; i < (int)LimpiezaDef.AmbitsTra.AmbConte; i++)
{
LimpiezaDef.ftclass[i] = LimpiezaDef.Capas.ftclass_limp_mec;
}
LimpiezaDef.ftclass[(int)LimpiezaDef.AmbitsTra.AmbConte] = LimpiezaDef.Capas.ftclass_cont;
for(i=(int)LimpiezaDef.AmbitsTra.AmbPape; i<(int)LimpiezaDef.AmbitsTra.AmbN; i++)
{
LimpiezaDef.ftclass[i] = LimpiezaDef.Capas.ftclass_mobi;
}
}
/**
* Lee la geodatabase dónde están los datos referentes a los ámbitos de trabajo
*/
public bool[] lee_amb_gdb(Limpieza limp)
{
String consulta;
int numero_lin;
bool[] amb_gdb = new bool[(int)LimpiezaDef.AmbitsTra.AmbN];//se inician a false
string ftclass;
//mira a ver si hay ejes de calle
ftclass = LimpiezaDef.ftclass[(int)LimpiezaDef.AmbitsTra.AmbEjeCalle];
consulta = LimpiezaDef.filtro_str[(int)LimpiezaDef.AmbitsTra.AmbEjeCalle];
numero_lin = FunGDB.cuenta_filas_ftclass(OliviaGlob.Paths.PathGdbNw, ftclass, consulta);
if (numero_lin > 0)
{
amb_gdb[(int)LimpiezaDef.AmbitsTra.AmbEjeCalle] = true;
}
//mira a ver si hay el resto de capas y tienen entidades
for (int i = (int)LimpiezaDef.AmbitsTra.AmbBordLibreMec; i < (int)LimpiezaDef.AmbitsTra.AmbN; i++)
{
consulta = LimpiezaDef.filtro_str[i];
if (path_class == null) //como tradicionalmente, hay una gdb y los nombres de las feature classes del archivo de configuración
{
ftclass = LimpiezaDef.ftclass[i];
numero_lin = FunGDB.cuenta_filas_ftclass(OliviaGlob.Paths.PathGdbGen, ftclass, consulta);
}
else
numero_lin = FunGDB.cuenta_filas_ftclass(path_class, consulta);
if (numero_lin > 0)
{
amb_gdb[i] = true;
}
}
return amb_gdb;
}
/*
* Lee la capa que se ha seleccionzdo de limpieza y se comprueba que los campos que se han editado corresponden con la capa
* (es decir, se puede leer la capa con los campos configurados)
*/
public bool comprueba_campos_limp(Limpieza limp)
{
int ind_campo;
string[] camps;
int i;
ITable tabla;
int NCAMPS = 2;
if(path_class!=null)
tabla = FunGDB.dame_tabla_clase(path_class);
else
tabla = FunGDB.dame_tabla_clase(OliviaGlob.Paths.PathGdbGen, LimpiezaDef.Capas.ftclass_limp_mec);
//se comprueba que existen todos los campos que se han configurado en la capa seleccionada para la recogida
camps = new string[NCAMPS];
camps[0] = LimpiezaDef.Campos.consulta_entidad;
camps[1] = LimpiezaDef.Campos.consulta_mecan;
for (i = 0; i < NCAMPS; i++)
{
ind_campo = tabla.FindField(camps[i]);
if (ind_campo == -1)
{
limp.err_st = "No se encuentra el campo " + camps[i];
break;
}
}
if (i < NCAMPS)
return false;
return true;
}
/**
* Devuelve qué consulta hay que hacer, el filtro de los ámbitos y el nombre de la clase donde están
*/
public string dame_consul_amb_clas(Limpieza limp, out string ambitos, out string nom_class)
{
string consulta, orstr;
consulta = null;
ambitos = "";
orstr = null;
nom_class = null;
for (int i = 0; i < limp.amb_tra_sel.Length; i++)
{
if (limp.amb_tra_sel[i])
{
if(nom_class==null)
nom_class = LimpiezaDef.ftclass[i];
consulta = consulta + orstr + "(" + LimpiezaDef.filtro_str[i] + ")";
ambitos = ambitos + i.ToString("00");
if (orstr == null)
orstr = " OR ";
}
}
ambitos = "_A" + ambitos;
if (consulta == "()")
consulta = "";
return consulta;
}
/**
* Descodifica el nombre del sahpefile de entrada identificando el tipo de tratamiento y los ámbitos de trabajo
*/
public void decode_gdb(string shapefile, out string tratamiento, out string ambitos)
{
int aux, auxl, mbito, indice, tratamient;
string auxili, ambi, auxi;
indice = shapefile.IndexOf("_");
indice = indice + 2;//para saltarse la T que va antes del identificador del tipo de tratamiento
auxili = shapefile.Substring(indice, 2);
tratamient = Convert.ToInt32(auxili);
tratamiento = LimpiezaDef.tto_gdb[tratamient];
OliviaGlob.cartela_tto = LimpiezaDef.tipos_tto_str[tratamient];
indice = shapefile.IndexOf("_", indice);
indice = indice + 2;//para saltarse la A que va antes del identificador de los ámbitos que intervienen
aux = shapefile.IndexOf("_", indice);
auxl = aux - indice;
auxi = "";
while (auxl > 0)
{
ambi = shapefile.Substring(indice, 2);
mbito = Convert.ToInt32(ambi);
indice = indice + 2;
auxl = auxl - 2;
if (auxl != 0)
auxi = auxi + LimpiezaDef.ambs_gdb[mbito] + "_";
else
auxi = auxi + LimpiezaDef.ambs_gdb[mbito];
}
ambitos = LimpiezaDef.preftto_gdb[tratamient] + "_" + auxi;
//quita los espacios
tratamiento = tratamiento.Replace(" ", "_");
ambitos = ambitos.Replace(" ", "_");
auxi = shapefile;
//para poner la zona cuando es seleccionada
for (int i = 0; i < 2; i++)
{
indice = auxi.LastIndexOf("_");
auxi = auxi.Substring(0, indice);
}
auxl = indice - aux;
if (auxl <= 0)
return;
auxili = shapefile.Substring(aux, auxl);
ambitos = ambitos + auxili;
}
/**
* Exporta a shapefile las red navegable y los ámbitos de trabajo seleccionados. El archivo de salida será el nombre del tratamiento escogido.
*/
public bool exporta(Limpieza limp, bool comp_planif)
{
int cont=0;
string fecha_hora = "", ambitos = "";
string consulta = "";
IQueryFilter filtro = null;
IGeometry geom_zonniv = null;
IGeometry geom_ambits = null;
string nomb_class_limp = null;
IDatasetName datasetn=null;
bool hayzonniv = false;
if (limp == null)
{
err_st = "No se han recibido correctamente los datos para la exportación";
return false;
}
/////////////////////////////////////////////
//lee ambitos de trabajo
consulta = dame_consul_amb_clas(limp, out ambitos, out nomb_class_limp);
if (consulta == null)
{
err_st = "Error al configurar consulta";
return false;
}
/////////////////////////////////////////////
//si va a planificar antes comprueba que estén las columnas de sector y secuencia
if (comp_planif)
{
if (!comprueba_planif(path_class, nomb_class_limp))
{
err_st = "No existen en la tabla " + path_class + " columna de SECTOR y/o SECUENCIA, necesarias para planificar";
return false;
}
}
//si path_secto!=null, hay que actualizar la sectorización, si ==null, en los datos de entrada ya hay sectorización
//y secuencia y se van a exportar
//////////////////////////////////////////////////
if (path_class == null) //como tradicionalmente, hay una gdb y los nombres de las feature classes del archivo de configuración
{
if(nomb_class_limp==OliviaGlob.Capas.ftclass_ejes)
cont = FunGDB.cuenta_filas_ftclass(OliviaGlob.Paths.PathGdbNw, nomb_class_limp, consulta);
else
cont = FunGDB.cuenta_filas_ftclass(OliviaGlob.Paths.PathGdbGen, nomb_class_limp, consulta);
}
else
cont = FunGDB.cuenta_filas_ftclass(path_class, consulta);
if (cont <= 0)
{
err_st = "No existen ámbitos que cumplan las condiciones introducidas para la exportación "+consulta;
return false;
}
/////////////////////////////////////////////
//consigue el polígono común a las dos geometrías: zonas y niveles
//si no hay zonas ni niveles, es null
geom_zonniv = FunGDB.intersec_geoms(limp.geom_zonas, limp.geom_niveles);
//además, le quita las restricciones
if (geom_zonniv != null && limp.geom_rest_acces != null)
{
geom_zonniv = FunGDB.diferencia_geoms(geom_zonniv, limp.geom_rest_acces);
}
if (geom_zonniv != null && geom_zonniv.IsEmpty)
{
err_st = "Error, la geometría resultado de intersecar zonas, niveles y restricciones de circulación está vacía";
return false;
}
if (geom_zonniv == null && comp_planif && (path_secto != null))
{
//en este caso coge la geom de la secto
//obtiene el polígono que engloba los ámbitos
geom_zonniv = FunGDB.dame_geom_envelope(path_secto);
if (geom_zonniv == null)
{
err_st = "Error al obtener polígono de datos";
return false;
}
hayzonniv = false;
}
if (geom_zonniv == null && nomb_class_limp == OliviaGlob.Capas.ftclass_ejes)
{
err_st = "Al emplear ejes de calle como ámbitos es necesario indicar polígono de exportación";
return false;
}
/////////////////////////////////////////////
//crea el filtro en base a las consultas configuradas
filtro = crea_filtro(limp, nomb_class_limp, consulta, geom_zonniv);
if (filtro == null)
{
err_st = "Error al crear el filtro para la exportación";
return false;
}
/////////////////////////////////////////////
//se consigue el tiempo en este instante para añadirlo a los nombres de los archivos de salida (shapefiles)
fecha_hora = DateTime.Now.ToString("yyyyMMdd_Hmmss");
/////////////////////////////////////////////
//exporta los ámbitos
if (!exporta_data(limp, filtro, nomb_class_limp, ambitos, fecha_hora, out datasetn))
{
err_st = "Error al exportar data. "+err_st;
return false;
}
OliviaGlob.Paths.PathData = OliviaGlob.Paths.DirData + datasetn.Name;
//hace intersecciones espaciales en caso de ámbitos lineales para quitar los que tienen más parte fuera de la zona que dentro
if (geom_zonniv != null && (limp.tipo_tto < (int)LimpiezaDef.TiposTto.TtoPapeVaci) && hayzonniv)
{
if (!quita_amb_sobresalen(OliviaGlob.Paths.PathData, geom_zonniv,0.4))
{
err_st = "Error al quitar los ámbitos que sobresalen";
return false;
}
}
//quita los ámbitos que caen en la zona de restricciones, si es que no había zonas y no se ha quitado ya
if (geom_zonniv == null && limp.geom_rest_acces != null)
{
if (!quita_amb_restric(OliviaGlob.Paths.PathData, limp.geom_rest_acces, (limp.tipo_tto < (int)LimpiezaDef.TiposTto.TtoPapeVaci)))
{
err_st = "Error al quitar los ámbitos en zona de restricción";
return false;
}
}
//comprueba que sigue habiendo ámbitos exportados
cont = FunGDB.cuenta_filas_ftclass(OliviaGlob.Paths.PathData, "");
if (cont <= 0)
{
err_st = "No existen ámbitos que cumplan las condiciones geométricas introducidas";
return false;
}
//ahora si está en modo planificación exporta la sectorización
if (comp_planif && (path_secto!=null))
{
if (!actualiza_secto(OliviaGlob.Paths.PathData, path_secto))
{
err_st = "Error al exportar campos de SECTOR y/o SECUENCIA de la capa "+ path_secto + " " + err_st;
return false;
}
}
///////////////////////////////////////////////////////////////////////////
//obtiene el polígono que engloba los ámbitos
geom_ambits = FunGDB.dame_geom_envelope(OliviaGlob.Paths.PathData);
if (geom_ambits == null)
{
err_st = "Error al obtener polígono de datos";
return false;
}
///////////////////////////////////////////////////////////////////////////
//amplia el poligono para englobar las instalaciones
if (limp.coords_instala[0] != 0 && limp.coords_instala[1] != 0)
{
//hay instalación
geom_ambits=FunGDB.amplia_geom(geom_ambits, limp.coords_instala[0], limp.coords_instala[1]);
//comprueba, si hay restricciones de circulación, que la instalación no está en ellas
if (limp.geom_rest_acces != null)
{
if (FunGDB.is_pto_in_geom(limp.coords_instala[0], limp.coords_instala[1], limp.geom_rest_acces))
{
err_st = "Error, la instalación sal/lleg está en la zona restringida a la circulación";
return false;
}
}
}
///////////////////////////////////////////////////////////////////////////
//exporta la red navegable
if (!exporta_nw(geom_ambits, limp.geom_rest_acces,limp.rest_circ[limp.tipo_tto], fecha_hora, out datasetn))
{
return false;
}
//guarda los nombres del shape
OliviaGlob.Paths.PathNW = OliviaGlob.Paths.DirData + datasetn.Name;
return true;
}
/*
* Dado un nombre de featureclass, una consulta y una geometría, interseca entre un poligono dado (geom) y una capa lineal (fc1)
*/
public IQueryFilter dame_filt_inter(Limpieza limp, string ftclass, string consulta, IGeometry geom)
{
string dir = null;
IFeatureClass fc = null;
IQueryFilter fil= null;
if (ftclass == OliviaGlob.Capas.ftclass_ejes)
dir = OliviaGlob.Paths.PathGdbNw;
else if (path_class == null)
dir = OliviaGlob.Paths.PathGdbGen;
if (dir != null)
fc = FunGDB.abre_ftclass(dir, ftclass);
else
fc = FunGDB.abre_ftclass(path_class);
if (fc == null)
return null;
fil=base.dame_filt_inter(fc, consulta, geom);
FunGDB.libera(fc);
return fil;
}
/**
* Realiza las intersecciones espaciales de los ámbitos
*/
public IQueryFilter crea_filtro(Limpieza limp, string nomb_class, string consulta, IGeometry geom1)
{
IQueryFilter filtro;
//crea el filtro espacial y el añadido de consulta de atributos si fuera necesario
filtro = dame_filt_inter(limp,nomb_class, consulta, geom1);
if (filtro == null)
{
err_st = "Error al intersecar el ámbito de limpieza con la zona de estudio";
return null;
}
//FALTA REDEFINIR - elena jun 18
//-------------------------------------------------------------------------------------------------------------------
//Cuando se trate del vaciado de papeleras habrá que verificar si está marca el checkbox que indica si sólo van a recogerse los que superen el umbral de carga.
//De modo que la secotrizacion y la planificacion se realizará sólo sobre los contenedores que superan un porcetaje de carga en la basura.
//Se conocen esos contenedores por el nombre de un campo que indicará si SI(hay que ir a recogerlos) o NO (no tienen suficiente carga y se pueden recoger en otro momento)
if ((limp.tipo_tto == (int)LimpiezaDef.TiposTto.TtoPapeVaci) && (limp.umbral_reco_conten == true))
{
if (filtro.WhereClause == "")
filtro.WhereClause = carga_conten + " >= " + limp.umbral_basura;
else
filtro.WhereClause = "(" + filtro.WhereClause + ") AND (" + carga_conten + " >= " + limp.umbral_basura + ")";
}
return filtro;
}
/**
* Devuelve el string a concatenar en el nombre del path dependiendo de los polígonos seleccionados (zonas, turnos... etc)
*/
public string dame_str_poligs(Limpieza limp)
{
string str = "";
if (limp.text_niv != "" && limp.geom_niveles != null)
str += "_N" + limp.text_niv;
if(limp.text_zon!="" && limp.geom_zonas!=null)
str += "_Z" + limp.text_zon;
if (limp.text_restr != "" && limp.geom_rest_acces != null)
str += "_R" + limp.text_restr;
return str;
}
/**
* Exporta los ámbitos de la gdb a un shape en datasetname
*/
public bool exporta_data(Limpieza limp, IQueryFilter filtro, string nomb_class, string ambitos, string fecha_hora, out IDatasetName shp_data_name)
{
string name="", err_str="";
string dir = null;
IDatasetName shp_dsn = null;
shp_data_name = null;
//Pone nombre al shape en función de los ámbitos, el tratamiento, y los polígonos + timestamp
name = name_export_amb + "T" + limp.tipo_tto.ToString("00") + ambitos + dame_str_poligs(limp) + "_" + fecha_hora + ext_shp;
if (nomb_class == OliviaGlob.Capas.ftclass_ejes)
dir = OliviaGlob.Paths.PathGdbNw;
else if (path_class == null)
dir = OliviaGlob.Paths.PathGdbGen;
if (dir == null)
{
dir = path_class;
nomb_class = null;
}
inicia_coords(dir, nomb_class);
if (!FunGDB.exporta(dir, nomb_class, OliviaGlob.Paths.DirData, name, filtro, out shp_dsn, out err_str))
{
err_st = err_str;
return false;
}
shp_data_name = (IDatasetName)shp_dsn;
return true;
}
}
}

627
OliviaAddIn/DatosGDBReco.cs Normal file
View File

@ -0,0 +1,627 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.GeoDatabaseUI;
using ESRI.ArcGIS.Carto;
using System.Windows.Forms;
using ESRI.ArcGIS.esriSystem;
using System.IO;
using ESRI.ArcGIS.DataSourcesGDB;
using ESRI.ArcGIS.DataSourcesFile;
namespace OliviaAddIn
{
/**
* @file DatosGDBReco.cs
* Clase con funciones para lectura de GDB relacionado con la recogida de residuos.
* Contiene definiciones y funciones necesarias para exportar los datos de GDB a SHP, y viceversa
* concretados con las opciones de configuración de la recogida de residuos.
*/
/**
* Clase con funciones para lectura de GDB relacionado con la recogida de residuos.
* Contiene definiciones y funciones necesarias para exportar los datos de GDB a SHP, y viceversa
* concretados con las opciones de configuración de la recogida de residuos.
*/
public class DatosGDBReco : DatosGDB
{
//*************************************************************************************
//Variables
/**
* Otro tipo de fracción de recogida de basuras
*/
public string fra_otra = "";
/**
* otro tipo de carga en la recogida de basuras
*/
public string carg_otra = "";
//variables de la GDB de contenedores
public IWorkspaceFactory wsf_gdb_rec;
public IWorkspace gdb_ws_rec;
public IDataset gdb_data_rec;
public IName name_gdb_rec;
public IWorkspaceName name_gdb_ws_rec;
public IFeatureWorkspace feat_ws_rec;
//variables de la capa de turnos
public IWorkspaceFactory wsf_turn;
public IWorkspace ws_turn;
public IDataset data_turn;
public IName name_turn;
public IWorkspaceName name_ws_turn;
public IFeatureWorkspace feat_ws_turn;
//*************************************************************************************
//Constructor
public DatosGDBReco()
{
}
//*************************************************************************************
//Métodos
/*
* Lee la capa que se ha seleccionzdo de recogida de residuos y se comprueba que los campos que se han editado corresponden con la capa (es decir, se puede leer la capa con los campos configurados)
*/
public bool lee_capa_recogida(Recogida reco)
{
int ind_campo;
string[] camps;
int i;
int NCAMPS = 6;
ITable tabla_recog = FunGDB.dame_tabla_clase(path_class);
//se comprueba que existen todos los campos que se han configurado en la capa seleccionada para la recogida
camps = new string[NCAMPS];
camps[0]=RecogidaDef.campos_def.cons_id;
camps[1] = RecogidaDef.campos_def.cons_fracc;
camps[2] = RecogidaDef.campos_def.cons_nomrec;
camps[3] = RecogidaDef.campos_def.cons_lateral;
camps[4] = RecogidaDef.campos_def.cons_uds;
camps[5] = RecogidaDef.campos_def.cons_kgrec;
for (i = 0; i < NCAMPS; i++)
{
if ((i == (NCAMPS-1)) && (reco.rec_kgrec_cont != 0))
continue;
ind_campo = tabla_recog.FindField(camps[i]);
if (ind_campo == -1)
{
reco.err_st = "No se encuentra el campo "+ camps[i];
break;
}
}
if (i < NCAMPS)
return false;
return true;
}
/*
* A partir de los datos leidos de la capa de recogida se rellena el desplegable de fracción a partir de los datos existentes en la capa.
*/
public void lee_frac_gdb(Recogida reco)
{
string[] valores;
int err=0;
int i, j, k;
bool encontrado;
valores = FunGDB.dame_valunic_consulta(path_class, RecogidaDef.campos_def.cons_fracc, "", out err);
//se redimensionan los arrays de nuevo por si se ha pinchado varias veces en el botón de leer tabla
System.Array.Resize(ref RecogidaDef.tipos_fracc_str, (int)RecogidaDef.TiposFracción.N - 1);
System.Array.Resize(ref reco.tipos_fracc_bool, (int)RecogidaDef.TiposFracción.N - 1);
for (i = 0; i < valores.Length; i++)
{
//para que ponga '-' si es un campo vacío
if (valores[i] == "")
valores[i] = "-";
encontrado = false;
for (j = 0; j < (int)RecogidaDef.TiposFracción.N - 1; j++)
{
if (RecogidaDef.tipos_fracc_str[j] == valores[i])
{
reco.tipos_fracc_bool[j] = true;
encontrado = true;
break;
}
}
if (encontrado == false)
{
System.Array.Resize(ref RecogidaDef.tipos_fracc_str, RecogidaDef.tipos_fracc_str.Length + 1);
System.Array.Resize(ref reco.tipos_fracc_bool, reco.tipos_fracc_bool.Length + 1);
RecogidaDef.tipos_fracc_str[RecogidaDef.tipos_fracc_str.Length - 1] = valores[i];
reco.tipos_fracc_bool[reco.tipos_fracc_bool.Length - 1] = true;
}
}
}
/*
* A partir de los datos leidos de la capa de receogida se rellena el desplegable del tipo de carga a partir de los datos existentes en la capa.
*/
public bool lee_tipocarga_gdb(Recogida reco)
{
string[] valores;
int err = 0;
int i, j, k;
bool encontrado;
valores = FunGDB.dame_valunic_consulta(path_class, RecogidaDef.campos_def.cons_nomrec, "", out err);
//se redimensionan los arrays de nuevo por si se ha pinchado varias veces en el botón de leer tabla
System.Array.Resize(ref RecogidaDef.tipos_carg_str, (int)RecogidaDef.TiposCarga.N - 1);
System.Array.Resize(ref reco.tipos_carg_bool, (int)RecogidaDef.TiposCarga.N - 1);
for (i = 0; i < valores.Length; i++)
{
//para que ponga '-' si es un campo vacío
if (valores[i] == "")
valores[i] = "-";
encontrado = false;
for (j = 0; j < (int)RecogidaDef.TiposCarga.N - 1; j++)
{
if (RecogidaDef.tipos_carg_str[j] == valores[i])
{
reco.tipos_carg_bool[j] = true;
encontrado = true;
break;
}
}
if (encontrado == false)
{
System.Array.Resize(ref RecogidaDef.tipos_carg_str, RecogidaDef.tipos_carg_str.Length + 1);
System.Array.Resize(ref reco.tipos_carg_bool, reco.tipos_carg_bool.Length + 1);
//reco.tipos_carg_bool[i] = false;
RecogidaDef.tipos_carg_str[RecogidaDef.tipos_carg_str.Length - 1] = valores[i];
reco.tipos_carg_bool[reco.tipos_carg_bool.Length - 1] = true;
}
}
return true;
}
/*
* Crea la consulta que hay que realizar a la capa de recogida de residuos para la exportación de los datos de interés.
* Devuelve también la abreviatura que se le añadirá a la capa exportada (se identifica la fracción y el tipo de carga del vehículo)
*/
public string dame_consulta(Recogida rec, out string cap_abrev)
{
string consulta, orstr, aux;
consulta = null;
cap_abrev = "";
aux = "";
orstr = null;
if (rec.tipo_frac != -1)
{
consulta = consulta + orstr + "(" + RecogidaDef.filtro_str[rec.tipo_frac] + ")";
cap_abrev = rec.tipo_frac.ToString("00");
cap_abrev = "F" + cap_abrev + "_";
if (consulta == "()")
consulta = "";
}
if (orstr == null)
orstr = " AND ";
if (rec.tipo_carg != -1)
{
consulta = consulta + orstr + "(" + RecogidaDef.filtro_str[rec.tipos_fracc_bool.Length + rec.tipo_carg] + ")";
aux = rec.tipo_carg.ToString("00");
cap_abrev = cap_abrev + "C" + aux;
if (consulta == "()")
consulta = "";
}
if (rec.lateralidad > 0)
{
consulta = consulta + orstr + "(" + RecogidaDef.campos_def.cons_lateral + " = '" + RecogidaDef.tipos_lateralidad[rec.lateralidad] + "'" + ")";
if (consulta == "()")
consulta = "";
}
return consulta;
}
/*
* Dado un nombre de featureclass, una consulta y una geometría, interseca entre un poligono dado (geom) y una capa lineal (fc1)
*/
public IQueryFilter dame_filt_inter(string ftclass, string consulta, IGeometry geom)
{
IQueryFilter fil = null;
IFeatureClass fc = FunGDB.abre_ftclass(ftclass);
if (fc == null)
return null;
fil = base.dame_filt_inter(fc, consulta, geom);
FunGDB.libera(fc);
return fil;
}
/**
* Realiza las intersecciones espaciales de los ámbitos
*/
public IQueryFilter crea_filtro(Recogida rec, string consulta, IGeometry geom1)
{
IQueryFilter filtro;
//crea el filtro espacial y el añadido de consulta de atributos si fuera necesario
filtro = dame_filt_inter(path_class, consulta, geom1);
if (filtro == null)
{
err_st = "Error al intersecar el ámbito de limpieza con la zona de estudio";
return null;
}
//FALTA REDEFINIR - elena jun 18
//Cuando se trate del vaciado de papeleras habrá que verificar si está marcado el checkbox que indica si sólo van a recogerse los que superen el umbral de carga.
//De modo que la secotrizacion y la planificacion se realizará sólo sobre los contenedores que superan un porcetaje de carga en la basura.
//Se conocen esos contenedores por el nombre de un campo que indicará si SI(hay que ir a recogerlos) o NO (no tienen suficiente carga y se pueden recoger en otro momento)
if ((rec.carga_max > 0) && (rec.id == null) && (rec.id_sens == null))
{
if (filtro.WhereClause == "")
filtro.WhereClause = carga_conten + " >= " + rec.carga_max;
else
filtro.WhereClause = "(" + filtro.WhereClause + ") AND (" + carga_conten + " >= " + rec.carga_max + ")";
}
return filtro;
}
/**
* Descodifica el nombre del sahpefile de entrada identificando el tipo de fracción y la carga para la recogida de residuos
*/
public void decode_gdb(string shapefile, out string fraccion, out string carga)
{
int aux, auxl, carg, indice, fracc;
string auxili, fra, auxi;
indice = shapefile.IndexOf("_");
indice = indice + 2;//para saltarse la F que va antes del identificador del tipo de fracción
auxili = shapefile.Substring(indice, 2);
fracc = Convert.ToInt32(auxili);
fraccion = RecogidaDef.tipos_fracc_str[fracc];
indice = shapefile.IndexOf("_", indice);
indice = indice + 2;//para saltarse la C que va antes del identificador de los tipos de carga de los vehículos
aux = shapefile.IndexOf("_", indice);
auxi = "";
fra = shapefile.Substring(indice, 2);
carg = Convert.ToInt32(fra);
carga = RecogidaDef.tipos_fracc_str[fracc] + "_" + RecogidaDef.tipos_carg_str[carg];
//quita los espacios
fraccion = fraccion.Replace(" ", "_");
carga = carga.Replace(" ", "_");
////////////////////////
auxi = shapefile;
for (int i = 0; i < 2; i++)
{
indice = auxi.LastIndexOf("_");
auxi = auxi.Substring(0, indice);
}
auxl = indice - aux;
if (auxl <= 0)
return;
auxili = shapefile.Substring(aux, auxl);
carga = carga + auxili;
}
/**
* Exporta a shapefile las red navegable y los ámbitos de trabajo seleccionados.
* El archivo de salida será el nombre del tratamiento escogido con el timestampo de la fecha hora
*/
public bool exporta(Recogida rec, bool comp_planif)
{
int cont = 0;
string fecha_hora = "", ambitos = "";
string consulta = "";
IQueryFilter filtro = null;
IGeometry geom_zontur = null;
IGeometry geom_ambits = null;
IDatasetName datasetn = null;
if (rec == null)
{
err_st = "No se han recibido correctamente los datos para la exportación";
return false;
}
/////////////////////////////////////////////
//elabora la consulta a realizar con los parámertos de fracción y tipo de recogida
consulta = dame_consulta(rec, out ambitos);
if (consulta == null)
{
err_st = "Error al configurar consulta";
return false;
}
/////////////////////////////////////////////
//si va a planificar antes comprueba que estén las columnas de sector y secuencia
if (comp_planif)
{
if (!comprueba_planif(path_class, null))
{
err_st = "No existen en la tabla " + path_class + " columna de SECTOR y/o SECUENCIA, necesarias para planificar";
return false;
}
}
cont = FunGDB.cuenta_filas_ftclass(path_class, consulta);
if (cont <= 0)
{
err_st = "No existen elementos geométricos que cumplan las condiciones introducidas para la exportación";
return false;
}
/////////////////////////////////////////////
//consigue el polígono común a las dos geometrías: zonas y turnos
//si no hay zonas ni turnos, es null
geom_zontur = FunGDB.une_geoms(rec.geom_zonas, rec.geom_turnos);
//además, le quita las restricciones
if (geom_zontur != null && rec.geom_rest_acces != null)
{
geom_zontur = FunGDB.diferencia_geoms(geom_zontur, rec.geom_rest_acces);
}
if (geom_zontur != null && geom_zontur.IsEmpty)
{
err_st = "Error, la geometría resultado de intersecar zonas, turnos y restricciones de circulación está vacía";
return false;
}
/////////////////////////////////////////////
//crea el filtro en base a las consultas configuradas
filtro = crea_filtro(rec, consulta, geom_zontur);
if (filtro == null)
{
err_st = "Error al crear el filtro para la exportación";
return false;
}
/////////////////////////////////////////////
//se consigue el tiempo en este instante para añadirlo a los nombres de los archivos de salida (shapefiles)
fecha_hora = DateTime.Now.ToString("yyyyMMdd_Hmmss");
//exporta los ámbitos
if (!exporta_data(rec, filtro, ambitos, fecha_hora, out datasetn))
{
err_st = "Error al exportar data. " + err_st;
return false;
}
OliviaGlob.Paths.PathData = OliviaGlob.Paths.DirData + datasetn.Name;
//quita los contenedores que caen en la zona de restricciones, si es que no había zonas y no se ha quitado ya
if (geom_zontur == null && rec.geom_rest_acces != null)
{
if (!quita_amb_restric(OliviaGlob.Paths.PathData, rec.geom_rest_acces, false))
{
err_st = "Error al quitar los ámbitos en zona de restricción";
return false;
}
}
//comprueba que sigue habiendo ámbitos exportados
cont = FunGDB.cuenta_filas_ftclass(OliviaGlob.Paths.PathData, "");
if (cont <= 0)
{
err_st = "No existen ámbitos que cumplan las condiciones geométricas introducidas";
return false;
}
if (rec.id != null)
{
int err = 0;
FunGDB.add_campo(OliviaGlob.Paths.PathData, RecogidaDef.campos.cons_kgrec, esriFieldType.esriFieldTypeDouble, out err);
if (!pon_datos_csv(rec, OliviaGlob.Paths.PathData))
{
err_st = "Error al consultar el CSV con los datos de los contenedores.";
return false;
}
}
//ahora si está en modo planificación exporta la sectorización
if (comp_planif && (path_secto != null))
{
if (!actualiza_secto(OliviaGlob.Paths.PathData, path_secto))
{
err_st = "Error al exportar campos de SECTOR y/o SECUENCIA de la capa " + path_secto + " " + err_st;
return false;
}
}
///////////////////////////////////////////////////////////////////////////
//obtiene el polígono que engloba los ámbitos
geom_ambits = FunGDB.dame_geom_envelope(OliviaGlob.Paths.PathData);
if (geom_ambits == null)
{
err_st = "Error al obtener polígono de datos";
return false;
}
///////////////////////////////////////////////////////////////////////////
//amplia el poligono para englobar las instalaciones
if (rec.coords_instala[0] != 0 && rec.coords_instala[1] != 0)
{
//hay instalación
geom_ambits = FunGDB.amplia_geom(geom_ambits, rec.coords_instala[0], rec.coords_instala[1]);
//comprueba, si hay restricciones de circulación, que la instalación no está en ellas
if (rec.geom_rest_acces != null)
{
if (FunGDB.is_pto_in_geom(rec.coords_instala[0], rec.coords_instala[1], rec.geom_rest_acces))
{
err_st = "Error, la instalación sal/lleg está en la zona restringida a la circulación";
return false;
}
}
}
if (rec.coords_descarg[0] != 0 && rec.coords_descarg[1] != 0)
{
//hay instalación de descarga
geom_ambits = FunGDB.amplia_geom(geom_ambits, rec.coords_descarg[0], rec.coords_descarg[1]);
//comprueba, si hay restricciones de circulación, que la instalación no está en ellas
if (rec.geom_rest_acces != null)
{
if (FunGDB.is_pto_in_geom(rec.coords_descarg[0], rec.coords_descarg[1], rec.geom_rest_acces))
{
err_st = "Error, la planta de descarga está en la zona restringida a la circulación";
return false;
}
}
}
///////////////////////////////////////////////////////////////////////////
//exporta la red navegable
if (!exporta_nw(geom_ambits, rec.geom_rest_acces, true, fecha_hora, out datasetn))
{
return false;
}
//guarda los nombres del shape
OliviaGlob.Paths.PathNW = OliviaGlob.Paths.DirData + datasetn.Name;
return true;
}
/**
* Devuelve el string a concatenar en el nombre del path dependiendo de los polígonos seleccionados (zonas, turnos... etc)
*/
public string dame_str_poligs(Recogida rec)
{
string str = "";
if (rec.text_turnos != "" && rec.geom_turnos != null)
str += "_T" + rec.text_turnos;
if (rec.text_zon != "" && rec.geom_zonas != null)
str += "_Z" + rec.text_zon;
if (rec.text_restr != "" && rec.geom_rest_acces != null)
str += "_R" + rec.text_restr;
return str;
}
/**
* Exporta los ámbitos de la gdb a un shape en datasetname
*/
public bool exporta_data(Recogida rec, IQueryFilter filtro, string ambitos, string fecha_hora, out IDatasetName shp_data_name)
{
string name = "", err_str = "";
IDatasetName shp_dsn = null;
shp_data_name = null;
//Pone nombre al shape en función de los ámbitos, el tratamiento, y los polígonos + timestamp
name = name_export_amb + ambitos + dame_str_poligs(rec) + "_" + fecha_hora + ext_shp;
inicia_coords(path_class, null);
if (!FunGDB.exporta(path_class, null, OliviaGlob.Paths.DirData, name, filtro, out shp_dsn, out err_str))
{
err_st = err_str;
return false;
}
shp_data_name = (IDatasetName)shp_dsn;
return true;
}
/*
* REVISAR
* Modifica el shapefile exportado de modo que elimina aquellos elementos (contenedores) que no contengan un porcentaje de cargaigual o superior al indicado en la ventana de recogida (rec.carga_max).
*/
public bool pon_datos_csv(Recogida rec, string capa)
{
int col_kg = -1, col_capa;
object obj, capacidad;
IFeature feat = null;
IFeatureClass fc = null;
IFeatureCursor cursor = null;
IQueryFilter filtro = new QueryFilterClass();
ITable tabla = null;
IRow fila = null;
fc = FunGDB.abre_ftclass(capa);
if (fc == null)
return false;
tabla = FunGDB.dame_tabla_clase(capa);
if (tabla == null)
return false;
col_kg = tabla.FindField(RecogidaDef.campos.cons_kgrec);
col_capa = tabla.FindField(RecogidaDef.campos.cons_capac);
for (int i = 0; i < rec.id.Count; i++)
{
filtro.WhereClause = RecogidaDef.campos.cons_id + "=" + rec.id[i];
cursor = fc.Search(filtro, false);
feat = cursor.NextFeature();
if (feat == null)
{
//libera
FunGDB.libera(fila);
FunGDB.libera(cursor);
FunGDB.libera(feat);
break;
}
fila = tabla.GetRow(feat.OID);
//si el procentaje de carga indicado es superior al indicado por el archivo CSV se omite ese elemento a exportar, por lo que se elimina de la lista
if (rec.carga_max > rec.cargas[i])
{
fila.Delete();
//libera
FunGDB.libera(fila);
FunGDB.libera(cursor);
FunGDB.libera(feat);
continue;
}
capacidad = fila.get_Value(col_capa);
if (rec.dens_cont >= 0)
fila.set_Value(col_kg, rec.cargas[i] * rec.dens_cont * (int)capacidad / 1000);
else
fila.set_Value(col_kg, rec.cargas[i] * RecogidaDef.dens_frac_cont[rec.tipo_frac] * (int)capacidad / 1000);
fila.Store();
//libera
FunGDB.libera(fila);
FunGDB.libera(cursor);
FunGDB.libera(feat);
}
cursor = fc.Search(null, false);
feat = cursor.NextFeature();
while (feat != null)
{
fila = tabla.GetRow(feat.OID);
obj = fila.get_Value(col_kg);
capacidad = fila.get_Value(col_capa);
if ((Double)obj == 0.0)
{
fila.set_Value(col_kg, rec.dens_cont * (int)capacidad/1000);
fila.Store();
//libera
FunGDB.libera(fila);
FunGDB.libera(feat);
}
//libera
FunGDB.libera(fila);
FunGDB.libera(feat);
feat = cursor.NextFeature();
}
//libera
FunGDB.libera(fila);
FunGDB.libera(cursor);
FunGDB.libera(feat);
FunGDB.libera(filtro);
FunGDB.libera(tabla);
FunGDB.libera(fc);
return true;
}
}
}

73
OliviaAddIn/EditTxtPlant.Designer.cs generated Normal file
View File

@ -0,0 +1,73 @@
namespace OliviaAddIn
{
partial class EditTxtPlant
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.propertyGrid_txtplant = new OliviaAddIn.TabbedPropertyGrid();
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// propertyGrid_txtplant
//
this.propertyGrid_txtplant.Location = new System.Drawing.Point(12, 12);
this.propertyGrid_txtplant.Name = "propertyGrid_txtplant";
this.propertyGrid_txtplant.PropertySort = System.Windows.Forms.PropertySort.Categorized;
this.propertyGrid_txtplant.Size = new System.Drawing.Size(404, 332);
this.propertyGrid_txtplant.TabIndex = 0;
this.propertyGrid_txtplant.ToolbarVisible = false;
//
// button1
//
this.button1.Location = new System.Drawing.Point(341, 356);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 1;
this.button1.Text = "Aceptar";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// EditTxtPlant
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(428, 391);
this.Controls.Add(this.button1);
this.Controls.Add(this.propertyGrid_txtplant);
this.Name = "EditTxtPlant";
this.Text = "Editor de Textos para la Plantilla";
this.Resize += new System.EventHandler(this.EditTxtPlant_Resize);
this.ResumeLayout(false);
}
#endregion
private TabbedPropertyGrid propertyGrid_txtplant;
private System.Windows.Forms.Button button1;
}
}

340
OliviaAddIn/EditTxtPlant.cs Normal file
View File

@ -0,0 +1,340 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Design;
using System.Windows.Forms.Design;
namespace OliviaAddIn
{
public partial class EditTxtPlant : Form
{
//////////////////////////////////////////////////////////////
//variables para los botones
int top_buttons;
int bottom_props;
int right_props;
public EditTxtPlantProps props;
public EditTxtPlant()
{
props = new EditTxtPlantProps();
InitializeComponent();
top_buttons = ClientSize.Height - button1.Top;
bottom_props = ClientSize.Height - propertyGrid_txtplant.Bottom;
right_props = ClientSize.Width - propertyGrid_txtplant.Right;
// Assign the form to the propertygrid
propertyGrid_txtplant.SetParent(this);
propertyGrid_txtplant.SelectedObject = props;
}
private void button1_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
Close();
}
private void EditTxtPlant_Resize(object sender, EventArgs e)
{
//mover button_aceptar, button_reset, button_guardar, bottom del property
button1.Top = ClientSize.Height - top_buttons;
propertyGrid_txtplant.Size = new Size(ClientSize.Width - right_props, ClientSize.Height - bottom_props);
}
}
/*
* Clase para los campos multilínea
*/
public class MultiLineTextEditor : UITypeEditor
{
private IWindowsFormsEditorService _editorService;
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
{
return UITypeEditorEditStyle.DropDown;
}
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
{
_editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
TextBox textEditorBox = new TextBox();
textEditorBox.Multiline = true;
textEditorBox.ScrollBars = ScrollBars.Vertical;
textEditorBox.Width = 250;
textEditorBox.Height = 150;
textEditorBox.BorderStyle = BorderStyle.None;
textEditorBox.AcceptsReturn = true;
textEditorBox.Text = value as string;
_editorService.DropDownControl(textEditorBox);
return textEditorBox.Text;
}
}
/**
* Clase para la estructura de propiedades
*/
public class EditTxtPlantProps
{
public const int N_CAMPOS_PLANT = 7;
public String[] campos_plant = new String[N_CAMPOS_PLANT];
public Font[] fonts = new Font[N_CAMPOS_PLANT];
public EditTxtPlantProps()
{
int[] ss = {10,14,12,8,8,8,7};
for (int i = 0; i < N_CAMPOS_PLANT; i++)
{
campos_plant[i]="";
fonts[i] = new Font("Arial Narrow", ss[i], FontStyle.Regular);
}
}
[CategoryAttribute("01 Proyecto")]
[DisplayNameAttribute("Texto del Proyecto")]
[DescriptionAttribute("Título del proyecto")]
[Editor(typeof(MultiLineTextEditor), typeof(UITypeEditor))]
public string titulo
{
get { return campos_plant[0]; }
set { campos_plant[0] = value; }
}
[CategoryAttribute("01 Proyecto")]
[DisplayNameAttribute("Fuente del Proyecto")]
[DescriptionAttribute("Fuente para el Título del proyecto")]
public Font titulo_font
{
get { return fonts[0]; }
set { fonts[0] = value; }
}
/// <summary>
/// ///////////////////////////////////
/// </summary>
[CategoryAttribute("02 Título")]
[DisplayNameAttribute("Texto del título")]
[DescriptionAttribute("Título del servicio")]
[Editor(typeof(MultiLineTextEditor), typeof(UITypeEditor))]
public string titulo_serv
{
get { return campos_plant[1]; }
set { campos_plant[1] = value; }
}
[CategoryAttribute("02 Título")]
[DisplayNameAttribute("Fuente del título")]
[DescriptionAttribute("Fuente para el Título del servicio")]
public Font titulo_serv_font
{
get { return fonts[1]; }
set { fonts[1] = value; }
}
/// <summary>
/// ///////////////////////////////////
/// </summary>
[CategoryAttribute("03 Tipología")]
[DisplayNameAttribute("Texto de la Tipología")]
[DescriptionAttribute("Tipología del servicio: Recogida de residuos, Limpieza viaria, Mantenimiento zonas verdes, etc.")]
[Editor(typeof(MultiLineTextEditor), typeof(UITypeEditor))]
public string tipo_serv
{
get { return campos_plant[2]; }
set { campos_plant[2] = value; }
}
[CategoryAttribute("03 Tipología")]
[DisplayNameAttribute("Fuente de la Tipología")]
[DescriptionAttribute("Fuente para la Tipología del servicio")]
public Font tipo_serv_font
{
get { return fonts[2]; }
set { fonts[2] = value; }
}
/// <summary>
/// ///////////////////////////////////
/// </summary>
[CategoryAttribute("04 Frecuencia")]
[DisplayNameAttribute("Texto de la frecuencia")]
[DescriptionAttribute("Frecuencia del servicio")]
[Editor(typeof(MultiLineTextEditor), typeof(UITypeEditor))]
public string frec_serv
{
get { return campos_plant[3]; }
set { campos_plant[3] = value; }
}
[CategoryAttribute("04 Frecuencia")]
[DisplayNameAttribute("Fuente de la frecuencia")]
[DescriptionAttribute("Fuente para la Frecuencia del servicio")]
public Font frec_serv_font
{
get { return fonts[3]; }
set { fonts[3] = value; }
}
/// <summary>
/// ///////////////////////////////////
/// </summary>
[CategoryAttribute("05 Turno")]
[DisplayNameAttribute("Texto del Turno")]
[DescriptionAttribute("Turno del servicio")]
[Editor(typeof(MultiLineTextEditor), typeof(UITypeEditor))]
public string turno_serv
{
get { return campos_plant[4]; }
set { campos_plant[4] = value; }
}
[CategoryAttribute("05 Turno")]
[DisplayNameAttribute("Fuente del Turno")]
[DescriptionAttribute("Fuente para el Turno del servicio")]
public Font turno_serv_font
{
get { return fonts[4]; }
set { fonts[4] = value; }
}
/// <summary>
/// ///////////////////////////////////
/// </summary>
[CategoryAttribute("06 Equipo")]
[DisplayNameAttribute("Texto del Equipo")]
[DescriptionAttribute("Equipo del servicio: Conductor, Peón Conductor, Peón, Vehículo")]
[Editor(typeof(MultiLineTextEditor), typeof(UITypeEditor))]
public string equipo_serv
{
get { return campos_plant[5]; }
set { campos_plant[5] = value; }
}
[CategoryAttribute("06 Equipo")]
[DisplayNameAttribute("Fuente del Equipo")]
[DescriptionAttribute("Fuente para el Equipo del servicio")]
public Font equipo_serv_font
{
get { return fonts[5]; }
set { fonts[5] = value; }
}
/// <summary>
/// ///////////////////////////////////
/// </summary>
[CategoryAttribute("07 Información adicional")]
[DisplayNameAttribute("Texto para Información adicional")]
[DescriptionAttribute("Otra información para el proyecto")]
[Editor(typeof(MultiLineTextEditor), typeof(UITypeEditor))]
public string info_adi
{
get { return campos_plant[6]; }
set { campos_plant[6] = value; }
}
[CategoryAttribute("07 Información adicional")]
[DisplayNameAttribute("Fuente para Información adicional")]
[DescriptionAttribute("Fuente para la Información adicional")]
public Font info_adi_font
{
get { return fonts[6]; }
set { fonts[6] = value; }
}
/// <summary>
/// ///////////////////////////////////
/// </summary>
}
/**
* Para usar el Tabulador para cambiar de propiedad
*/
public class TabbedPropertyGrid : PropertyGrid
{
Form parent;
public TabbedPropertyGrid() : base() { }
public void SetParent(Form form)
{
parent = form;
// Catch null arguments
if (form == null)
{
throw new ArgumentNullException("form");
}
// Set this property to intercept all events
form.KeyPreview = true;
// Listen for keydown event
form.KeyDown += new KeyEventHandler(this.Form_KeyDown);
}
private void Form_KeyDown(object sender, KeyEventArgs e)
{
// Exit if cursor not in control
if (!this.RectangleToScreen(this.ClientRectangle).Contains(Cursor.Position))
{
return;
}
// Handle tab key
if (e.KeyCode != Keys.Tab) { return; }
e.Handled = true;
e.SuppressKeyPress = true;
// Get selected griditem
GridItem gridItem = this.SelectedGridItem;
if (gridItem == null) { return; }
// Create a collection all visible child griditems in propertygrid
GridItem root = gridItem;
while (root.GridItemType != GridItemType.Root)
{
root = root.Parent;
}
List<GridItem> gridItems = new List<GridItem>();
this.FindItems(root, gridItems);
// Get position of selected griditem in collection
int index = gridItems.IndexOf(gridItem);
int nextIndex = index + 1;
if (nextIndex >= gridItems.Count)
{
//ha terminado, pasa al siguiente
parent.GetNextControl(this, true).Focus();
return;
}
// Select next griditem in collection
this.SelectedGridItem = gridItems[nextIndex];
}
private void FindItems(GridItem item, List<GridItem> gridItems)
{
switch (item.GridItemType)
{
case GridItemType.Root:
case GridItemType.Category:
foreach (GridItem i in item.GridItems)
{
this.FindItems(i, gridItems);
}
break;
case GridItemType.Property:
gridItems.Add(item);
if (item.Expanded)
{
foreach (GridItem i in item.GridItems)
{
this.FindItems(i, gridItems);
}
}
break;
case GridItemType.ArrayValue:
break;
}
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

129
OliviaAddIn/Ejecuta.cs Normal file
View File

@ -0,0 +1,129 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SisNetBase;
using OliviaDef;
using System.Diagnostics;
using SisNetBase.Modulos;
using System.IO;
using System.Threading;
using System.Windows.Forms;
namespace OliviaAddIn
{
/**
* @file Ejecuta.cs
* Clase de ejecución del grueso de la herramienta Olivia.
* Guarda en un archivo de configuración la información configurada,
* lanza una ventana de progreso,
* llama al proceso Geofoto, y va leyendo en el archivo de configuración
* el progreso de la ejecución, que actualiza en la ventana.
*/
/**
* Clase de ejecución del grueso de la herramienta Olivia.
* Guarda en un archivo de configuración la información configurada,
* lanza una ventana de progreso,
* llama al proceso Geofoto, y va leyendo en el archivo de configuración
* el progreso de la ejecución, que actualiza en la ventana.
*/
class Ejecuta
{
//*************************************************************************************
//Enums
public enum ModosEjec
{
Secto,
Planif,
SoloPlanif,
}
//*************************************************************************************
//Variables
/**
* Cadena general de escritura de parámetros de configuración para envío por socket
*/
public string str_cfg;
/**
* Cadena general para indicar los errores de ejecución
*/
public string err_str="";
/**
* Cadena general de escritura de parámetros para envío por socket
*/
public string str;
//*************************************************************************************
//Métodos
public Ejecuta()
{
str = "";
}
~Ejecuta() // destructor (finalizers)
{
// cleanup statements...
}
/**
* Comienza las funciones de ejecución
*/
public bool ejec()
{
//lanza ventana marchando que lanza proceso en bucle para actualizar barra progreso
OliviaGlob.progr_eje = new ProgresoEjec();
//lanza proceso geofoto
if (!lanza_geofoto())
{
err_str = "Error al arrancar Geofoto (programa de procesado de datos): No ha arrancado correctamente la instancia Geofoto";
return false;
}
OliviaGlob.progr_eje.start(str_cfg);
return true;
}
/**
* Arranca el proceso geofoto con los parámetros correspondientes
*/
private bool lanza_geofoto()
{
Process pg;
string args;
ProcessStartInfo pfi;
try
{
//van ParamN parámetros, sin incluir "/olivia", si se añaden, incrementar ParamN
args = GeneralDef.EjecGeoParamSep + GeneralDef.EjecGeoProgName + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_tipo + GeneralDef.EjecGeoParamIgual + ((int)OliviaGlob.tip_oliv).ToString() + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_ip + GeneralDef.EjecGeoParamIgual + OliviaGlob.ip + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_port + GeneralDef.EjecGeoParamIgual + OliviaGlob.puerto + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_tout + GeneralDef.EjecGeoParamIgual + OliviaGlob.t_out_sock + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_pt + GeneralDef.EjecGeoParamIgual + OliviaGlob.Paths.PathTemp + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_pcfg + GeneralDef.EjecGeoParamIgual + OliviaGlob.Paths.PathWork + "cfg_geo.ini" + " " ;
pfi = new ProcessStartInfo(OliviaGlob.Paths.PathGeofoto, args);
System.Diagnostics.Process.Start(pfi);
//comprueba que haya arrancado geofoto
//le da 2 seg de margen para que arranque
pg = OliviaGlob.progr_eje.esta_geofoto(2, true);
if (pg == null)
{
MessageBox.Show("No está Geofot, args= "+args, "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
}
catch (Exception)
{
return false;
}
return true;
}
}
}

111
OliviaAddIn/EjecutaLimp.cs Normal file
View File

@ -0,0 +1,111 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SisNetBase;
using OliviaDef;
using System.IO;
using System.Windows.Forms;
namespace OliviaAddIn
{
/**
* @file EjecutaLimp.cs
* Clase con funciones para ejecución del programa en modo limpieza viaria.
* Hace la llamada correspondiente a Geofoto con los parámetros seleccionados.
*/
class EjecutaLimp : Ejecuta
{
//*************************************************************************************
//Variables
public Limpieza limp;
//*************************************************************************************
//Métodos
public EjecutaLimp()
{
err_str = "";
}
/**
* Comienza las funciones de ejecución
* modo 0 la primera vez, va a sectorizar, modo 1 la segunda vez, planifica
*/
public bool ejec(Limpieza limp, int modo)
{
if (limp == null)
{
err_str = "Error en la recopilación de datos para el procesado";
return false;
}
OliviaGlob.tip_oliv = OliviaDef.GeneralDef.TiposOliv.OlivLimp;
if (!OliviaGlob.gdb_limp.exporta(limp, modo == (int)Ejecuta.ModosEjec.Planif))
{
err_str = OliviaGlob.gdb_limp.err_st;
return false;
}
//configura el string de opciones
if (!configura_ops_geo(limp,modo))
{
err_str = "Error al configurar opciones";
return false;
}
this.limp = limp;
//Llama al ejecuta del padre
return base.ejec();
}
/**
* Configura el str de opciones que va a mandar a geofoto
* modo 0 la primera vez, va a sectorizar, modo 1 la segunda vez, planifica
*/
public bool configura_ops_geo(Limpieza limp, int modo)
{
string str;
string modo_str="";
int r = 0;
if ((limp.tipo_tto < 0) || (limp.tipo_tto >= (int)LimpiezaDef.TiposTto.TtoN))
return false;
if (limp.rest_circ[(int)limp.tipo_tto])
r=1; //restricción de circulación
if(modo==0)
modo_str = GeneralDef.SockConf;
else if(modo==1)
modo_str = GeneralDef.SockConfPlan;
//van ParamLimpN parámetros, sin incluir "CONFIGURACION", si se añaden, incrementar ParamLimpN
str = GeneralDef.EjecGeoParamSep + modo_str + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GL_tto + GeneralDef.EjecGeoParamIgual + limp.t_tto + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GL_res + GeneralDef.EjecGeoParamIgual + r + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GL_uto + GeneralDef.EjecGeoParamIgual + (int)limp.uds_t_tto + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GL_vdp + GeneralDef.EjecGeoParamIgual + limp.v_despl + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_tco + GeneralDef.EjecGeoParamIgual + limp.t_conv + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_tdc + GeneralDef.EjecGeoParamIgual + limp.t_descan + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GL_tdp + GeneralDef.EjecGeoParamIgual + limp.t_despl_insta + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GL_tca + GeneralDef.EjecGeoParamIgual + limp.t_descarg + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_hini + GeneralDef.EjecGeoParamIgual + limp.h_ini + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_trafic + GeneralDef.EjecGeoParamIgual + limp.trafico + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_npt + GeneralDef.EjecGeoParamIgual + limp.n_ptsctrl + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_sec + GeneralDef.EjecGeoParamIgual + limp.n_secdef + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GL_anc + GeneralDef.EjecGeoParamIgual + limp.ancho_via + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_coox + GeneralDef.EjecGeoParamIgual + limp.coords_instala[0] + " " +//coordenadas
GeneralDef.EjecGeoParamSep + GeneralDef.GG_cooy + GeneralDef.EjecGeoParamIgual + limp.coords_instala[1] + " " +//coordenadas
GeneralDef.EjecGeoParamSep + GeneralDef.GG_ais + GeneralDef.EjecGeoParamIgual + limp.aislados + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_pd + GeneralDef.EjecGeoParamIgual + OliviaGlob.Paths.PathData + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_pn + GeneralDef.EjecGeoParamIgual + OliviaGlob.Paths.PathNW + " ";
base.str_cfg = str;
return true;
}
}
}

112
OliviaAddIn/EjecutaReco.cs Normal file
View File

@ -0,0 +1,112 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OliviaDef;
namespace OliviaAddIn
{
class EjecutaReco : Ejecuta
{
//*************************************************************************************
//Variables
public Recogida reco;
//*************************************************************************************
//Métodos
public EjecutaReco()
{
err_str = "";
}
/**
* Comienza las funciones de ejecución
* modo 0 la primera vez, va a sectorizar, modo 1 la segunda vez, planifica
*/
public bool ejec(Recogida reco, int modo)
{
if (reco == null)
{
err_str = "Error en la recopilación de datos para el procesado";
return false;
}
OliviaGlob.tip_oliv = OliviaDef.GeneralDef.TiposOliv.OlivResi;
if (!OliviaGlob.gdb_reco.exporta(reco, modo == (int)Ejecuta.ModosEjec.Planif))
{
err_str = OliviaGlob.gdb_reco.err_st;
return false;
}
//configura el string de opciones
if (!configura_ops_geo(reco, modo))
{
err_str = "Error al configurar opciones";
return false;
}
this.reco = reco;
//Llama al ejecuta del padre
return base.ejec();
}
/**
* Configura el str de opciones que va a mandar a geofoto
* modo 0 la primera vez, va a sectorizar, modo 1 la segunda vez, planifica
*/
public bool configura_ops_geo(Recogida reco, int modo)
{
string str, modo_str = "";
if (modo == (int)ModosEjec.Secto)
modo_str = GeneralDef.SockConf;
else if (modo == (int)ModosEjec.Planif)
modo_str = GeneralDef.SockConfPlan;
else if (modo == (int)ModosEjec.SoloPlanif)
modo_str = GeneralDef.SockConfTodo;
//van ParamLimpN parámetros, sin incluir "CONFIGURACION", si se añaden, incrementar ParamLimpN
str = GeneralDef.EjecGeoParamSep + modo_str + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GR_camp_cap + GeneralDef.EjecGeoParamIgual + reco.rec_capac + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GR_kgM + GeneralDef.EjecGeoParamIgual + reco.carg_max_vehic + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GR_camp_kgrec + GeneralDef.EjecGeoParamIgual + reco.rec_kg + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GR_camp_uds + GeneralDef.EjecGeoParamIgual + reco.rec_uds + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GR_kgrecog + GeneralDef.EjecGeoParamIgual + reco.rec_kgrec_cont + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GR_carga_cont + GeneralDef.EjecGeoParamIgual + reco.carga_max + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GR_dens + GeneralDef.EjecGeoParamIgual + reco.dens_cont + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_tco + GeneralDef.EjecGeoParamIgual + reco.t_conv + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_tdc + GeneralDef.EjecGeoParamIgual + reco.t_descan + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GR_tvc + GeneralDef.EjecGeoParamIgual + reco.t_vaci + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GR_tdca + GeneralDef.EjecGeoParamIgual + reco.t_descarg + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GR_tsal + GeneralDef.EjecGeoParamIgual + reco.t_despl_insta + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_hini + GeneralDef.EjecGeoParamIgual + reco.h_ini + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_trafic + GeneralDef.EjecGeoParamIgual + reco.trafico + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_npt + GeneralDef.EjecGeoParamIgual + reco.n_ptsctrl + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_sec + GeneralDef.EjecGeoParamIgual + reco.n_secdef + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GR_anc + GeneralDef.EjecGeoParamIgual + reco.anch_vehic + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GR_gir + GeneralDef.EjecGeoParamIgual + reco.giro_vehic + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_coox + GeneralDef.EjecGeoParamIgual + reco.coords_instala[0] + " " +//coordenadas
GeneralDef.EjecGeoParamSep + GeneralDef.GG_cooy + GeneralDef.EjecGeoParamIgual + reco.coords_instala[1] + " " +//coordenadas
GeneralDef.EjecGeoParamSep + GeneralDef.GR_descx + GeneralDef.EjecGeoParamIgual + reco.coords_descarg[0] + " " +//coordenadas
GeneralDef.EjecGeoParamSep + GeneralDef.GR_descy + GeneralDef.EjecGeoParamIgual + reco.coords_descarg[1] + " " +//coordenadas
GeneralDef.EjecGeoParamSep + GeneralDef.GR_sens_id + GeneralDef.EjecGeoParamIgual + reco.id_sens + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GR_sens_url + GeneralDef.EjecGeoParamIgual + reco.url_sens + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GR_sens_fecha + GeneralDef.EjecGeoParamIgual + reco.fecha_sens + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GR_sens_fechaf + GeneralDef.EjecGeoParamIgual + reco.fechaf_sens + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GR_sens_modo + GeneralDef.EjecGeoParamIgual + reco.media + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_ais + GeneralDef.EjecGeoParamIgual + reco.aislados + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GR_lateral + GeneralDef.EjecGeoParamIgual + reco.lateralidad + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_pd + GeneralDef.EjecGeoParamIgual + OliviaGlob.Paths.PathData + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_pn + GeneralDef.EjecGeoParamIgual + OliviaGlob.Paths.PathNW + " ";
base.str_cfg = str;
return true;
}
}
}

109
OliviaAddIn/FormCampos.Designer.cs generated Normal file
View File

@ -0,0 +1,109 @@
namespace OliviaAddIn
{
partial class FormCampos
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormCampos));
this.propertyGrid = new System.Windows.Forms.PropertyGrid();
this.button_reset = new System.Windows.Forms.Button();
this.btn_acept = new System.Windows.Forms.Button();
this.button_guardar = new System.Windows.Forms.Button();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.SuspendLayout();
//
// propertyGrid
//
this.propertyGrid.LineColor = System.Drawing.SystemColors.ControlDark;
this.propertyGrid.Location = new System.Drawing.Point(12, 12);
this.propertyGrid.Name = "propertyGrid";
this.propertyGrid.PropertySort = System.Windows.Forms.PropertySort.Categorized;
this.propertyGrid.Size = new System.Drawing.Size(268, 249);
this.propertyGrid.TabIndex = 0;
this.propertyGrid.ToolbarVisible = false;
//
// button_reset
//
this.button_reset.Font = new System.Drawing.Font("Microsoft Sans Serif", 6F);
this.button_reset.Location = new System.Drawing.Point(12, 276);
this.button_reset.Name = "button_reset";
this.button_reset.Size = new System.Drawing.Size(40, 23);
this.button_reset.TabIndex = 1;
this.button_reset.Text = "Reset";
this.button_reset.UseVisualStyleBackColor = true;
this.button_reset.Click += new System.EventHandler(this.button_reset_Click);
//
// btn_acept
//
this.btn_acept.Location = new System.Drawing.Point(205, 276);
this.btn_acept.Name = "btn_acept";
this.btn_acept.Size = new System.Drawing.Size(75, 23);
this.btn_acept.TabIndex = 2;
this.btn_acept.Text = "Aceptar";
this.btn_acept.UseVisualStyleBackColor = true;
this.btn_acept.Click += new System.EventHandler(this.btn_acept_Click);
//
// button_guardar
//
this.button_guardar.Location = new System.Drawing.Point(124, 276);
this.button_guardar.Name = "button_guardar";
this.button_guardar.Size = new System.Drawing.Size(75, 23);
this.button_guardar.TabIndex = 3;
this.button_guardar.Text = "Guardar";
this.toolTip1.SetToolTip(this.button_guardar, "Guardar cambios en los campos y atributos en el archivo de configuración");
this.button_guardar.UseVisualStyleBackColor = true;
this.button_guardar.Click += new System.EventHandler(this.button_guardar_Click);
//
// FormCampos
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(292, 309);
this.Controls.Add(this.button_guardar);
this.Controls.Add(this.btn_acept);
this.Controls.Add(this.button_reset);
this.Controls.Add(this.propertyGrid);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "FormCampos";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Campos a leer";
this.TopMost = true;
this.Resize += new System.EventHandler(this.FormCampos_Resize);
this.ResumeLayout(false);
}
#endregion
public System.Windows.Forms.PropertyGrid propertyGrid;
private System.Windows.Forms.Button button_reset;
private System.Windows.Forms.Button btn_acept;
private System.Windows.Forms.Button button_guardar;
private System.Windows.Forms.ToolTip toolTip1;
}
}

117
OliviaAddIn/FormCampos.cs Normal file
View File

@ -0,0 +1,117 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Design;
using System.Windows.Forms.Design;
namespace OliviaAddIn
{
public partial class FormCampos : Form
{
//////////////////////////////////////////////////////////////
//variables para los botones
int top_buttons;
int bottom_props;
int right_props;
//////////////////////////////////////////////////////////////
/**
* Clase para el tipo combo Sí/No de las propiedades
*/
public class Prop_si_no : TypeConverter
{
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
{
if (sourceType == typeof(string))
return true;
return base.CanConvertFrom(context, sourceType);
}
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
if (destinationType == typeof(string))
return true;
return base.CanConvertTo(context, destinationType);
}
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
{
if (value.GetType() == typeof(string))
{
if (((string)value).ToLower() == "si")
return true;
if (((string)value).ToLower() == "no")
return false;
throw new Exception("Values must be \"Yes\" or \"No\"");
}
return base.ConvertFrom(context, culture, value);
}
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(string))
{
if (value == null)
return false;
else
return (((bool)value) ? "Si" : "No");
}
return base.ConvertTo(context, culture, value, destinationType);
}
public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
{
return true;
}
public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
{
bool[] bools = new bool[] { true, false };
System.ComponentModel.TypeConverter.StandardValuesCollection svc = new System.ComponentModel.TypeConverter.StandardValuesCollection(bools);
return svc;
}
}
public FormCampos()
{
InitializeComponent();
top_buttons = ClientSize.Height - button_guardar.Top;
bottom_props = ClientSize.Height - propertyGrid.Bottom;
right_props = ClientSize.Width - propertyGrid.Right;
}
protected virtual void button_guardar_Click(object sender, EventArgs e)
{
string err_str;
if (!OliviaGlob.guarda_ini_gen(out err_str))
{
MessageBox.Show(err_str, "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
protected virtual void btn_acept_Click(object sender, EventArgs e)
{
}
protected virtual void button_reset_Click(object sender, EventArgs e)
{
}
private void FormCampos_Resize(object sender, EventArgs e)
{
//mover button_aceptar, button_reset, button_guardar, bottom del property
button_guardar.Top = ClientSize.Height - top_buttons;
button_reset.Top = ClientSize.Height - top_buttons;
btn_acept.Top = ClientSize.Height - top_buttons;
propertyGrid.Size = new Size(ClientSize.Width - right_props, ClientSize.Height - bottom_props);
}
}
}

148
OliviaAddIn/FormCampos.resx Normal file
View File

@ -0,0 +1,148 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAEBAAAAAAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAAAAAAAAAAAAAAAAAAAAA
AAD///8B////Af///wH///8BOoFqBTqBamE6gWq9OoFq7zqBapU6gWq9OoFqvzqBamM6gWoF////Af//
/wH///8B////Af///wH///8BOoFqJTqBatE6gWr/OoFq/zqBav86gWqTOoFq9TqBav86gWr/OoFq0zqB
ain///8B////Af///wH///8BOoFqJTqBaus6gWr/OoFq/zqBav86gWr9OoFqqzqBauk6gWr9OoFq/zqB
av86gWrrOoFqJ////wH///8BOoFqAzqBas86gWr7OoFqzTqBaqk6gWqtOoFqYzqBask6gWpJOoFqXTqB
ass6gWr7OoFq/zqBatE6gWoF////ATqBalc6gWrpOoFq4zqBap86gWoNOoFqCzqBanM6gWrROoFqqzqB
ajk6gWoNOoFqezqBavk6gWr/OoFqW////wE6gWq1OoFqpTqBats6gWp7OoFqOzqBahs6gWrxOoFq8zqB
av86gWqVOoFqFTqBanM6gWqJOoFq0TqBarf///8BOoFq6zqBal86gWqFOoFqezqBais6gWpHOoFq8TqB
av86gWr/OoFqdTqBaj86gWopOoFqhTqBask6gWqF////ATqBauM6gWo1OoFqHzqBamX///8BOoFqiTqB
av86gWrhOoFq/zqBal////8BOoFqYTqBaok6gWrhOoFq/////wE6gWpFOoFqFzqBakU6gWov////ATqB
apk6gWr/OoFq8TqBav86gWrbOoFqE////wE6gWpVOoFqtzqBapv///8BOoFqeTqBaos6gWpj////Af//
/wE6gWpXOoFq+zqBav86gWr/OoFq3TqBahE6gWozOoFqiTqBauU6gWol////ATqBaj86gWoV////Af//
/wH///8BOoFqfTqBaus6gWr3OoFq9zqBajs6gWo7OoFqczqBat86gWphOoFqA////wH///8B////Af//
/wH///8B////ATqBapM6gWr/OoFq/zqBav86gWpbOoFqSTqBatM6gWqVOoFqeTqBahP///8B////Af//
/wH///8B////Af///wE6gWofOoFq1zqBav86gWr/OoFqff///wH///8B////Af///wH///8B////Af//
/wH///8B////Af///wH///8B////ATqBark6gWr/OoFqwzqBagf///8B////Af///wH///8B////Af//
/wH///8B////Af///wH///8B////Af///wE6gWo3OoFq6zqBaiP///8B////Af///wH///8B////Af//
/wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
/wH///8BAAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA
//8AAP//AAD//w==
</value>
</data>
</root>

1322
OliviaAddIn/FunGDB.cs Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 473 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 657 KiB

BIN
OliviaAddIn/Images/Map.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
OliviaAddIn/Images/Map2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

BIN
OliviaAddIn/Images/back.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 856 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
OliviaAddIn/Images/mapa.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
OliviaAddIn/Images/plan.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

BIN
OliviaAddIn/Images/play.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 671 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 473 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 657 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 522 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 848 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 856 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 671 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 848 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 B

BIN
OliviaAddIn/Images/sand.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

BIN
OliviaAddIn/Images/save.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 897 B

158
OliviaAddIn/InicioDlg.Designer.cs generated Normal file
View File

@ -0,0 +1,158 @@
namespace OliviaAddIn
{
partial class InicioDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InicioDlg));
this.button_maqueta = new System.Windows.Forms.Button();
this.button_resi = new System.Windows.Forms.Button();
this.button_limp = new System.Windows.Forms.Button();
this.button_gdb = new System.Windows.Forms.Button();
this.button_nw = new System.Windows.Forms.Button();
this.btn_help = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button_maqueta
//
this.button_maqueta.Font = new System.Drawing.Font("Calibri", 10F);
this.button_maqueta.Image = global::OliviaAddIn.Properties.Resources.Wooden_Map;
this.button_maqueta.Location = new System.Drawing.Point(445, 33);
this.button_maqueta.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.button_maqueta.Name = "button_maqueta";
this.button_maqueta.Size = new System.Drawing.Size(165, 85);
this.button_maqueta.TabIndex = 6;
this.button_maqueta.Text = "Maquetación de Datos";
this.button_maqueta.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
this.button_maqueta.UseVisualStyleBackColor = true;
this.button_maqueta.Click += new System.EventHandler(this.button_maqueta_Click);
//
// button_resi
//
this.button_resi.Font = new System.Drawing.Font("Calibri", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button_resi.Image = global::OliviaAddIn.Properties.Resources.contenedor;
this.button_resi.Location = new System.Drawing.Point(229, 33);
this.button_resi.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.button_resi.Name = "button_resi";
this.button_resi.Size = new System.Drawing.Size(165, 85);
this.button_resi.TabIndex = 1;
this.button_resi.Text = "Recogida de Residuos ";
this.button_resi.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
this.button_resi.UseVisualStyleBackColor = true;
this.button_resi.Click += new System.EventHandler(this.button_resi_Click);
//
// button_limp
//
this.button_limp.BackColor = System.Drawing.SystemColors.Control;
this.button_limp.Font = new System.Drawing.Font("Calibri", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button_limp.Image = global::OliviaAddIn.Properties.Resources.carrito;
this.button_limp.Location = new System.Drawing.Point(14, 33);
this.button_limp.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.button_limp.Name = "button_limp";
this.button_limp.Size = new System.Drawing.Size(165, 85);
this.button_limp.TabIndex = 0;
this.button_limp.Text = "Limpieza Viaria";
this.button_limp.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
this.button_limp.UseVisualStyleBackColor = true;
this.button_limp.Click += new System.EventHandler(this.button_limp_Click);
//
// button_gdb
//
this.button_gdb.AutoSize = true;
this.button_gdb.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.button_gdb.Image = global::OliviaAddIn.Properties.Resources.folder_gdb;
this.button_gdb.Location = new System.Drawing.Point(14, 133);
this.button_gdb.Name = "button_gdb";
this.button_gdb.Size = new System.Drawing.Size(115, 23);
this.button_gdb.TabIndex = 7;
this.button_gdb.Text = "Seleccionar GDB";
this.button_gdb.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
this.button_gdb.UseVisualStyleBackColor = true;
this.button_gdb.Click += new System.EventHandler(this.button_gdb_Click);
//
// button_nw
//
this.button_nw.AutoSize = true;
this.button_nw.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.button_nw.Image = global::OliviaAddIn.Properties.Resources.folder_nw;
this.button_nw.Location = new System.Drawing.Point(14, 165);
this.button_nw.Name = "button_nw";
this.button_nw.Size = new System.Drawing.Size(114, 23);
this.button_nw.TabIndex = 8;
this.button_nw.Text = "Seleccionar NW ";
this.button_nw.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
this.button_nw.UseVisualStyleBackColor = true;
this.button_nw.Click += new System.EventHandler(this.button_nw_Click);
//
// btn_help
//
this.btn_help.Image = global::OliviaAddIn.Properties.Resources.system_help;
this.btn_help.Location = new System.Drawing.Point(581, 165);
this.btn_help.Name = "btn_help";
this.btn_help.Size = new System.Drawing.Size(29, 23);
this.btn_help.TabIndex = 9;
this.btn_help.UseVisualStyleBackColor = true;
this.btn_help.Click += new System.EventHandler(this.btn_help_Click);
//
// InicioDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.Control;
this.ClientSize = new System.Drawing.Size(627, 200);
this.Controls.Add(this.btn_help);
this.Controls.Add(this.button_nw);
this.Controls.Add(this.button_gdb);
this.Controls.Add(this.button_maqueta);
this.Controls.Add(this.button_resi);
this.Controls.Add(this.button_limp);
this.Cursor = System.Windows.Forms.Cursors.Default;
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.MaximizeBox = false;
this.Name = "InicioDlg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "OLIVIA | Inicio";
this.TopMost = true;
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.InicioDlg_FormClosed);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button button_limp;
private System.Windows.Forms.Button button_resi;
private System.Windows.Forms.Button button_maqueta;
private System.Windows.Forms.Button button_gdb;
private System.Windows.Forms.Button button_nw;
private System.Windows.Forms.Button btn_help;
}
}

312
OliviaAddIn/InicioDlg.cs Normal file
View File

@ -0,0 +1,312 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SisNetBase;
using OliviaDef;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.DataSourcesGDB;
using System.IO;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Controls;
using ESRI.ArcGIS.Display;
using ESRI.ArcGIS.ADF.COMSupport;
using ESRI.ArcGIS.ADF;
using ESRI.ArcGIS.esriSystem;
using System.Runtime.InteropServices;
using ESRI.ArcGIS.DataSourcesFile;
using System.Diagnostics;
namespace OliviaAddIn
{
/**
* @file InicioDlg.cs
* Clase de la ventana inicial de OLIVIA.
* Contiene el manejo de sus eventos como el Click o la actualización de su estado.
*/
/**
* Clase de la ventana inicial de OLIVIA.
* Contiene el manejo de sus eventos como el Click o la actualización de su estado.
*/
public partial class InicioDlg : Form
{
//Variables
/**
* Texto para cuando no se ha seleccionado GDB
*/
string text_selec_gdb = "Seleccionar GDB";
/**
* Texto para cuando sí se ha seleccionado GDB
*/
string text_si_gdb = "GDB : ";
/**
* Texto para cuando no se ha seleccionado nw
*/
string text_selec_nw = "Seleccionar NW ";
/**
* Texto para cuando sí se ha seleccionado nw
*/
string text_si_nw = "Red Navegable : ";
/**
* Ventana de configuración de la limpieza viaria
*/
public LimpiezaDlg lim = null;
/**
* Ventana de configuración de la recogida de residuos
*/
public RecogidaDlg reco = null;
//*************************************************************************************
//Métodos
public InicioDlg()
{
try
{
Application.EnableVisualStyles();
InitializeComponent();
enable_buttons(false);
if (!Directory.Exists(OliviaGlob.Paths.PathGdbGen))
OliviaGlob.Paths.PathGdbGen = null;
if (!Directory.Exists(OliviaGlob.Paths.PathGdbNw))
OliviaGlob.Paths.PathGdbNw = null;
//si lee el archivo de configuracion y ya tiene paths asignados a las GDBs lo pone en los botones
if (OliviaGlob.Paths.PathGdbGen != null)
{
pon_text_bt_gdb();
}
if (OliviaGlob.Paths.PathGdbNw != null)
{
pon_text_bt_nw();
}
if (OliviaGlob.demo_id)
{
Point pto;
//si es modo demo para i+D, se quitan los botones menos el de limpieza y el de recogida
pto = button_gdb.Location;
pto.Y = pto.Y + button_gdb.Height;
button_nw.Location = pto;
Height = Height + button_nw.Height * 2;
Width = Width + 100;
}
}
catch (Exception)
{
MessageBox.Show("Error al iniciar la ventana de Inicio", "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
private void enable_buttons(bool en, bool gdb_tambien=false)
{
button_limp.Enabled = button_resi.Enabled = button_maqueta.Enabled = en;
if (gdb_tambien)
{
button_gdb.Enabled = en;
button_nw.Enabled = en;
}
}
//*************************************************************************************
//Eventos de elementos de la ventana
private void button_limp_Click(object sender, EventArgs e)
{
try
{
enable_buttons(false, true);
OliviaGlob.gdb_limp = new DatosGDBLimp();
OliviaGlob.gdb = (DatosGDB)OliviaGlob.gdb_limp;
//abre la ventana de configuración de limpieza
lim = new LimpiezaDlg();
Hide();
enable_buttons(true, true);
string err_str = "";
if (!OliviaGlob.guarda_ini_gen(out err_str))
{
MessageBox.Show(err_str, "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Error);
Close();
return;
}
lim.Show();
}
catch (Exception)
{
MessageBox.Show("Error al iniciar la ventana de Limpieza", "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
private void button_resi_Click(object sender, EventArgs e)
{
try
{
enable_buttons(false, true);
OliviaGlob.gdb_reco = new DatosGDBReco();
OliviaGlob.gdb = (DatosGDB)OliviaGlob.gdb_reco;
//abre la ventana de configuración de recogida
reco = new RecogidaDlg();
Hide();
enable_buttons(true, true);
string err_str = "";
if (!OliviaGlob.guarda_ini_gen(out err_str))
{
MessageBox.Show(err_str, "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Error);
Close();
return;
}
reco.Show();
}
catch (Exception)
{
MessageBox.Show("Error al iniciar la ventana de Recogida", "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
private void InicioDlg_FormClosed(object sender, FormClosedEventArgs e)
{
OliviaGlob.ya_open_app = false;
if (OliviaGlob.demo_id)
return;
//borra los archivos al terminar...
OliviaGlob.borra_files();
}
private void button_maqueta_Click(object sender, EventArgs e)
{
try
{
Hide();
OliviaGlob.gdb = new DatosGDB();
if (!OliviaGlob.mapa.maqueta(this.Handle))
{
MessageBox.Show(OliviaGlob.mapa.err_str, "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Error);
Close();
return;
}
Close();//cierro el dialogo de inicio
}
catch (Exception)
{
MessageBox.Show("Error al iniciar la ventana de Maquetación", "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
/**
* Permite seleccionar una GDB que contenga los ámbitos sobre los que se realizará la sectorización.
*/
private void button_gdb_Click(object sender, EventArgs e)
{
IWorkspace ws = null;
try
{
string text_reint = "¿Desea cancelar el proceso?";
ws = FunGDB.selec_gdb("Seleccionar GDB de trabajo", this.Handle.ToInt32(), text_reint);
if (ws != null)
{
//pone path y quita bordes e imagen
OliviaGlob.Paths.PathGdbGen = ws.PathName;
pon_text_bt_gdb();
}
else
{
//quita path y pone bordes e imagen
button_gdb.Text = text_selec_gdb;
button_gdb.Image = global::OliviaAddIn.Properties.Resources.folder_gdb;
enable_buttons(false);
}
}
catch (Exception)
{
return;
}
}
/**
* Permite seleccionar una GDB que contenga la red navegable sobre la que se realizará el cálculo de rutas óptimas.
*/
private void button_nw_Click(object sender, EventArgs e)
{
IWorkspace ws = null;
try
{
string text_reint = "¿Desea cancelar el proceso?";
ws = FunGDB.selec_gdb("Seleccionar la red navegable", this.Handle.ToInt32(), text_reint);
if (ws != null)
{
//pone path y quita bordes e imagen
OliviaGlob.Paths.PathGdbNw = ws.PathName;
pon_text_bt_nw();
}
else
{
//quita path y pone bordes e imagen
button_nw.Text = text_selec_nw;
button_nw.Image = global::OliviaAddIn.Properties.Resources.folder_nw;
enable_buttons(false);
}
}
catch (Exception)
{
return;
}
}
/*private void InicioDlg_VisibleChanged(object sender, EventArgs e)
{
int a = 5;
}*/
/**
* Cuando se picnha en el botón de ayuda se abre el manual de Olivia
*/
private void btn_help_Click(object sender, EventArgs e)
{
string[] archivos = null;
try
{
archivos = Directory.GetFiles(OliviaGlob.Paths.PathWork, OliviaGlob.manual + ".pdf");
if (archivos.Length <= 0)
MessageBox.Show("No se encuentra el archivo " + OliviaGlob.manual + ".pdf en la ubicación " + OliviaGlob.Paths.PathWork, "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Error);
foreach (string f in archivos)
{
Process.Start(f);
}
}
catch (Exception)
{
MessageBox.Show("Error al abrir el manual de ayuda " + OliviaGlob.manual + ".pdf", "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
private void pon_text_bt_gdb()
{
button_gdb.Text = text_si_gdb + OliviaGlob.Paths.PathGdbGen;
button_gdb.Image = null;
if (button_nw.Text != text_selec_nw)
enable_buttons(true);
}
private void pon_text_bt_nw()
{
button_nw.Text = text_si_nw + OliviaGlob.Paths.PathGdbNw;
button_nw.Image = null;
if (button_gdb.Text != text_selec_gdb)
enable_buttons(true);
}
}
}

145
OliviaAddIn/InicioDlg.resx Normal file
View File

@ -0,0 +1,145 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAEBAAAAAAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAAAAAAAAAAAAAAAAAAAAA
AAD///8B////Af///wH///8BOoFqBTqBamE6gWq9OoFq7zqBapU6gWq9OoFqvzqBamM6gWoF////Af//
/wH///8B////Af///wH///8BOoFqJTqBatE6gWr/OoFq/zqBav86gWqTOoFq9TqBav86gWr/OoFq0zqB
ain///8B////Af///wH///8BOoFqJTqBaus6gWr/OoFq/zqBav86gWr9OoFqqzqBauk6gWr9OoFq/zqB
av86gWrrOoFqJ////wH///8BOoFqAzqBas86gWr7OoFqzTqBaqk6gWqtOoFqYzqBask6gWpJOoFqXTqB
ass6gWr7OoFq/zqBatE6gWoF////ATqBalc6gWrpOoFq4zqBap86gWoNOoFqCzqBanM6gWrROoFqqzqB
ajk6gWoNOoFqezqBavk6gWr/OoFqW////wE6gWq1OoFqpTqBats6gWp7OoFqOzqBahs6gWrxOoFq8zqB
av86gWqVOoFqFTqBanM6gWqJOoFq0TqBarf///8BOoFq6zqBal86gWqFOoFqezqBais6gWpHOoFq8TqB
av86gWr/OoFqdTqBaj86gWopOoFqhTqBask6gWqF////ATqBauM6gWo1OoFqHzqBamX///8BOoFqiTqB
av86gWrhOoFq/zqBal////8BOoFqYTqBaok6gWrhOoFq/////wE6gWpFOoFqFzqBakU6gWov////ATqB
apk6gWr/OoFq8TqBav86gWrbOoFqE////wE6gWpVOoFqtzqBapv///8BOoFqeTqBaos6gWpj////Af//
/wE6gWpXOoFq+zqBav86gWr/OoFq3TqBahE6gWozOoFqiTqBauU6gWol////ATqBaj86gWoV////Af//
/wH///8BOoFqfTqBaus6gWr3OoFq9zqBajs6gWo7OoFqczqBat86gWphOoFqA////wH///8B////Af//
/wH///8B////ATqBapM6gWr/OoFq/zqBav86gWpbOoFqSTqBatM6gWqVOoFqeTqBahP///8B////Af//
/wH///8B////Af///wE6gWofOoFq1zqBav86gWr/OoFqff///wH///8B////Af///wH///8B////Af//
/wH///8B////Af///wH///8B////ATqBark6gWr/OoFqwzqBagf///8B////Af///wH///8B////Af//
/wH///8B////Af///wH///8B////Af///wE6gWo3OoFq6zqBaiP///8B////Af///wH///8B////Af//
/wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
/wH///8BAAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA
//8AAP//AAD//w==
</value>
</data>
</root>

200
OliviaAddIn/LimpCampos.cs Normal file
View File

@ -0,0 +1,200 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Design;
using System.Windows.Forms.Design;
namespace OliviaAddIn
{
public class LimpCampos : FormCampos
{
/**
* @file RecoCampos.cs
* Archivo de la clase ventana para la edición de los campos a leer en la planificación de recogida de residuos
*/
/**
* Clase ventana para la edición de los campos a leer en la planificación de recogida de residuos
*/
Limpieza limp = null;
////////////////////////////////////////////
/**
* Clase para la estructura de propiedades
*/
public class LimpCamposProps
{
[DisplayNameAttribute("Nombre entidad")]
[DescriptionAttribute("Campo donde leer el nombre de la entidad.")]
[Category("Campos")]
public string camp_nom_tipo_ent
{
get { return LimpiezaDef.Campos.consulta_entidad; }
set { LimpiezaDef.Campos.consulta_entidad = value; }
}
[DisplayNameAttribute("Mecanizable")]
[DescriptionAttribute("Campo donde leer si la entidad es mecanizable.")]
[Category("Campos")]
public string camp_mecaniz
{
get { return LimpiezaDef.Campos.consulta_mecan; }
set { LimpiezaDef.Campos.consulta_mecan = value; }
}
////////////////////////////////////////////
//Atributos
[DisplayNameAttribute("Bordillos libres")]
[DescriptionAttribute("Atributo a consultar para los Bordillos libres.")]
[Category("Atributos")]
public string atr_bord
{
get { return LimpiezaDef.Atributos.atr_bord; }
set { LimpiezaDef.Atributos.atr_bord = value; }
}
[DisplayNameAttribute("Bandas de Aparcamiento")]
[DescriptionAttribute("Atributo a consultar para las Bandas de Aparcamiento.")]
[Category("Atributos")]
public string atr_aparc
{
get { return LimpiezaDef.Atributos.atr_aparc; }
set { LimpiezaDef.Atributos.atr_aparc = value; }
}
[DisplayNameAttribute("Aceras")]
[DescriptionAttribute("Atributo a consultar para las Aceras.")]
[Category("Atributos")]
public string atr_acera
{
get { return LimpiezaDef.Atributos.atr_acera; }
set { LimpiezaDef.Atributos.atr_acera = value; }
}
[DisplayNameAttribute("Peatonales")]
[DescriptionAttribute("Atributo a consultar para las Peatonales.")]
[Category("Atributos")]
public string atr_peat
{
get { return LimpiezaDef.Atributos.atr_peat; }
set { LimpiezaDef.Atributos.atr_peat = value; }
}
[DisplayNameAttribute("Caida de Hoja")]
[DescriptionAttribute("Atributo a consultar para la Caida de Hoja.")]
[Category("Atributos")]
public string atr_hoja
{
get { return LimpiezaDef.Atributos.atr_hoja; }
set { LimpiezaDef.Atributos.atr_hoja = value; }
}
[DisplayNameAttribute("Zonas Infantiles")]
[DescriptionAttribute("Atributo a consultar para las Zonas Infantiles.")]
[Category("Atributos")]
public string atr_infan
{
get { return LimpiezaDef.Atributos.atr_infan; }
set { LimpiezaDef.Atributos.atr_infan = value; }
}
[DisplayNameAttribute("Papeleras")]
[DescriptionAttribute("Atributo a consultar para las Papeleras.")]
[Category("Atributos")]
public string atr_pape
{
get { return LimpiezaDef.Atributos.atr_pape; }
set { LimpiezaDef.Atributos.atr_pape = value; }
}
[DisplayNameAttribute("Pipicanes")]
[DescriptionAttribute("Atributo a consultar para los Pipicanes.")]
[Category("Atributos")]
public string atr_pipi
{
get { return LimpiezaDef.Atributos.atr_pipi; }
set { LimpiezaDef.Atributos.atr_pipi = value; }
}
[DisplayNameAttribute("Sanecanes")]
[DescriptionAttribute("Atributo a consultar para los Sanecanes.")]
[Category("Atributos")]
public string atr_sane
{
get { return LimpiezaDef.Atributos.atr_sane; }
set { LimpiezaDef.Atributos.atr_sane = value; }
}
}
////////////////////////////////////////////////////
public LimpCamposProps props;
public LimpCampos(Limpieza limp)
{
props = new LimpCamposProps();
Text = "Campos de la capa de Limpieza";
reinicia();
propertyGrid.SelectedObject = props;
this.limp = limp;
}
private void reinicia()
{
props.camp_nom_tipo_ent = LimpiezaDef.Campos.consulta_entidad;
props.camp_mecaniz = LimpiezaDef.Campos.consulta_mecan;
props.atr_bord = LimpiezaDef.Atributos.atr_bord;
props.atr_aparc = LimpiezaDef.Atributos.atr_aparc;
props.atr_acera = LimpiezaDef.Atributos.atr_acera;
props.atr_peat = LimpiezaDef.Atributos.atr_peat;
props.atr_hoja = LimpiezaDef.Atributos.atr_hoja;
props.atr_infan = LimpiezaDef.Atributos.atr_infan;
props.atr_pape = LimpiezaDef.Atributos.atr_pape;
props.atr_pipi = LimpiezaDef.Atributos.atr_pipi;
props.atr_sane = LimpiezaDef.Atributos.atr_sane;
}
protected override void button_reset_Click(object sender, EventArgs e)
{
reinicia();
propertyGrid.Refresh();
}
/*
* Se validan los campos modificados y se guarda en memoria los nombres de los nuevos campos.
*/
protected override void btn_acept_Click(object sender, EventArgs e)
{
LimpiezaDef.Campos.consulta_entidad = props.camp_nom_tipo_ent;
LimpiezaDef.Campos.consulta_mecan = props.camp_mecaniz;
LimpiezaDef.Atributos.atr_bord = props.atr_bord;
LimpiezaDef.Atributos.atr_aparc = props.atr_aparc;
LimpiezaDef.Atributos.atr_acera = props.atr_acera;
LimpiezaDef.Atributos.atr_peat = props.atr_peat;
LimpiezaDef.Atributos.atr_hoja = props.atr_hoja;
LimpiezaDef.Atributos.atr_infan = props.atr_infan;
LimpiezaDef.Atributos.atr_pape = props.atr_pape;
LimpiezaDef.Atributos.atr_pipi = props.atr_pipi;
LimpiezaDef.Atributos.atr_sane = props.atr_sane;
OliviaGlob.forma_filtros_limp();
DialogResult = DialogResult.OK;
base.Close();
}
private void InitializeComponent()
{
this.SuspendLayout();
//
// LimpCampos
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.ClientSize = new System.Drawing.Size(292, 309);
this.Name = "LimpCampos";
this.ResumeLayout(false);
}
protected override void button_guardar_Click(object sender, EventArgs e)
{
OliviaGlob.forma_filtros_limp();
base.button_guardar_Click(sender, e);
}
}
}

120
OliviaAddIn/LimpCampos.resx Normal file
View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

388
OliviaAddIn/Limpieza.cs Normal file
View File

@ -0,0 +1,388 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OliviaDef;
using ESRI.ArcGIS.Geometry;
namespace OliviaAddIn
{
/**
* @file Limpieza.cs
* Clase de las variables asociadas a la limpieza viaria.
* Contiene definiciones, nombres de campos, y las opciones configuradas en la ventana.
*/
//*************************************************************************************
/**
* Clase de las variables asociadas a la limpieza viaria.
* Contiene definiciones, nombres de campos, y las opciones configuradas en la ventana.
*/
public class Limpieza : Comun
{
//*************************************************************************************
//Variables
/**
* Ámbitos de trabajo elegidos
*/
public bool[] amb_tra_sel = new bool[(int)LimpiezaDef.AmbitsTra.AmbN];
/**
* Texto cuando no se ha seleccionado capa de niveles
*/
public string text_selec_nive = "Capa de niveles";
/**
* Geometría que componen la selección de niveles, null si ninguno
*/
public IGeometry geom_niveles = null;
/**
* String que almacena qué niveles se han seleccionado
*/
public string text_niv = "";
//*************************************************************************************
/**
* Tipo de tratamiento elegidos
*/
public int tipo_tto = -1;
/**
* Ancho de vía, en metros
*/
public double ancho_via = LimpiezaDef.Parametros.ancho_via;
/**
* Tiempo de tratamiento, en minutos
*/
public double t_tto = 5;
/**
* Tipo de unidades del tiempo de tto
*/
public int uds_t_tto = (int)GeneralDef.OlvTiposTto.OlvTipTtoNoDef;
/**
* Velocidad de desplazamiento, en km/h. Si es 0, es determinada por la vía
*/
public double v_despl = 0;
/**
* Umbral predeterminado para la recogida de basuras
*/
public double umbral_basura = LimpiezaDef.Parametros.umbral_reco;
/**
* Matriz que da si los tratamientos tienen en cuenta las restricciones de circulación o no
*/
public bool[] rest_circ;
/**
* Matriz que da si los tratamientos tienen en cuenta las restricciones de circulación o no
*/
public bool[] t_carg_desc;
/**
* Indica si se ha marcado el checkbox para que se recojan únicamente aquellos contendores que superan un umbral de carga.
*/
public bool umbral_reco_conten = false;
/**
* Array que indica qué ámbitos tiene cada opción, mediante true en las posiciones de los ámbitos válidos
*/
public struct AmbsValOps
{
public bool[] ambs;
};
/**
* Definición de tipo para la matriz que da los ámbitos
* Donde hay n opciones y cada opción un array de booleanos que indican con true si esa opción tiene ese ámbito
*/
public struct AmbsVal
{
public int n_ops;
public AmbsValOps[] ambs_ops;
};
/**
* Matriz que da los ámbitos correspondientes a los tipos de tratamiento
*/
public AmbsVal[] ambs_val;
//*************************************************************************************
//Métodos
public Limpieza()
{
inicia_matr_amb();
inicia_matr_restr();
inicia_matr_carg_desc();
}
/**Devuelve el array de los ámbitos comunes y no comunes de las opciones de un tratamiento tto
* Es un array de longitud el número de ámbitos totales, con true en las posiciones en los que el ámbito sea común o
* no común en las opciones
*/
public bool[] dame_amb(int tto)
{
int i;
bool sig;
bool[] amb_com = new bool[(int)LimpiezaDef.AmbitsTra.AmbN];
for (int j = 0; j < (int)LimpiezaDef.AmbitsTra.AmbN; j++)
{
sig = false;
for (i = 0; i < ambs_val[tto].n_ops && !sig; i++)
{
if (ambs_val[tto].ambs_ops[i].ambs[j]) //con que encuentre uno true lo pone y pasa al siguiente
{
amb_com[j] = sig = true;
}
}
}
return amb_com;
}
/**
* Inicializa la matriz que da las restricciones de circulación de los tipos de tratamiento
*/
private void inicia_matr_restr()
{
rest_circ = new bool[(int)LimpiezaDef.TiposTto.TtoN];//se inician a false
rest_circ[(int)LimpiezaDef.TiposTto.TtoBarrMecCalz] = true;
rest_circ[(int)LimpiezaDef.TiposTto.TtoBarrMixAcYCalz] = true;
rest_circ[(int)LimpiezaDef.TiposTto.TtoBaldMecCalz] = true;
rest_circ[(int)LimpiezaDef.TiposTto.TtoBaldMixAcYCalz] = true;
rest_circ[(int)LimpiezaDef.TiposTto.TtoCaidaHoja] = true;
rest_circ[(int)LimpiezaDef.TiposTto.TtoPapeVaci] = true;
rest_circ[(int)LimpiezaDef.TiposTto.TtoPapeLimp] = true;
rest_circ[(int)LimpiezaDef.TiposTto.TtoLimpCont] = true;
rest_circ[(int)LimpiezaDef.TiposTto.TtoLimpZInf] = true;
rest_circ[(int)LimpiezaDef.TiposTto.TtoLimpPipi] = true;
rest_circ[(int)LimpiezaDef.TiposTto.TtoLimpSane] = true;
}
/**
* Inicializa la matriz que da los ámbitos correspondientes a los tipos de tratamiento
*/
private void inicia_matr_amb()
{
//crea la matriz
ambs_val = new AmbsVal[(int)LimpiezaDef.TiposTto.TtoN];
//va creando los arrays de cada elemento de la matriz correspondiente a un tipo de tratamiento
//Barrido manual
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMan].n_ops = 1;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMan].ambs_ops = new AmbsValOps[ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMan].n_ops];
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMan].ambs_ops[0].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMan].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbAceMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMan].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbAceNoMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMan].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbCallePeatMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMan].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbCallePeatNoMec] = true;
//Barrido manual de mantenimiento
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMant].n_ops = 1;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMant].ambs_ops = new AmbsValOps[ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMant].n_ops];
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMant].ambs_ops[0].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMant].ambs_ops[0].ambs = ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMan].ambs_ops[0].ambs;//igual que el manual
//igual que el manual
//Barrido manual motorizado
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMot].n_ops = 1;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMot].ambs_ops = new AmbsValOps[ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMot].n_ops];
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMot].ambs_ops[0].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMot].ambs_ops[0].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMot].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbAceMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMot].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbAceNoMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMot].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbCallePeatMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMot].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbCallePeatNoMec] = true;
//Barrido mecánico de calzadas
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMecCalz].n_ops = 1;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMecCalz].ambs_ops = new AmbsValOps[ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMecCalz].n_ops];
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMecCalz].ambs_ops[0].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMecCalz].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbBordLibreMec] = true;
//Barrido mecánico de aceras y calzadas peatonales
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMecAcYCalzP].n_ops = 1;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMecAcYCalzP].ambs_ops = new AmbsValOps[ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMecAcYCalzP].n_ops];
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMecAcYCalzP].ambs_ops[0].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMecAcYCalzP].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbAceMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMecAcYCalzP].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbCallePeatMec] = true;
//Barrido mixto de aceras y calzadas
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMixAcYCalz].n_ops = 4;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMixAcYCalz].ambs_ops = new AmbsValOps[ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMixAcYCalz].n_ops];
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMixAcYCalz].ambs_ops[0].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMixAcYCalz].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbBordAparc] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMixAcYCalz].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbAceNoMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMixAcYCalz].ambs_ops[1].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMixAcYCalz].ambs_ops[1].ambs[(int)LimpiezaDef.AmbitsTra.AmbBordAparc] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMixAcYCalz].ambs_ops[1].ambs[(int)LimpiezaDef.AmbitsTra.AmbAceMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMixAcYCalz].ambs_ops[1].ambs[(int)LimpiezaDef.AmbitsTra.AmbAceNoMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMixAcYCalz].ambs_ops[2].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMixAcYCalz].ambs_ops[2].ambs[(int)LimpiezaDef.AmbitsTra.AmbBordAparc] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMixAcYCalz].ambs_ops[2].ambs[(int)LimpiezaDef.AmbitsTra.AmbBordLibreMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMixAcYCalz].ambs_ops[2].ambs[(int)LimpiezaDef.AmbitsTra.AmbAceNoMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMixAcYCalz].ambs_ops[3].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMixAcYCalz].ambs_ops[3].ambs[(int)LimpiezaDef.AmbitsTra.AmbBordAparc] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMixAcYCalz].ambs_ops[3].ambs[(int)LimpiezaDef.AmbitsTra.AmbBordLibreMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMixAcYCalz].ambs_ops[3].ambs[(int)LimpiezaDef.AmbitsTra.AmbAceMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBarrMixAcYCalz].ambs_ops[3].ambs[(int)LimpiezaDef.AmbitsTra.AmbAceNoMec] = true;
//Baldeo manual
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMan].n_ops = 1;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMan].ambs_ops = new AmbsValOps[ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMan].n_ops];
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMan].ambs_ops[0].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMan].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbAceMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMan].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbCallePeatMec] = true;
//Baldeo mecánico de calzadas
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMecCalz].n_ops = 2;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMecCalz].ambs_ops = new AmbsValOps[ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMecCalz].n_ops];
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMecCalz].ambs_ops[0].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMecCalz].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbBordAparc] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMecCalz].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbBordLibreMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMecCalz].ambs_ops[1].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMecCalz].ambs_ops[1].ambs[(int)LimpiezaDef.AmbitsTra.AmbEjeCalle] = true;
//Baldeo mecánico de aceras y calzadas peatonales
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMecAcYCalzP].n_ops = 1;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMecAcYCalzP].ambs_ops = new AmbsValOps[ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMecAcYCalzP].n_ops];
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMecAcYCalzP].ambs_ops[0].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMecAcYCalzP].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbAceMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMecAcYCalzP].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbCallePeatMec] = true;
//Baldeo mixto de aceras y calzadas
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMixAcYCalz].n_ops = 4;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMixAcYCalz].ambs_ops = new AmbsValOps[ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMixAcYCalz].n_ops];
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMixAcYCalz].ambs_ops[0].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMixAcYCalz].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbBordAparc] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMixAcYCalz].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbAceNoMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMixAcYCalz].ambs_ops[1].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMixAcYCalz].ambs_ops[1].ambs[(int)LimpiezaDef.AmbitsTra.AmbBordAparc] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMixAcYCalz].ambs_ops[1].ambs[(int)LimpiezaDef.AmbitsTra.AmbAceMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMixAcYCalz].ambs_ops[1].ambs[(int)LimpiezaDef.AmbitsTra.AmbAceNoMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMixAcYCalz].ambs_ops[2].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMixAcYCalz].ambs_ops[2].ambs[(int)LimpiezaDef.AmbitsTra.AmbBordAparc] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMixAcYCalz].ambs_ops[2].ambs[(int)LimpiezaDef.AmbitsTra.AmbBordLibreMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMixAcYCalz].ambs_ops[2].ambs[(int)LimpiezaDef.AmbitsTra.AmbAceNoMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMixAcYCalz].ambs_ops[3].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMixAcYCalz].ambs_ops[3].ambs[(int)LimpiezaDef.AmbitsTra.AmbBordAparc] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMixAcYCalz].ambs_ops[3].ambs[(int)LimpiezaDef.AmbitsTra.AmbBordLibreMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMixAcYCalz].ambs_ops[3].ambs[(int)LimpiezaDef.AmbitsTra.AmbAceMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoBaldMixAcYCalz].ambs_ops[3].ambs[(int)LimpiezaDef.AmbitsTra.AmbAceNoMec] = true;
//Fregado mecánico de aceras y calzadas peatonales
ambs_val[(int)LimpiezaDef.TiposTto.TtoFregMecAcYCalzP].n_ops = 1;
ambs_val[(int)LimpiezaDef.TiposTto.TtoFregMecAcYCalzP].ambs_ops = new AmbsValOps[ambs_val[(int)LimpiezaDef.TiposTto.TtoFregMecAcYCalzP].n_ops];
ambs_val[(int)LimpiezaDef.TiposTto.TtoFregMecAcYCalzP].ambs_ops[0].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
ambs_val[(int)LimpiezaDef.TiposTto.TtoFregMecAcYCalzP].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbAceMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoFregMecAcYCalzP].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbCallePeatMec] = true;
//Caída de la hoja
ambs_val[(int)LimpiezaDef.TiposTto.TtoCaidaHoja].n_ops = 3;
ambs_val[(int)LimpiezaDef.TiposTto.TtoCaidaHoja].ambs_ops = new AmbsValOps[ambs_val[(int)LimpiezaDef.TiposTto.TtoCaidaHoja].n_ops];
ambs_val[(int)LimpiezaDef.TiposTto.TtoCaidaHoja].ambs_ops[0].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
//No están especififacadas las características de la opción 1 ?
ambs_val[(int)LimpiezaDef.TiposTto.TtoCaidaHoja].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbEjeCalle] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoCaidaHoja].ambs_ops[1].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
ambs_val[(int)LimpiezaDef.TiposTto.TtoCaidaHoja].ambs_ops[1].ambs[(int)LimpiezaDef.AmbitsTra.AmbBordAparc] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoCaidaHoja].ambs_ops[1].ambs[(int)LimpiezaDef.AmbitsTra.AmbBordLibreMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoCaidaHoja].ambs_ops[1].ambs[(int)LimpiezaDef.AmbitsTra.AmbAceNoMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoCaidaHoja].ambs_ops[2].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
ambs_val[(int)LimpiezaDef.TiposTto.TtoCaidaHoja].ambs_ops[2].ambs[(int)LimpiezaDef.AmbitsTra.AmbBordAparc] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoCaidaHoja].ambs_ops[2].ambs[(int)LimpiezaDef.AmbitsTra.AmbBordLibreMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoCaidaHoja].ambs_ops[2].ambs[(int)LimpiezaDef.AmbitsTra.AmbAceMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoCaidaHoja].ambs_ops[2].ambs[(int)LimpiezaDef.AmbitsTra.AmbAceNoMec] = true;
//Vaciado de papeleras
ambs_val[(int)LimpiezaDef.TiposTto.TtoPapeVaci].n_ops = 1;
ambs_val[(int)LimpiezaDef.TiposTto.TtoPapeVaci].ambs_ops = new AmbsValOps[ambs_val[(int)LimpiezaDef.TiposTto.TtoPapeVaci].n_ops];
ambs_val[(int)LimpiezaDef.TiposTto.TtoPapeVaci].ambs_ops[0].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
ambs_val[(int)LimpiezaDef.TiposTto.TtoPapeVaci].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbPape] = true;
//Limpieza de papeleras
ambs_val[(int)LimpiezaDef.TiposTto.TtoPapeLimp].n_ops = 1;
ambs_val[(int)LimpiezaDef.TiposTto.TtoPapeLimp].ambs_ops = new AmbsValOps[ambs_val[(int)LimpiezaDef.TiposTto.TtoPapeLimp].n_ops];
ambs_val[(int)LimpiezaDef.TiposTto.TtoPapeLimp].ambs_ops[0].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
ambs_val[(int)LimpiezaDef.TiposTto.TtoPapeLimp].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbPape] = true;
//Limpieza de ubicación de contenedores
ambs_val[(int)LimpiezaDef.TiposTto.TtoLimpCont].n_ops = 1;
ambs_val[(int)LimpiezaDef.TiposTto.TtoLimpCont].ambs_ops = new AmbsValOps[ambs_val[(int)LimpiezaDef.TiposTto.TtoLimpCont].n_ops];
ambs_val[(int)LimpiezaDef.TiposTto.TtoLimpCont].ambs_ops[0].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
ambs_val[(int)LimpiezaDef.TiposTto.TtoLimpCont].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbConte] = true;
//<Limpieza de zonas infantiles
ambs_val[(int)LimpiezaDef.TiposTto.TtoLimpZInf].n_ops = 1;
ambs_val[(int)LimpiezaDef.TiposTto.TtoLimpZInf].ambs_ops = new AmbsValOps[ambs_val[(int)LimpiezaDef.TiposTto.TtoLimpZInf].n_ops];
ambs_val[(int)LimpiezaDef.TiposTto.TtoLimpZInf].ambs_ops[0].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
ambs_val[(int)LimpiezaDef.TiposTto.TtoLimpZInf].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbZInf] = true;
//<Limpieza de pipicanes
ambs_val[(int)LimpiezaDef.TiposTto.TtoLimpPipi].n_ops = 1;
ambs_val[(int)LimpiezaDef.TiposTto.TtoLimpPipi].ambs_ops = new AmbsValOps[ambs_val[(int)LimpiezaDef.TiposTto.TtoLimpPipi].n_ops];
ambs_val[(int)LimpiezaDef.TiposTto.TtoLimpPipi].ambs_ops[0].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
ambs_val[(int)LimpiezaDef.TiposTto.TtoLimpPipi].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbPipi] = true;
//<Limpieza y reposición de sanecanes
ambs_val[(int)LimpiezaDef.TiposTto.TtoLimpSane].n_ops = 1;
ambs_val[(int)LimpiezaDef.TiposTto.TtoLimpSane].ambs_ops = new AmbsValOps[ambs_val[(int)LimpiezaDef.TiposTto.TtoLimpSane].n_ops];
ambs_val[(int)LimpiezaDef.TiposTto.TtoLimpSane].ambs_ops[0].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
ambs_val[(int)LimpiezaDef.TiposTto.TtoLimpSane].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbSane] = true;
//<Tratamiento personalizado
//se pone 3 opciones para generar el array de booleanos para poder elegir ambitos lienales, puntutales o eje de calle.
//realmente son opciones comunes a todos los tratamientos y no exclusivos de TtoCustom
//se aprovecha que está creado el array de booleanos para rellenar las opciones golobales a todos los tratamientos
ambs_val[(int)LimpiezaDef.TiposTto.TtoCustom].n_ops = 3;
ambs_val[(int)LimpiezaDef.TiposTto.TtoCustom].ambs_ops = new AmbsValOps[ambs_val[(int)LimpiezaDef.TiposTto.TtoCustom].n_ops];
ambs_val[(int)LimpiezaDef.TiposTto.TtoCustom].ambs_ops[0].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
ambs_val[(int)LimpiezaDef.TiposTto.TtoCustom].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbBordLibreMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoCustom].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbBordLibreNoMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoCustom].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbBordAparc] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoCustom].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbAceMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoCustom].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbAceNoMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoCustom].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbCallePeatMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoCustom].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbCallePeatNoMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoCustom].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbBordHojaMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoCustom].ambs_ops[0].ambs[(int)LimpiezaDef.AmbitsTra.AmbBordHojaNoMec] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoCustom].ambs_ops[1].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
ambs_val[(int)LimpiezaDef.TiposTto.TtoCustom].ambs_ops[1].ambs[(int)LimpiezaDef.AmbitsTra.AmbConte] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoCustom].ambs_ops[1].ambs[(int)LimpiezaDef.AmbitsTra.AmbPape] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoCustom].ambs_ops[1].ambs[(int)LimpiezaDef.AmbitsTra.AmbZInf] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoCustom].ambs_ops[1].ambs[(int)LimpiezaDef.AmbitsTra.AmbPipi] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoCustom].ambs_ops[1].ambs[(int)LimpiezaDef.AmbitsTra.AmbSane] = true;
ambs_val[(int)LimpiezaDef.TiposTto.TtoCustom].ambs_ops[2].ambs = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //se inicializa todo a false
ambs_val[(int)LimpiezaDef.TiposTto.TtoCustom].ambs_ops[2].ambs[(int)LimpiezaDef.AmbitsTra.AmbEjeCalle] = true;
}
/**
* Inicializa la matriz booleana que habilita o deshabilita el timechecker del tiempo de carga y descarga, dependiendo del tipo de tratamiento
*/
private void inicia_matr_carg_desc()
{
t_carg_desc = new bool[(int)LimpiezaDef.TiposTto.TtoN]; //se inician a false
t_carg_desc[(int)LimpiezaDef.TiposTto.TtoBarrMan] = false;
t_carg_desc[(int)LimpiezaDef.TiposTto.TtoBarrMant] = false;
t_carg_desc[(int)LimpiezaDef.TiposTto.TtoBarrMot] = true;
t_carg_desc[(int)LimpiezaDef.TiposTto.TtoBarrMecCalz] = true;
t_carg_desc[(int)LimpiezaDef.TiposTto.TtoBarrMecAcYCalzP] = true;
t_carg_desc[(int)LimpiezaDef.TiposTto.TtoBarrMixAcYCalz] = true;
t_carg_desc[(int)LimpiezaDef.TiposTto.TtoBaldMan] = true;
t_carg_desc[(int)LimpiezaDef.TiposTto.TtoBaldMecCalz] = true;
t_carg_desc[(int)LimpiezaDef.TiposTto.TtoBaldMecAcYCalzP] = true;
t_carg_desc[(int)LimpiezaDef.TiposTto.TtoBaldMixAcYCalz] = true;
t_carg_desc[(int)LimpiezaDef.TiposTto.TtoFregMecAcYCalzP] = true;
t_carg_desc[(int)LimpiezaDef.TiposTto.TtoCaidaHoja] = true;
t_carg_desc[(int)LimpiezaDef.TiposTto.TtoPapeVaci] = false;
t_carg_desc[(int)LimpiezaDef.TiposTto.TtoPapeLimp] = false;
t_carg_desc[(int)LimpiezaDef.TiposTto.TtoLimpCont] = false;
t_carg_desc[(int)LimpiezaDef.TiposTto.TtoLimpZInf] = false;
t_carg_desc[(int)LimpiezaDef.TiposTto.TtoLimpPipi] = false;
t_carg_desc[(int)LimpiezaDef.TiposTto.TtoLimpSane] = false;
t_carg_desc[(int)LimpiezaDef.TiposTto.TtoCustom] = true;
}
}
}

449
OliviaAddIn/LimpiezaDef.cs Normal file
View File

@ -0,0 +1,449 @@
using System;
/**
* @file LimpiezaDef.cs
* Clase con definiciones de limpieza comunes al proyecto Olivia y a Geofoto.
*/
/**
* Clase con definiciones de limpieza comunes al proyecto Olivia y a Geofoto.
*/
namespace OliviaAddIn
{
public static class LimpiezaDef
{
public const int NMaxZon = 9;
public const int NMaxNiv = 12;
//*************************************************************************************
//Enums y structs generales
/**
* Nombre de las capas que se van a necesitar para la exportación de datos para la limpieza
*/
public struct Capas
{
public static string ftclass_niveles; //<Nombre de la capa de niveles
public static string ftclass_cont; //<Nombre de la capa de contenedores
public static string ftclass_mobi; //<Nombre de la capa de mobiliario (pipicanes, papeleras, etc)
public static string ftclass_limp_mec; //<Nombre de la capa de los ámbitos de limpieza lineales
public static string ftclass_instala; //<Nombre de la capa de instalaciones
};
/**
* Nombre de los campos (de las capas) sobre los que se realizarán consultas para la limpieza
*/
public struct Campos
{
public static string consulta_entidad; //<Campo a consultar de la capa de limpieza el tipo de entidad (ámbito)
public static string consulta_mecan; //<Campo a consultar de la capa de limpieza si es mecanizable o no
};
/**
* Nombre de los atributos (de las capas) sobre los que se realizarán consultas para la limpieza
*/
public struct Atributos
{
public static string atr_bord; //<Atributo a consultar para los Bordillos libres
public static string atr_aparc; //<Atributo a consultar para las Bandas de Aparcamiento
public static string atr_acera; //<Atributo a consultar para las Aceras
public static string atr_peat; //<Atributo a consultar para las Peatonales
public static string atr_hoja; //<Atributo a consultar para la Caida de Hoja
public static string atr_esca; //<Atributo a consultar para las Escaleras
public static string atr_fuent; //<Atributo a consultar para las Fuentes
public static string atr_infan; //<Atributo a consultar para las Zonas Infantiles
public static string atr_pape; //<Atributo a consultar para las Papeleras
public static string atr_paso_niv; //<Atributo a consultar para los Pasos a Nivel
public static string atr_pipi; //<Atributo a consultar para los Pipicanes
public static string atr_sane; //<Atributo a consultar para los Sanecanes
public static string atr_terri; //<Atributo a consultar para las Areas Terrizas
public static string atr_ocio; //<Atributo a consultar para las Zonas de Ocio
public static string atr_org_ofi; //<Atributo a consultar para los Organismos Oficiales
public static string atr_parq; //<Atributo a consultar para los Parques
public static string atr_park; //<Atributo a consultar para los Parkings
public static string atr_play; //<Atributo a consultar para las Playas
public static string atr_polid; //<Atributo a consultar para los Plideportivos
public static string atr_turis; //<Atributo a consultar para los Puntos de Interés Turístico
public static string atr_solar; //<Atributo a consultar para los Solares
public static string atr_suelo; //<Atributo a consultar para los Usos del Suelo
};
/**
* Nombre de los parámetros que intervienen en el cálculo para la limpieza
*/
public struct Parametros
{
public static int t_ttoM; //<Tiempo de tratamiento máximo admitido
public static int t_ttom; //<Tiempo de tratamiento mínimo permitido
public static int v_despM; //<Velocidad de desplazamiento máximo admitido
public static int v_despm; //<Velocidad de desplazamiento mínimo admitido
public static int t_cardescM; //<Tiempo de descarga máximo admitido
public static int t_cardescm; //<Tiempo de descarga mínimo admitido
public static int t_cardesc; //<Tiempo de descarga establecido
public static int t_despM; //<Tiempo de desplazamiento máximo admitido
public static int t_despm; //<Tiempo de desplazamiento mínimo admitido
public static int t_desp; //<Tiempo de desplazamiento establecido
public static int t_convM; //<Tiempo de convenio máximo admitido
public static int t_convm; //<Tiempo de convenio mínimo admitido
public static int t_conv; //<Tiempo de convenio establecido
public static int t_descansoM; //<Tiempo de descanso máximo admitido
public static int t_descansom; //<Tiempo de descanso mínimo admitido
public static int t_descanso; //<Tiempo de descanso establecido
public static int h_inicio; //<Hora de inicio de la jornada de trabajo
public static int ancho_viaM; //<Ancho de vía máximo admitido
public static int ancho_viam; //<Ancho de vía mínimo admitido
public static int ancho_via; //<Ancho de vía establecido
public static int ttoBarMan; //<Tiempo de tratamiento de Barrido_Manual
public static int ttoBarManMant; //<Tiempo de tratamiento de Barrido_mantenimiento_manual
public static int ttoBarMMot; //<Tiempo de tratamiento de Barrido_manual_motorizado
public static int ttoBarMC; //<Tiempo de tratamiento de Barrido_mecanico_calzadas
public static int ttoBarMAP; //<Tiempo de tratamiento de Barrido_mecanico_aceras_peatonales
public static int ttoBarMix; //<Tiempo de tratamiento de Barrido_mixto
public static int ttoBalMan; //<Tiempo de tratamiento de Baldeo_manual
public static int ttoBalMC; //<Tiempo de tratamiento de Baldeo_mecanico_calzadas
public static int ttoBalMAP; //<Tiempo de tratamiento de Baldeo_mecanico_aceras_peatonales
public static int ttoBalMix; //<Tiempo de tratamiento de Baldeo_mixto
public static int ttoBL; //<Tiempo de tratamiento de Brigada_limpieza
public static int ttoCH; //<Tiempo de tratamiento de Caida_Hoja
public static int ttoVPap; //<Tiempo de tratamiento de Vaciado_papeleras
public static int ttoLPap; //<Tiempo de tratamiento de Limpieza_papeleras
public static int ttoLC; //<Tiempo de tratamiento de Limpieza_contenedores
public static int ttoLZI; //<Tiempo de tratamiento de Limpieza_zonas_infantiles
public static int ttoLPip; //<Tiempo de tratamiento de Limpieza_pipicanes
public static int ttoLS; //<Tiempo de tratamiento de Limpieza_sanecanes
public static int vdespBarMan; //<Velocidad de desplazamiento de Barrido_Manual
public static int vdespBarManMant; //<Velocidad de desplazamiento de Barrido_mantenimiento_manual
public static int vdespBarMMot; //<Velocidad de desplazamiento de Barrido_manual_motorizado
public static int vdespBarMC; //<Velocidad de desplazamiento de Barrido_mecanico_calzadas
public static int vdespBarMAP; //<Velocidad de desplazamiento de Barrido_mecanico_aceras_peatonales
public static int vdespBarMix; //<Velocidad de desplazamiento de Barrido_mixto
public static int vdespBalMan; //<Velocidad de desplazamiento de Baldeo_manual
public static int vdespBalMC; //<Velocidad de desplazamiento de Baldeo_mecanico_calzadas
public static int vdespBalMAP; //<Velocidad de desplazamiento de Baldeo_mecanico_aceras_peatonales
public static int vdespBalMix; //<Velocidad de desplazamiento de Baldeo_mixto
public static int vdespBL; //<Velocidad de desplazamiento de Brigada_limpieza
public static int vdespCH; //<Velocidad de desplazamiento de Caida_Hoja
public static int vdespVPap; //<Velocidad de desplazamiento de Vaciado_papeleras
public static int vdespLPap; //<Velocidad de desplazamiento de Limpieza_papeleras
public static int vdespLC; //<Velocidad de desplazamiento de Limpieza_contenedores
public static int vdespLZI; //<Velocidad de desplazamiento de Limpieza_zonas_infantiles
public static int vdespLPip; //<Velocidad de desplazamiento de Limpieza_pipicanes
public static int vdespLS; //<Velocidad de desplazamiento de Limpieza_sanecanes
public static double umbral_reco; //<Umbral de llenado para la recogida de contenedores
};
//*************************************************************************************
//Enums globales limpieza
/**
* Tipos de tratamiento.
* Enumeración de los diferentes tipos de tratamiento correspondientes
* a los servicios de limpieza viaria.
*/
public enum TiposTto
{
TtoNoDef = -1,
//lineales
TtoBarrMan, //<Barrido manual
TtoBarrMant, //<Barrido manual de mantenimiento
TtoBarrMot, //<Barrido manual motorizado
TtoBarrMecCalz, //<Barrido mecánico de calzadas
TtoBarrMecAcYCalzP, //<Barrido mecánico de aceras y calzadas peatonales
TtoBarrMixAcYCalz, //<Barrido mixto de aceras y calzadas
TtoBaldMan, //<Baldeo manual
TtoBaldMecCalz, //<Baldeo mecánico de calzadas
TtoBaldMecAcYCalzP, //<Baldeo mecánico de aceras y calzadas peatonales
TtoBaldMixAcYCalz, //<Baldeo mixto de aceras y calzadas
TtoFregMecAcYCalzP, //<Fregado mecánico de aceras y calzadas peatonales
TtoCaidaHoja, //<Caída de la hoja
//puntuales
TtoPapeVaci, //<Vaciado de papeleras
TtoPapeLimp, //<Limpieza de papeleras
TtoLimpCont, //<Limpieza de ubicación de contenedores
TtoLimpZInf, //<Limpieza de zonas infantiles
TtoLimpPipi, //<Limpieza de pipicanes
TtoLimpSane, //<Limpieza y reposición de sanecanes
TtoCustom, //<Tratamiento editable para seleccionar cualquier tipo de ámbito
TtoN //<Número de tipos de tratamiento
};
/**
* Ámbitos de trabajo.
* Enumeración de los diferentes ámbitos de trabajo en los que se pueden efectuar los tratamientos
* correspondientes a los servicios de limpieza viaria.
*/
public enum AmbitsTra
{
AmbNoDef = -1,
//lineales
AmbEjeCalle, //<Ejes de calle, tipo línea
AmbBordLibreMec, //<Bordillos libres de aparcamiento mecanizables, tipo línea
AmbBordLibreNoMec, //<Bordillos libres de aparcamiento no mecanizables, tipo línea
AmbBordAparc, //<Bordillos con banda de aparcamiento, tipo línea
AmbAceMec, //<Aceras mecanizables, tipo línea
AmbAceNoMec, //<Aceras no mecanizables, tipo línea
AmbCallePeatMec, //<Calles peatonales mecanizables, tipo línea
AmbCallePeatNoMec, //<Calles peatonales no mecanizables, tipo línea
AmbBordHojaMec, //<Bordillos con caída de hoja mecanizables, tipo línea
AmbBordHojaNoMec, //<Bordillos con caída de hoja no mecanizables, tipo línea
//puntuales
AmbConte, //<Puntos de contenerización, tipo punto
AmbPape, //<Papeleras, tipo punto
AmbZInf, //<Zonas infantiles, tipo punto
AmbPipi, //<Pipicanes, tipo punto
AmbSane, //<Sanecanes, tipo punto
AmbN //<Número de ámbitos de trabajo
};
//*************************************************************************************
//Variables generales
/*array de las diferentes consltas de atributos a realizar en Ambitos_limpiezas_mecanicas. Se añade uno porque en los ámbitos sólo se recoge una vez Papeleras, mientras que hay Vaciado y Limpieza de las mismas.*/
public static string[] filtro_str = new string[(int)AmbitsTra.AmbN];
public static string[] ftclass = new string[(int)AmbitsTra.AmbN];
/**
* Array de strings con los nombres de los tipos de tratamiento que se asignará la gdb importada a ArcGIS una vez realizada la sectorización y la planificación
*/
public static String[] tto_gdb = new String[(int)TiposTto.TtoN - 1];
/**
* Array de strings con los nombres de los ámbitos de trabajo que se asignará la gdb importada a ArcGIS una vez realizada la sectorización y la planificación
*/
public static String[] ambs_gdb = new String[(int)LimpiezaDef.AmbitsTra.AmbN];
/**
* Array de strings con los prefijos del tiupo de tratamiento para poner a "ambs_gdb" para que no haya posibles capas duplicadas
*/
public static String[] preftto_gdb = new String[(int)TiposTto.TtoN - 1];
/**
* Array de strings con los tipos de tratamientos y diferentes zonas de actuación de limpieza
*/
public static String[] simb_tto = new String[22];
/**
* Array de strings con nombres de los sibmolos referentes al tipo de tratamiento de limpieza viaria
*/
public static String[] nombre_simblimp_vsm = new String[22];
/**
* Array de cadenas de doubles enumerando los tiempos de tratamiento para los diferentes tipos de tratamiento.
*/
public static double[] tiempos_tto = new double[(int)LimpiezaDef.TiposTto.TtoN - 1];
/**
* Array de cadenas de doubles enumerando las velocidades de desplazamiento para los diferentes tipos de tratamiento.
*/
public static double[] v_desplazamiento = new double[(int)LimpiezaDef.TiposTto.TtoN - 1];
/**
* Array de cadenas de caracteres enumerando los tipos de tratamiento
*/
public static String[] tipos_tto_str = new String[(int)LimpiezaDef.TiposTto.TtoN - 1];
/**
* Array de cadenas de caracteres enumerando los ámbitos de trabajo
*/
public static String[] ambits_tra_str = new String[(int)LimpiezaDef.AmbitsTra.AmbN];
//*************************************************************************************
/**
* Inicializa la matriz de strings con los nombres (tipos de tratamiento) que llevarán los grupos de la geodatabase importada a ArcGIS una vez realizada la sectorización y la planificación
*/
public static void rellena_tto_gdb()
{
LimpiezaDef.tto_gdb[(int)LimpiezaDef.TiposTto.TtoBarrMan] = "Barrido_manual";
LimpiezaDef.tto_gdb[(int)LimpiezaDef.TiposTto.TtoBarrMant] = "Barrido_manual_mantenimiento";
LimpiezaDef.tto_gdb[(int)LimpiezaDef.TiposTto.TtoBarrMot] = "Barrido_manual_motorizado";
LimpiezaDef.tto_gdb[(int)LimpiezaDef.TiposTto.TtoBarrMecCalz] = "Barrido_mecanico_calzadas";
LimpiezaDef.tto_gdb[(int)LimpiezaDef.TiposTto.TtoBarrMecAcYCalzP] = "Barrido_mecanico_aceras_peatonales";
LimpiezaDef.tto_gdb[(int)LimpiezaDef.TiposTto.TtoBarrMixAcYCalz] = "Barrido_mixto";
LimpiezaDef.tto_gdb[(int)LimpiezaDef.TiposTto.TtoBaldMan] = "Baldeo_manual";
LimpiezaDef.tto_gdb[(int)LimpiezaDef.TiposTto.TtoBaldMecCalz] = "Baldeo_mecanico_calzadas";
LimpiezaDef.tto_gdb[(int)LimpiezaDef.TiposTto.TtoBaldMecAcYCalzP] = "Baldeo_mecanico_aceras_peatonales";
LimpiezaDef.tto_gdb[(int)LimpiezaDef.TiposTto.TtoBaldMixAcYCalz] = "Baldeo_mixto";
LimpiezaDef.tto_gdb[(int)LimpiezaDef.TiposTto.TtoFregMecAcYCalzP] = "Brigada_limpieza";
LimpiezaDef.tto_gdb[(int)LimpiezaDef.TiposTto.TtoCaidaHoja] = "Caida_hoja";
LimpiezaDef.tto_gdb[(int)LimpiezaDef.TiposTto.TtoPapeVaci] = "Vaciado_papeleras";
LimpiezaDef.tto_gdb[(int)LimpiezaDef.TiposTto.TtoPapeLimp] = "Limpieza_papeleras";
LimpiezaDef.tto_gdb[(int)LimpiezaDef.TiposTto.TtoLimpCont] = "Limpieza_contenedores";
LimpiezaDef.tto_gdb[(int)LimpiezaDef.TiposTto.TtoLimpZInf] = "Limpieza_zonas_infantiles";
LimpiezaDef.tto_gdb[(int)LimpiezaDef.TiposTto.TtoLimpPipi] = "Limpieza_pipicanes";
LimpiezaDef.tto_gdb[(int)LimpiezaDef.TiposTto.TtoLimpSane] = "Limpieza_sanecanes";
}
/**
* Inicializa la matriz de strings con los nombres (ambitos de trabajo) que llevarán los featureclass de la geodatabase importada a ArcGIS una vez realizada la sectorización y la planificación
*/
public static void rellena_amb_gdb()
{
LimpiezaDef.ambs_gdb[(int)LimpiezaDef.AmbitsTra.AmbEjeCalle] = "EjCal";
LimpiezaDef.ambs_gdb[(int)LimpiezaDef.AmbitsTra.AmbBordLibreMec] = "BordLibM";
LimpiezaDef.ambs_gdb[(int)LimpiezaDef.AmbitsTra.AmbBordLibreNoMec] = "BordLibNM";
LimpiezaDef.ambs_gdb[(int)LimpiezaDef.AmbitsTra.AmbBordAparc] = "BordBndApar";
LimpiezaDef.ambs_gdb[(int)LimpiezaDef.AmbitsTra.AmbAceMec] = "AceM";
LimpiezaDef.ambs_gdb[(int)LimpiezaDef.AmbitsTra.AmbAceNoMec] = "AceNM";
LimpiezaDef.ambs_gdb[(int)LimpiezaDef.AmbitsTra.AmbCallePeatMec] = "PeatM";
LimpiezaDef.ambs_gdb[(int)LimpiezaDef.AmbitsTra.AmbCallePeatNoMec] = "PeatNM";
LimpiezaDef.ambs_gdb[(int)LimpiezaDef.AmbitsTra.AmbBordHojaMec] = "CaiHojM";
LimpiezaDef.ambs_gdb[(int)LimpiezaDef.AmbitsTra.AmbBordHojaNoMec] = "CaiHojNM";
LimpiezaDef.ambs_gdb[(int)LimpiezaDef.AmbitsTra.AmbConte] = "Contenerización";
LimpiezaDef.ambs_gdb[(int)LimpiezaDef.AmbitsTra.AmbPape] = "Papeleras";
LimpiezaDef.ambs_gdb[(int)LimpiezaDef.AmbitsTra.AmbZInf] = "ZonasInfantiles";
LimpiezaDef.ambs_gdb[(int)LimpiezaDef.AmbitsTra.AmbPipi] = "Pipicanes";
LimpiezaDef.ambs_gdb[(int)LimpiezaDef.AmbitsTra.AmbSane] = "Sanecanes";
}
/**
* Inicializa la matriz de strings con los prefijos (tipo de tratamiento) que llevarán los featureclass de la geodatabase importada a ArcGIS una vez realizada la sectorización y la planificación
*/
public static void rellena_preftto_gdb()
{
LimpiezaDef.preftto_gdb[(int)LimpiezaDef.TiposTto.TtoBarrMan] = "BarMan";
LimpiezaDef.preftto_gdb[(int)LimpiezaDef.TiposTto.TtoBarrMant] = "BarManMant";
LimpiezaDef.preftto_gdb[(int)LimpiezaDef.TiposTto.TtoBarrMot] = "BarMMot";
LimpiezaDef.preftto_gdb[(int)LimpiezaDef.TiposTto.TtoBarrMecCalz] = "BarMC";
LimpiezaDef.preftto_gdb[(int)LimpiezaDef.TiposTto.TtoBarrMecAcYCalzP] = "BarMAP";
LimpiezaDef.preftto_gdb[(int)LimpiezaDef.TiposTto.TtoBarrMixAcYCalz] = "BarMix";
LimpiezaDef.preftto_gdb[(int)LimpiezaDef.TiposTto.TtoBaldMan] = "BalMan";
LimpiezaDef.preftto_gdb[(int)LimpiezaDef.TiposTto.TtoBaldMecCalz] = "BalMC";
LimpiezaDef.preftto_gdb[(int)LimpiezaDef.TiposTto.TtoBaldMecAcYCalzP] = "BalMAP";
LimpiezaDef.preftto_gdb[(int)LimpiezaDef.TiposTto.TtoBaldMixAcYCalz] = "BalMix";
LimpiezaDef.preftto_gdb[(int)LimpiezaDef.TiposTto.TtoFregMecAcYCalzP] = "BL";
LimpiezaDef.preftto_gdb[(int)LimpiezaDef.TiposTto.TtoCaidaHoja] = "CH";
LimpiezaDef.preftto_gdb[(int)LimpiezaDef.TiposTto.TtoPapeVaci] = "VPap";
LimpiezaDef.preftto_gdb[(int)LimpiezaDef.TiposTto.TtoPapeLimp] = "LPap";
LimpiezaDef.preftto_gdb[(int)LimpiezaDef.TiposTto.TtoLimpCont] = "LC";
LimpiezaDef.preftto_gdb[(int)LimpiezaDef.TiposTto.TtoLimpZInf] = "LZI";
LimpiezaDef.preftto_gdb[(int)LimpiezaDef.TiposTto.TtoLimpPipi] = "LPip";
LimpiezaDef.preftto_gdb[(int)LimpiezaDef.TiposTto.TtoLimpSane] = "LS";
}
/**
* Inicializa la matriz de strings con los tipos de tratamientos y diferentes zonas de actuación de limpieza
*/
public static void rellena_simb_tiptto()
{
LimpiezaDef.simb_tto[0] = LimpiezaDef.Atributos.atr_esca;
LimpiezaDef.simb_tto[1] = LimpiezaDef.Atributos.atr_fuent;
LimpiezaDef.simb_tto[2] = LimpiezaDef.Atributos.atr_infan;
LimpiezaDef.simb_tto[3] = LimpiezaDef.Atributos.atr_pape;
LimpiezaDef.simb_tto[4] = LimpiezaDef.Atributos.atr_paso_niv;
LimpiezaDef.simb_tto[5] = LimpiezaDef.Atributos.atr_pipi;
LimpiezaDef.simb_tto[6] = LimpiezaDef.Atributos.atr_sane;
LimpiezaDef.simb_tto[7] = LimpiezaDef.Atributos.atr_acera;
//LimpiezaDef.simb_tto[7] = "Acera_Mecanizable";
LimpiezaDef.simb_tto[8] = LimpiezaDef.Atributos.atr_aparc;
LimpiezaDef.simb_tto[9] = LimpiezaDef.Atributos.atr_bord;
LimpiezaDef.simb_tto[10] = LimpiezaDef.Atributos.atr_hoja;
LimpiezaDef.simb_tto[11] = LimpiezaDef.Atributos.atr_peat;
LimpiezaDef.simb_tto[12] = LimpiezaDef.Atributos.atr_terri;
LimpiezaDef.simb_tto[13] = LimpiezaDef.Atributos.atr_ocio;
LimpiezaDef.simb_tto[14] = LimpiezaDef.Atributos.atr_org_ofi;
LimpiezaDef.simb_tto[15] = LimpiezaDef.Atributos.atr_parq;
LimpiezaDef.simb_tto[16] = LimpiezaDef.Atributos.atr_park;
LimpiezaDef.simb_tto[17] = LimpiezaDef.Atributos.atr_play;
LimpiezaDef.simb_tto[18] = LimpiezaDef.Atributos.atr_polid;
LimpiezaDef.simb_tto[19] = LimpiezaDef.Atributos.atr_turis;
LimpiezaDef.simb_tto[20] = LimpiezaDef.Atributos.atr_solar;
LimpiezaDef.simb_tto[21] = LimpiezaDef.Atributos.atr_suelo;
}
/**
* Inicializa la matriz de strings con los nombres de los sibmolos referentes al tipo tratamiento de limpieza viaria
*/
public static void rellena_simblimp_vsm()
{
LimpiezaDef.nombre_simblimp_vsm[0] = "escaleras";
LimpiezaDef.nombre_simblimp_vsm[1] = "Fuentes";
LimpiezaDef.nombre_simblimp_vsm[2] = "Juegos infantiles";
LimpiezaDef.nombre_simblimp_vsm[3] = "Papeleras";
LimpiezaDef.nombre_simblimp_vsm[4] = "Paso a distinto nivel";
LimpiezaDef.nombre_simblimp_vsm[5] = "Pipicans";
LimpiezaDef.nombre_simblimp_vsm[6] = "Sanecans";
LimpiezaDef.nombre_simblimp_vsm[7] = "Aceras";
LimpiezaDef.nombre_simblimp_vsm[8] = "Aparcamiento";
LimpiezaDef.nombre_simblimp_vsm[9] = "Bordillo libre";
LimpiezaDef.nombre_simblimp_vsm[10] = "Caida Hoja";
LimpiezaDef.nombre_simblimp_vsm[11] = "Peatonal";
LimpiezaDef.nombre_simblimp_vsm[12] = "areas terrizas";
LimpiezaDef.nombre_simblimp_vsm[13] = "Ocio";
LimpiezaDef.nombre_simblimp_vsm[14] = "Organismos oficiales";
LimpiezaDef.nombre_simblimp_vsm[15] = "Parques";
LimpiezaDef.nombre_simblimp_vsm[16] = "Parquin";
LimpiezaDef.nombre_simblimp_vsm[17] = "Playa";
LimpiezaDef.nombre_simblimp_vsm[18] = "Polideportivo";
LimpiezaDef.nombre_simblimp_vsm[19] = "Puntos de interes turistico";
LimpiezaDef.nombre_simblimp_vsm[20] = "Solares";
LimpiezaDef.nombre_simblimp_vsm[21] = "Uso suelo";
}
public static void inicia_tiempos()
{
LimpiezaDef.tiempos_tto[(int)LimpiezaDef.TiposTto.TtoBarrMan] = LimpiezaDef.Parametros.ttoBarMan;
LimpiezaDef.tiempos_tto[(int)LimpiezaDef.TiposTto.TtoBarrMant] = LimpiezaDef.Parametros.ttoBarManMant;
LimpiezaDef.tiempos_tto[(int)LimpiezaDef.TiposTto.TtoBarrMot] = LimpiezaDef.Parametros.ttoBarMMot;
LimpiezaDef.tiempos_tto[(int)LimpiezaDef.TiposTto.TtoBarrMecCalz] = LimpiezaDef.Parametros.ttoBarMC;
LimpiezaDef.tiempos_tto[(int)LimpiezaDef.TiposTto.TtoBarrMecAcYCalzP] = LimpiezaDef.Parametros.ttoBarMAP;
LimpiezaDef.tiempos_tto[(int)LimpiezaDef.TiposTto.TtoBarrMixAcYCalz] = LimpiezaDef.Parametros.ttoBarMix;
LimpiezaDef.tiempos_tto[(int)LimpiezaDef.TiposTto.TtoBaldMan] = LimpiezaDef.Parametros.ttoBalMan;
LimpiezaDef.tiempos_tto[(int)LimpiezaDef.TiposTto.TtoBaldMecCalz] = LimpiezaDef.Parametros.ttoBalMC;
LimpiezaDef.tiempos_tto[(int)LimpiezaDef.TiposTto.TtoBaldMecAcYCalzP] = LimpiezaDef.Parametros.ttoBalMAP;
LimpiezaDef.tiempos_tto[(int)LimpiezaDef.TiposTto.TtoBaldMixAcYCalz] = LimpiezaDef.Parametros.ttoBalMix;
LimpiezaDef.tiempos_tto[(int)LimpiezaDef.TiposTto.TtoFregMecAcYCalzP] = LimpiezaDef.Parametros.ttoBL;
LimpiezaDef.tiempos_tto[(int)LimpiezaDef.TiposTto.TtoCaidaHoja] = LimpiezaDef.Parametros.ttoCH;
LimpiezaDef.tiempos_tto[(int)LimpiezaDef.TiposTto.TtoPapeVaci] = LimpiezaDef.Parametros.ttoVPap;
LimpiezaDef.tiempos_tto[(int)LimpiezaDef.TiposTto.TtoPapeLimp] = LimpiezaDef.Parametros.ttoLPap;
LimpiezaDef.tiempos_tto[(int)LimpiezaDef.TiposTto.TtoLimpCont] = LimpiezaDef.Parametros.ttoLC;
LimpiezaDef.tiempos_tto[(int)LimpiezaDef.TiposTto.TtoLimpZInf] = LimpiezaDef.Parametros.ttoLZI;
LimpiezaDef.tiempos_tto[(int)LimpiezaDef.TiposTto.TtoLimpPipi] = LimpiezaDef.Parametros.ttoLPip;
LimpiezaDef.tiempos_tto[(int)LimpiezaDef.TiposTto.TtoLimpSane] = LimpiezaDef.Parametros.ttoLS;
LimpiezaDef.v_desplazamiento[(int)LimpiezaDef.TiposTto.TtoBarrMan] = LimpiezaDef.Parametros.vdespBarMan;
LimpiezaDef.v_desplazamiento[(int)LimpiezaDef.TiposTto.TtoBarrMant] = LimpiezaDef.Parametros.vdespBarManMant;
LimpiezaDef.v_desplazamiento[(int)LimpiezaDef.TiposTto.TtoBarrMot] = LimpiezaDef.Parametros.vdespBarMMot;
LimpiezaDef.v_desplazamiento[(int)LimpiezaDef.TiposTto.TtoBarrMecCalz] = LimpiezaDef.Parametros.vdespBarMC;
LimpiezaDef.v_desplazamiento[(int)LimpiezaDef.TiposTto.TtoBarrMecAcYCalzP] = LimpiezaDef.Parametros.vdespBarMAP;
LimpiezaDef.v_desplazamiento[(int)LimpiezaDef.TiposTto.TtoBarrMixAcYCalz] = LimpiezaDef.Parametros.vdespBarMix;
LimpiezaDef.v_desplazamiento[(int)LimpiezaDef.TiposTto.TtoBaldMan] = LimpiezaDef.Parametros.vdespBalMan;
LimpiezaDef.v_desplazamiento[(int)LimpiezaDef.TiposTto.TtoBaldMecCalz] = LimpiezaDef.Parametros.vdespBalMC;
LimpiezaDef.v_desplazamiento[(int)LimpiezaDef.TiposTto.TtoBaldMecAcYCalzP] = LimpiezaDef.Parametros.vdespBalMAP;
LimpiezaDef.v_desplazamiento[(int)LimpiezaDef.TiposTto.TtoBaldMixAcYCalz] = LimpiezaDef.Parametros.vdespBalMix;
LimpiezaDef.v_desplazamiento[(int)LimpiezaDef.TiposTto.TtoFregMecAcYCalzP] = LimpiezaDef.Parametros.vdespBL;
LimpiezaDef.v_desplazamiento[(int)LimpiezaDef.TiposTto.TtoCaidaHoja] = LimpiezaDef.Parametros.vdespCH;
LimpiezaDef.v_desplazamiento[(int)LimpiezaDef.TiposTto.TtoPapeVaci] = LimpiezaDef.Parametros.vdespVPap;
LimpiezaDef.v_desplazamiento[(int)LimpiezaDef.TiposTto.TtoPapeLimp] = LimpiezaDef.Parametros.vdespLPap;
LimpiezaDef.v_desplazamiento[(int)LimpiezaDef.TiposTto.TtoLimpCont] = LimpiezaDef.Parametros.vdespLC;
LimpiezaDef.v_desplazamiento[(int)LimpiezaDef.TiposTto.TtoLimpZInf] = LimpiezaDef.Parametros.vdespLZI;
LimpiezaDef.v_desplazamiento[(int)LimpiezaDef.TiposTto.TtoLimpPipi] = LimpiezaDef.Parametros.vdespLPip;
LimpiezaDef.v_desplazamiento[(int)LimpiezaDef.TiposTto.TtoLimpSane] = LimpiezaDef.Parametros.vdespLS;
}
/**
* Rellena las matrices de datos
*/
public static void rellena_matrs()
{
tipos_tto_str[(int)LimpiezaDef.TiposTto.TtoBarrMan] = "Barrido manual";
tipos_tto_str[(int)LimpiezaDef.TiposTto.TtoBarrMant] = "Barrido manual de mantenimiento";
tipos_tto_str[(int)LimpiezaDef.TiposTto.TtoBarrMot] = "Barrido manual motorizado";
tipos_tto_str[(int)LimpiezaDef.TiposTto.TtoBarrMecCalz] = "Barrido mecánico de calzadas";
tipos_tto_str[(int)LimpiezaDef.TiposTto.TtoBarrMecAcYCalzP] = "Barrido mecánico de aceras y calzadas peatonales";
tipos_tto_str[(int)LimpiezaDef.TiposTto.TtoBarrMixAcYCalz] = "Barrido mixto de aceras y calzadas";
tipos_tto_str[(int)LimpiezaDef.TiposTto.TtoBaldMan] = "Baldeo manual";
tipos_tto_str[(int)LimpiezaDef.TiposTto.TtoBaldMecCalz] = "Baldeo mecánico de calzadas";
tipos_tto_str[(int)LimpiezaDef.TiposTto.TtoBaldMecAcYCalzP] = "Baldeo mecánico de aceras y calzadas peatonales";
tipos_tto_str[(int)LimpiezaDef.TiposTto.TtoBaldMixAcYCalz] = "Baldeo mixto de aceras y calzadas";
tipos_tto_str[(int)LimpiezaDef.TiposTto.TtoFregMecAcYCalzP] = "Fregado mecánico de aceras y calzadas peatonales";
tipos_tto_str[(int)LimpiezaDef.TiposTto.TtoCaidaHoja] = "Caída de la hoja";
tipos_tto_str[(int)LimpiezaDef.TiposTto.TtoPapeVaci] = "Vaciado de papeleras";
tipos_tto_str[(int)LimpiezaDef.TiposTto.TtoPapeLimp] = "Limpieza de papeleras";
tipos_tto_str[(int)LimpiezaDef.TiposTto.TtoLimpCont] = "Limpieza de ubicación de contenedores";
tipos_tto_str[(int)LimpiezaDef.TiposTto.TtoLimpZInf] = "Limpieza de zonas infantiles";
tipos_tto_str[(int)LimpiezaDef.TiposTto.TtoLimpPipi] = "Limpieza de pipicanes";
tipos_tto_str[(int)LimpiezaDef.TiposTto.TtoLimpSane] = "Limpieza y reposición de sanecanes";
ambits_tra_str[(int)LimpiezaDef.AmbitsTra.AmbEjeCalle] = "Ejes de calle";
ambits_tra_str[(int)LimpiezaDef.AmbitsTra.AmbBordLibreMec] = "Bordillos libres de aparcamiento mec.";
ambits_tra_str[(int)LimpiezaDef.AmbitsTra.AmbBordLibreNoMec] = "Bordillos libres de aparcamiento no mec.";
ambits_tra_str[(int)LimpiezaDef.AmbitsTra.AmbBordAparc] = "Bordillos con banda de aparcamiento";
ambits_tra_str[(int)LimpiezaDef.AmbitsTra.AmbAceMec] = "Aceras mecanizables";
ambits_tra_str[(int)LimpiezaDef.AmbitsTra.AmbAceNoMec] = "Aceras no mecanizables";
ambits_tra_str[(int)LimpiezaDef.AmbitsTra.AmbCallePeatMec] = "Calles peatonales mecanizables";
ambits_tra_str[(int)LimpiezaDef.AmbitsTra.AmbCallePeatNoMec] = "Calles peatonales no mecanizables";
ambits_tra_str[(int)LimpiezaDef.AmbitsTra.AmbBordHojaMec] = "Bordillos con caída de hoja mecanizables";
ambits_tra_str[(int)LimpiezaDef.AmbitsTra.AmbBordHojaNoMec] = "Bordillos con caída de hoja no mecanizables";
ambits_tra_str[(int)LimpiezaDef.AmbitsTra.AmbConte] = "Puntos de contenerización";
ambits_tra_str[(int)LimpiezaDef.AmbitsTra.AmbPape] = "Papeleras";
ambits_tra_str[(int)LimpiezaDef.AmbitsTra.AmbZInf] = "Zonas infantiles";
ambits_tra_str[(int)LimpiezaDef.AmbitsTra.AmbPipi] = "Pipicanes";
ambits_tra_str[(int)LimpiezaDef.AmbitsTra.AmbSane] = "Sanecanes";
}
}
}

1113
OliviaAddIn/LimpiezaDlg.Designer.cs generated Normal file

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More