public static void UpdataTrayData(string strStationName, string posName) { if (("取料站" == strStationName || "Barrel站" == strStationName) && posName.Contains("料盘")) { if (StationMgr.GetInstance().GetStation(strStationName).GetStationPointDic().ContainsKey(posName)) { int indexofstring = posName.IndexOf("_"); string sub = posName.Substring(indexofstring + 1); indexofstring = sub.IndexOf("_"); sub = sub.Substring(0, indexofstring); int index = sub.ToInt(); if (posName.Contains($"_M_SP")) { TrayMgr.GetInstance().trayDataLoadArr[index - 1].PlaceLeftTopcoordinate = TrayMgr.GetInstance().trayDataLoadArr[index - 1].PickLeftTopcoordinate = new Coordinate() { X = StationMgr.GetInstance().GetStation(strStationName).GetStationPointDic()[posName].pointX, Y = StationMgr.GetInstance().GetStation(strStationName).GetStationPointDic()[posName].pointY, Z = StationMgr.GetInstance().GetStation(strStationName).GetStationPointDic()[posName].pointZ, }; TrayMgr.GetInstance().trayDataLoadArr[index - 1].Init(); } if (posName.Contains($"_M_EP")) { TrayMgr.GetInstance().trayDataLoadArr[index - 1].PlaceRightBottomcoordinate = TrayMgr.GetInstance().trayDataLoadArr[index - 1].PickRightBottomcoordinate = new Coordinate() { X = StationMgr.GetInstance().GetStation(strStationName).GetStationPointDic()[posName].pointX, Y = StationMgr.GetInstance().GetStation(strStationName).GetStationPointDic()[posName].pointY, Z = StationMgr.GetInstance().GetStation(strStationName).GetStationPointDic()[posName].pointZ, }; TrayMgr.GetInstance().trayDataLoadArr[index - 1].Init(); } if (posName.Contains($"_V_SP")) { TrayMgr.GetInstance().trayDataLoadArr[index - 1].SnapLeftTopcoordinate = new Coordinate() { X = StationMgr.GetInstance().GetStation(strStationName).GetStationPointDic()[posName].pointX, Y = StationMgr.GetInstance().GetStation(strStationName).GetStationPointDic()[posName].pointY, Z = StationMgr.GetInstance().GetStation(strStationName).GetStationPointDic()[posName].pointZ, }; TrayMgr.GetInstance().trayDataLoadArr[index - 1].Init(); } if (posName.Contains($"_V_EP")) { TrayMgr.GetInstance().trayDataLoadArr[index - 1].SnapRightBottomcoordinate = new Coordinate() { X = StationMgr.GetInstance().GetStation(strStationName).GetStationPointDic()[posName].pointX, Y = StationMgr.GetInstance().GetStation(strStationName).GetStationPointDic()[posName].pointY, Z = StationMgr.GetInstance().GetStation(strStationName).GetStationPointDic()[posName].pointZ, }; TrayMgr.GetInstance().trayDataLoadArr[index - 1].Init(); } } } }
public object Read() { string strPath = AppDomain.CurrentDomain.BaseDirectory + @"\config\traydata.xml"; Object obj = AccessXmlSerializer.XmlToObject(strPath, this.GetType()); if (obj != null) { trayMgr = (TrayMgr)obj; } return(trayMgr); // return trayDataLoad.Read(); }
public static TrayMgr GetInstance() { if (trayMgr == null) { lock (obj) { if (trayMgr == null) { trayMgr = new TrayMgr(); } } } return(trayMgr); }