using ConverterBytesAndStruct;
using DC_A95;
using OpcBasic;
using OpcData;
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using SystemFramework;

/// <summary>
/// 
/// </summary>
namespace MesWork
{
    /// <summary>
    /// 设备状态的处理
    /// </summary>
    public partial class MesWorkForm
    {

        /// <summary>
        /// 设备状态的处理
        /// </summary>
        /// <param name="e"></param>
        private void MIS_Device(object e)
        {

            var eState = (OpcData.PlcStateEvetnArgs)e;
            var ip = eState.IP.ToString();
            var onLine = eState.OnLine;

            try
            {
                if (ht_IP_OnLine.ContainsKey(ip))
                {
                    ht_IP_OnLine[ip] = onLine;
                }
                else
                {
                    ht_IP_OnLine.Add(ip, onLine);
                }
            }
            catch (Exception err){  }
            try
            {
                if (G_DC_IP_OP.ContainsKey(ip))
                {
                    var listOp = G_DC_IP_OP[ip];
                    foreach (var op in listOp)
                    {
                        ht_Signal__Station_OffLine[op] = onLine;
                    }
                }

            }
            catch (Exception err){  }
        }


    
    }
}
