chengsc
2024-09-11 2f0e0fa257c147a223d79ff8a52118768f43eee8
Admin.NET/WCS.Application/PLC/PLCTaskAction.cs
@@ -13,6 +13,8 @@
    public static bool boOffline = false;
    //自刷新
    public static bool boRefresh = false;
    //演示模式
    public static bool boDemo = false;
    public static List<PlcPositionInfo> listPositionInfo = new List<PlcPositionInfo>();
@@ -33,6 +35,17 @@
    {
        get { return listPlcUtil; }
    }
    // 交互点集合
    public static List<WcsDevice> plcDevices
    {
        get { return listPlcDevice; }
    }
    // 交互点集合
    public static List<WcsPosition> plcStation
    {
        get { return listPlcStation; }
    }
    public static event EventHandler DeviceValueChangeEvent;
    static PLCTaskAction()
    {
@@ -41,6 +54,7 @@
        boRunningState = _sysConfigService.GetConfigValue<bool>("sys_RunningState").Result;
        boOffline = _sysConfigService.GetConfigValue<bool>("sys_Offline").Result;
        boRefresh = _sysConfigService.GetConfigValue<bool>("sys_Refresh").Result;
        boDemo = _sysConfigService.GetConfigValue<bool>("sys_demo").Result;
    }
    /// <summary>
    /// 初始化PLC连接
@@ -145,7 +159,7 @@
                                dto.listStation = listPlcStation.Where(s => s.DeviceId == modDevice.Id).ToList();
                                dto.listDevice = listDevice.Where(s => s.StationNum == modDevice.StationNum && s.Level == DeviceLevelEnum.Station).ToList();
                                //这里触发值变更事件
                                //DeviceValueChangeEvent?.Invoke(dto, EventArgs.Empty);
                                DeviceValueChangeEvent?.Invoke(dto, EventArgs.Empty);
                            }
                            else if (!modPlcUtil.Connected)
                            {