107 lines
2.8 KiB
C#
107 lines
2.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using OliviaAddInPro.Helper;
|
|
using OliviaAddInPro.Services;
|
|
using ArcGIS.Core.Geometry;
|
|
using static OliviaAddInPro.Model.ComunDef;
|
|
using ArcGIS.Desktop.Framework.Threading.Tasks;
|
|
|
|
namespace OliviaAddInPro.Model
|
|
{
|
|
class Recogida : TratamientoComun
|
|
{
|
|
//**********************************************
|
|
//Se recogen en PaneRecogidaSub1
|
|
/**
|
|
* Tipo de fracción
|
|
*/
|
|
public int TipoFrac { get; set; } = -1;
|
|
/**
|
|
* Tipo de fracción
|
|
*/
|
|
public string TipoFracStr { get; set; } = string.Empty;
|
|
/**
|
|
* Tipo de carga
|
|
*/
|
|
public int TipoCarg { get; set; } = -1;
|
|
/**
|
|
* Tipo de carga
|
|
*/
|
|
public string TipoCargStr { get; set; } = string.Empty;
|
|
/**
|
|
* Tipo de Vehículo
|
|
*/
|
|
public int TipoVehic { get; set; } = -1;
|
|
/**
|
|
* Tipo de Lateralidad
|
|
*/
|
|
public int TipoLate { get; set; } = -1;
|
|
/**
|
|
* kg capac camión
|
|
*/
|
|
public int KgMaxVehic { get; set; } = 0;
|
|
/**
|
|
* dens contenedor
|
|
*/
|
|
public int DensCont { get; set; } = 0;
|
|
/**
|
|
* Tiempo de vaciado del contenedor, en seg
|
|
*/
|
|
public int TVaciCont { get; set; } = 0;
|
|
/**
|
|
* kg de carga en cada contenedor
|
|
*/
|
|
public int KgCont { get; set; } = 0;
|
|
/**
|
|
* grados en º de giro del vehículo
|
|
*/
|
|
public int GiroVehic { get; set; } = 0;
|
|
/**
|
|
* Coordenadas de la planta de descarga
|
|
*/
|
|
public Coordinate2D CoordsPlanta { get; set; } = new Coordinate2D(0, 0);
|
|
|
|
/*
|
|
*
|
|
* */
|
|
public double AnchoVehiculo
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
public RecogidaServ Serv { get; set; } = null;
|
|
public Recogida()
|
|
{
|
|
Serv = new RecogidaServ(this);
|
|
}
|
|
|
|
|
|
public TareaRes Ejecuta(ModosEjec modo, CancelableProgressorSource cps)
|
|
{
|
|
TareaRes res = null;
|
|
if (modo == ModosEjec.Sectoriza)
|
|
res = Serv.Sectoriza(cps);
|
|
else if (modo == ModosEjec.Planifica)
|
|
res = Serv.Planifica(cps);
|
|
return res;
|
|
|
|
}
|
|
public async void EjecutaAsync(ModosEjec modo, CancelableProgressorSource cps, Action<TareaRes> ffin)
|
|
{
|
|
await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
|
|
{
|
|
cps.Status = "Procesando";
|
|
cps.Value = 0;
|
|
var res = Ejecuta(modo, cps);
|
|
ffin(res);
|
|
return res;
|
|
|
|
});
|
|
|
|
}
|
|
}
|
|
}
|