using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DbCommon.Enties.DbModels
{
    [SugarTable("StationInfo")]
    public class StationInfo
    {

        [SugarColumn(IsIgnore = true)]
        public int SerialNumber { get; set; }

        [SugarColumn(IsPrimaryKey = true)]
        public int Id { get; set; }

        [SugarColumn(Length = 50)]
        public string Name { get; set; }

        [SugarColumn(IsIgnore = true)]
        public string LineName { get; set; }

        [SugarColumn(IsIgnore = true)]
        public int Mark { get; set; }
        public int AgvId { get; set; }
        public bool HasCar { get; set; }
        public LocationStatus Status { get; set; }



        [SugarColumn(IsIgnore = true)]
        public int ReleaseRoute { get; set; }

        [SugarColumn(IsIgnore = true)]
        public int ReleaseNGRoute { get; set; }

        [SugarColumn(IsIgnore = true)]
        public int TargetMark { get; set; }

        [SugarColumn(IsIgnore = true)]
        public int Priority { get; set; }

        [SugarColumn(IsIgnore = true)]
        public int JudgeRoute { get; set; }


        public int CurrentRoute { get; set; }

        [SugarColumn(IsIgnore = true)]
        public bool Online { get; set; }

        [SugarColumn(IsIgnore = true)]
        public byte AgvStausValue { get; set; }

        [SugarColumn(IsIgnore = true)]
        public byte AgvAlarm { get; set; }

        [SugarColumn(IsIgnore = true)]
        public string AgvAlarmText { get; set; }


        //PLC地址

        [SugarColumn(IsIgnore = true)]
        public string PlcRelease { get; set; }

        [SugarColumn(IsIgnore = true)]
        public string PlcAgvStatus { get; set; }

        [SugarColumn(IsIgnore = true)]
        public string PlcAgvFalut { get; set; }

        [SugarColumn(IsIgnore = true)]
        public string PlcAgvId { get; set; }

        [SugarColumn(IsIgnore = true)]
        public string PlcIPAddress { get; set; }


        [SugarColumn(IsIgnore = true)]
        public long LastReleaseTime { get; set; }

        [SugarColumn(IsIgnore = true)]
        public bool ReleaseCold { get { return (DateTime.Now.Ticks - LastReleaseTime) > 5000000L; } }

        public bool Traffic { get; set; }
        public int Command { get; set; }

        public DateTime CountStartTime { get; set; }
        public int CountInterval { get; set; }
        public int CountAlarm { get; set; }

        [SugarColumn(IsIgnore = true)]
        public int CountSec { get; set; }

        [SugarColumn(IsIgnore = true)]
        public int LastCommand { get; set; }
    }
}
