using CommunityToolkit.Mvvm.ComponentModel;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;

namespace Common.Models
{
    /// <summary>
    /// 工装位置区域划分
    /// </summary>
    public enum BoxAreaEnum
    {
        _手套箱传送平台 = 1,
        _Tip托盘存放平台 = 2,
        _开关盖区域 = 3,
        _称重模块 = 4,
        _扫码区域 = 6,
        _加样头存放平台 = 10,
        _托盘存放平台 = 12,
        _自动加样模块内 = 11,
    }


    /// <summary>
    /// 工装类型
    /// </summary>
    public enum BoxTypeEnum
    {
        _40mL原液工装 = 1,
        _12mL样品工装 = 2,
        _5mL样品工装 = 3,
        //_2mL外瓶工装 = 4,
        //_滤芯瓶工装 = 5,
        _16mL粉末瓶工装=6,
        _125mL粉末瓶工装,
        _50uLTip头工装,
        _300uLTip头工装,
        _1000uLTip头工装,
    }

    [Serializable]
    [XmlInclude(typeof(SourcePowderBottleBoxModel))]
    [XmlInclude(typeof(SourcePowderBottleBoxModel_125ml))]
    [XmlInclude(typeof(SampleBottleBoxModel))]
    [XmlInclude(typeof(SourceLiquidBottleBoxModel))]
    [XmlInclude(typeof(TipBoxModel))]
    public class BaseBottleBox : ObservableObject
    {
        private BoxAreaEnum boxarea = BoxAreaEnum._手套箱传送平台;
        /// <summary>
        /// 工装所在的工装区域
        /// </summary>
        public BoxAreaEnum BoxArea
        {
            get { return boxarea; }
            set { SetProperty(ref boxarea, value); }
        }

        private BoxTypeEnum fixturetype = BoxTypeEnum._40mL原液工装;
        /// <summary>
        /// 工装类型
        /// </summary>
        [JsonProperty("fixtureType")]
        public BoxTypeEnum FixtureType
        {
            get => fixturetype;
            set => SetProperty(ref fixturetype, value);
        }

        private string _boxsn = string.Empty;
        /// <summary>
        /// 载具的二维码信息
        /// </summary>
        [JsonProperty("snCode")]
        public string BoxSNCode
        {
            get => _boxsn;
            set
            {
                SetProperty(ref _boxsn, value);
            }
        }

        private bool _isEmpty = false;
        /// <summary>
        /// 是否是空位置。true:表示空，可以放置工装  false:表示位置有工装
        /// </summary>
        public bool IsEmpty
        {
            get => _isEmpty;
            set => SetProperty(ref _isEmpty, value);
        }

        private bool _isDoseFinish = false;
        /// <summary>
        /// 是否配置完成，针对样品工装来说
        /// </summary>
        public bool IsDoseFinish
        {
            get => _isDoseFinish;
            set => SetProperty(ref _isDoseFinish, value);
        }

        private bool _isuseFinish = false;
        /// <summary>
        /// 是否用完成  针对tip头工装或者原液瓶工装
        /// </summary>
        public bool IsUseFinsh
        {
            get => _isuseFinish;
            set => SetProperty(ref _isuseFinish, value);
        }

        private int boxid_indoseupload = 0;
        /// <summary>
        /// 工装在投料站 上料时位置(1-7)
        /// </summary>
        [JsonProperty("boxIdInDoseUpload")]
        public int BoxId_inDoseUpload
        {
            get => boxid_indoseupload;
            set => SetProperty(ref boxid_indoseupload, value);
        }

        private int _boxid_inDoseDnload = 0;
        /// <summary>
        /// 工装在投料站 下料时的位置(1-7)
        /// </summary>
        public int BoxId_inDoseDnload
        {
            get => _boxid_inDoseDnload;
            set
            {
                SetProperty(ref _boxid_inDoseDnload, value);
            }
        }

        private int _boxid_inDosingStation = 0;
        /// <summary>
        /// 工装在投料站中位置(1-8)
        /// </summary>
        public int BoxId_inDosingStation
        {
            get => _boxid_inDosingStation;
            set
            {
                SetProperty(ref _boxid_inDosingStation, value);
            }
        }
    }
}
