public void LoadListSitesCloud(string waferName) { ExistingData.Clear(); var dir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\SPSProbes"; if (Directory.Exists(dir) == false) { Directory.CreateDirectory(dir); } var filename = dir + "\\" + waferName + ".dxf"; var dxf = (WebHost + "WaferPlanDXFView?WaferName=" + waferName).WithHeader("Authorization", Form1.pass).WithHeader("x-user", "probe").GetStreamAsync().Result; using (var fileStream = File.Create(filename)) { dxf.CopyTo(fileStream); } Canvas.LoadFile(filename); var result = (WebHost + "WaferTestSiteView?WaferName=" + waferName).WithHeader("Authorization", Form1.pass).WithHeader("x-user", "probe").GetJsonAsync <WaferInfo>().Result; var jsonS = JsonConvert.SerializeObject(result); File.WriteAllText(@"S:\Research\ProbeStation\WaferPlans\" + waferName + ".json", jsonS); var addData = new List <ProbeSite>(); Canvas.LoadLayerActivation(result.activeLayer.Replace("||", " ")); if (result.probes != null) { for (int lineI = 0; lineI < result.probes.Length; lineI++) { var newPoint = result.probes[lineI]; ExistingData.Add(newPoint); addData.Add(newPoint); } foreach (var point in addData) { Canvas.AddListSite(point.Position.X, point.Position.Y); } } }
public string LoadListSitesLV(string waferName, string dxfFile, string waferTestInfos) { ExistingData.Clear(); var dir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\SPSProbes"; if (Directory.Exists(dir) == false) { Directory.CreateDirectory(dir); } var filename = dir + "\\" + waferName + ".dxf"; File.WriteAllText(filename, dxfFile); Canvas.LoadFile(filename); var result = JsonConvert.DeserializeObject <WaferInfo>(waferTestInfos); var addData = new List <ProbeSite>(); Canvas.LoadLayerActivation(result.activeLayer.Replace("||", " ")); if (result.probes != null) { for (int lineI = 0; lineI < result.probes.Length; lineI++) { var newPoint = result.probes[lineI]; ExistingData.Add(newPoint); addData.Add(newPoint); } foreach (var point in addData) { Canvas.AddListSite(point.Position.X, point.Position.Y); } } return(filename); }