using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Aitex.Core.RT.Log; using MECF.Framework.Common.DataCenter; using OpenSEMI.ClientBase.Handlers; namespace VirgoUI.Client.Models.Sys { public class StatesImp { public StatesImp(IQueryDataService dataService) { DataService = dataService; //all states list for the system this.Keys = new List() { "Aligner.Status", "LP1.Status", "LP2.Status", "EFEM.Status", "LLA.Status", "LLB.Status", "TM.Status", "PM1.Status", "PM2.Status", "PM3.Status", "PM4.Status", "PM5.Status", "PM6.Status", "Rt.Status", "Fa.Status", "EfemRobot.BladeTarget", "EfemRobot.Arm1Extended", "EfemRobot.Arm2Extended", "TmRobot.BladeTarget", }; } public List GetStates(List keys) { try { List states = new List(); if (this.DataService.PollData(keys) != null) { this.DataService.PollData(keys).ToList().ForEach(kv => { if (kv.Value != null) states.Add(new State() { Key = kv.Key, DisplayValue = kv.Value.ToString() }); }); } return states; } catch (Exception e) { LOG.Write(e); return null; } } public List Keys { get; private set; } private IQueryDataService DataService; } }