using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using ArcGIS.Core.CIM;
using ArcGIS.Core.Data;
using ArcGIS.Core.Geometry;
using ArcGIS.Desktop.Catalog;
using ArcGIS.Desktop.Core;
using ArcGIS.Desktop.Editing;
using ArcGIS.Desktop.Extensions;
using ArcGIS.Desktop.Framework;
using ArcGIS.Desktop.Framework.Contracts;
using ArcGIS.Desktop.Framework.Dialogs;
using ArcGIS.Desktop.Framework.Threading.Tasks;
using ArcGIS.Desktop.Mapping;
using OliviaAddInPro.Model;

namespace OliviaAddInPro
{
    public class PaneLimpiezaSub4ViewModel : PanelViewModelBase
    {
        public PaneLimpiezaSub4ViewModel()
        {
            textPercentTrafico = LimpiezaDef.Parametros.reduc_traf;
            timeCargDesc = LimpiezaDef.Parametros.t_cardesc;
            timeDespIniFin = LimpiezaDef.Parametros.t_desp;
            timeIniJornada = LimpiezaDef.Parametros.h_inicio;
            timeJornadaConv = LimpiezaDef.Parametros.t_conv;
            timeDescPers = LimpiezaDef.Parametros.t_descanso;
        }


        #region Properties     

        public override string DisplayName
        {
            get { return Resource1.String_tiempos; }
        }

        //en minutos
        private int timeCargDesc;
        public DateTime TimeCargDesc
        {
            get { return PanelGlobal.Hm_int2DateTime(timeCargDesc); }
            set
            {
                timeCargDesc = PanelGlobal.Hm_DateTime2int(value);
                base.NotifyPropertyChanged("TimeCargDesc");
            }
        }

        //en minutos
        private int timeDespIniFin;
        public DateTime TimeDespIniFin
        {
            get { return PanelGlobal.Hm_int2DateTime(timeDespIniFin); }
            set
            {
                timeDespIniFin = PanelGlobal.Hm_DateTime2int(value);
                base.NotifyPropertyChanged("TimeDespIniFin");
            }
        }

        //en minutos desde las 00 horas
        private int timeIniJornada;
        public DateTime TimeIniJornada
        {
            get { return PanelGlobal.Hm_int2DateTime(timeIniJornada); }
            set
            {
                timeIniJornada = PanelGlobal.Hm_DateTime2int(value);
                base.NotifyPropertyChanged("TimeIniJornada");
            }
        }

        //Tráfico, de 0 a 100
        private int textPercentTrafico;
        public int TextPercentTrafico
        {
            get { return textPercentTrafico; }
            set { base.SetProperty(ref textPercentTrafico, value, () => TextPercentTrafico); }
        }

        //en minutos desde las 00 horas
        private int timeJornadaConv;
        public DateTime TimeJornadaConv
        {
            get { return PanelGlobal.Hm_int2DateTime(timeJornadaConv); }
            set
            {
                timeJornadaConv = PanelGlobal.Hm_DateTime2int(value);
                base.NotifyPropertyChanged("TimeJornadaConv");
            }
        }

        //en minutos
        private int timeDescPers;
        public DateTime TimeDescPers
        {
            get { return PanelGlobal.Hm_int2DateTime(timeDescPers); }
            set
            {
                timeDescPers = PanelGlobal.Hm_DateTime2int(value);
                base.NotifyPropertyChanged("TimeDescPers");
            }
        }
        private string textTCargDesc="Carga y Descarga";
        public string TextTCargDesc
        {
            get { return textTCargDesc; }
            set { base.SetProperty(ref textTCargDesc, value, () => textTCargDesc); }
        }
        private string textTDesplIniFin = "Desplazamiento Ini/Fin";
        public string TextTDesplIniFin
        {
            get { return textTDesplIniFin; }
            set { base.SetProperty(ref textTDesplIniFin, value, () => TextTDesplIniFin); }
        }

        #endregion Properties
    }
}
