public void LoadListSites(string waferName) { ExistingData.Clear(); var dir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\SPSProbes"; if (Directory.Exists(dir) == false) { Directory.CreateDirectory(dir); } var filename = dir + "\\" + waferName + ".csv"; var addData = new List <ProbeSite>(); var inText = File.ReadAllLines(filename); Canvas.LoadLayerActivation(inText[1]); for (int lineI = 3; lineI < inText.Length; lineI++) { var parts = inText[lineI].Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); var newPoint = new ProbeSite { JunctionName = parts[0], Function = parts[1], Position = new Point(int.Parse(parts[2]), int.Parse(parts[3])) }; ExistingData.Add(newPoint); addData.Add(newPoint); } foreach (var point in addData) { Canvas.AddListSite(point.Position.X, point.Position.Y); } }
public void AddListSite(string junctionName, ProbeOrientation orientation, ProbeFunction function, Point location) { var newPoint = new ProbeSite { JunctionName = junctionName, Orientation = orientation.ToString(), Function = function.ToDescription(), Position = location }; ExistingData.Add(newPoint); dataGridView1.Rows.Add(newPoint.JunctionName, newPoint.Position.X + "," + newPoint.Position.Y, newPoint.Function, 0, 0, 0, newPoint.TopWidth, newPoint.BottomWidth, newPoint.Area); GetFirstCorner(); }
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 void AddListData(Point[] selectedLocations) { Rows.Clear(); for (int i = dataGridView1.Rows.Count - 1; i >= 0; i--) { if (dataGridView1.Rows[i].IsNewRow == false) { dataGridView1.Rows.RemoveAt(i); } } var addData = new List <ProbeSite>(); foreach (var point in selectedLocations) { var hits = ExistingData.Where(x => Math.Abs(point.X - x.Position.X) < 10 && Math.Abs(point.Y - x.Position.Y) < 10).FirstOrDefault(); if (hits == null) { var newPoint = new ProbeSite { JunctionName = "UNK" + ExistingData.Count, Orientation = "Horizontal", Function = "IVC", Position = point }; ExistingData.Add(newPoint); addData.Add(newPoint); } else { addData.Add(hits); } } foreach (var row in addData) { dataGridView1.Rows.Add(row.JunctionName, row.Position.X + "," + row.Position.Y, row.Function, 0, 0, 0, row.TopWidth, row.BottomWidth); } GetFirstCorner(); }
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); }