public void Execute(IPCBIWindow parent) { IStep step = parent.GetCurrentStep(); if (step == null) { return; } double tolerance = 1; List <IODBObject> selection = step.GetSelectedElements(); foreach (IODBObject selObj in selection) { IODBLayer layer = (IODBLayer)step.GetLayer(selObj.GetParentLayerName()); if (selObj.Type == IObjectType.Line) { ILineSpecificsD line = (ILineSpecificsD)selObj.GetSpecificsD(); List <IObject> startPos = layer.GetAllObjectsOnPosition(line.Start.ToPointF()); bool setColor = true; setColor = CheckConnection(tolerance, selObj, line.Start, startPos, setColor); if (setColor) { List <IObject> endPos = layer.GetAllObjectsOnPosition(line.End.ToPointF()); setColor = CheckConnection(tolerance, selObj, line.End, endPos, setColor); } if (setColor) { selObj.ObjectColorTemporary(Color.Aquamarine); } } else if (selObj.Type == IObjectType.Arc) { IArcSpecificsD arc = (IArcSpecificsD)selObj.GetSpecificsD(); List <IObject> startPos = layer.GetAllObjectsOnPosition(arc.Start.ToPointF()); bool setColor = true; setColor = CheckConnection(tolerance, selObj, arc.Start, startPos, setColor); if (setColor) { List <IObject> endPos = layer.GetAllObjectsOnPosition(arc.End.ToPointF()); setColor = CheckConnection(tolerance, selObj, arc.End, endPos, setColor); } if (setColor) { selObj.ObjectColorTemporary(Color.Aquamarine); } } } step.ClearSelection(); }
public void Execute(IPCBIWindow parent) { //fill code here code IStep step = parent.GetCurrentStep(); bool onOff = false; if (step == null) { return; } firstSelectionToHighlight = step.GetSelectedCMPs(); step.ClearSelection(); parent.IColorsetting.IfDrawOnlySelectedTransparencyNotSelectedCMPs = 50; parent.IColorsetting.ShowPinNumbers = false; IAutomation.RealTimeDrawing = false; while (true) { Thread.Sleep(1000); parent.IColorsetting.DrawOnlySelectedElements = false; parent.IColorsetting.DrawOnlySelectedCMPs = false; foreach (ICMPObject objSel in firstSelectionToHighlight) { if (onOff) { objSel.ObjectColorTemporary(Color.Red); } else { objSel.ObjectColorTemporary(Color.Empty); } } onOff = !onOff; parent.UpdateView(); if (isDisposed) { break; } } }
private void ResultDLG_ItemSelectionChanged1(ListView.SelectedListViewItemCollection Selection) { IStep step = parent.GetCurrentStep(); if (step != null) { foreach (ListViewItem lvi in Selection) { if (step != null) { step.ClearSelection(); ((ICMPObject)lvi.Tag).Select(true); step.TurnOffAllLayer(); IODBLayer layer = step.GetOutsideODBLayer(((ICMPObject)lvi.Tag).PlacedTop); if (layer != null) { layer.EnableLayer(true); } parent.UpdateSelection(); PCBI.MathUtils.RectangleD zoomRect = ((ICMPObject)lvi.Tag).GetBoundsD(); if (zoomRect == PCBI.MathUtils.RectangleD.Empty) { parent.ZoomToSelection(); } else { zoomRect.Inflate(zoomRect.Width * 0.5, zoomRect.Height * 0.5); parent.ZoomRect(zoomRect); } } else { ((ICMPObject)lvi.Tag).Select(true); parent.UpdateSelection(); parent.UpdateView(); } } } }
public void Execute(IPCBIWindow parent) { string PackageName = "TESTPUNKT"; bool topSide = true; bool useFlattenStep = true; if (!parent.JobIsLoaded) { return; } IFilter filter = new IFilter(parent); IStep step = parent.GetCurrentStep(); IMatrix matrix = parent.GetMatrix(); if (matrix == null) { return; } step.TurnOffAllLayer(); step.ClearSelection(); //nicht für flatten step, da durch Threads zu langsam und dann evtl die neuen Daten wieder gelöscht werden! if (!useFlattenStep) { matrix.DelateLayer("testpoint_locations_top", false); matrix.DelateLayer("testpoint_locations_bot", false); } if (topSide) { CreateForOneSide(true, step, filter, PackageName, matrix.GetAllDrillLayersForThisLayer(matrix.GetTopSignalLayer())); } else { CreateForOneSide(false, step, filter, PackageName, matrix.GetAllDrillLayersForThisLayer(matrix.GetBotSignalLayer())); } //gitter 500x500 IODBLayer rasterLayer = filter.CreateEmptyODBLayer("raster", step.Name); int shapeIndex = IFilter.AddToolDefinitionRound(rasterLayer, 10); RectangleF boundsStep = step.GetBounds(); int countYLines = (int)(boundsStep.Height / 500) + 1; int countXLines = (int)(boundsStep.Width / 500) + 1; for (int y = 0; y <= countYLines; y++) { for (int x = 0; x <= countXLines; x++) { for (int i = 0; i < 5; i++) //5 sublines { int yVal = y * 500; int xVal = x * 500; if (x < countXLines) { CreateHorLine(filter, rasterLayer, shapeIndex, yVal, xVal + i * 100 + 25); } if (y < countYLines) { CreateVertLine(filter, rasterLayer, shapeIndex, yVal + i * 100 + 25, xVal); } } } } for (int y = 0; y < countYLines; y++) { #region draw text IODBObject textForPad = filter.CreateText(rasterLayer); ITextSpecificsD text = (ITextSpecificsD)textForPad.GetSpecificsD(); text.Text = "Y" + (y + 1); text.TextSize = new SizeF(50, 80); text.Location = new PCBI.MathUtils.PointD(-120, y * 500 + 200); text.WidthFactor = 1; textForPad.SetSpecifics(text); //right side IODBObject textForPad2 = filter.CreateText(rasterLayer); ITextSpecificsD text2 = (ITextSpecificsD)textForPad.GetSpecificsD(); text2.Text = text.Text; text2.TextSize = new SizeF(50, 80); text2.Location = new PCBI.MathUtils.PointD(countXLines * 500 + 120, y * 500 + 200); text2.WidthFactor = 1; textForPad2.SetSpecifics(text2); } for (int x = 0; x < countXLines; x++) { IODBObject textForPad = filter.CreateText(rasterLayer); ITextSpecificsD text = (ITextSpecificsD)textForPad.GetSpecificsD(); text.Text = "X" + (x + 1); text.TextSize = new SizeF(50, 80); text.Location = new PCBI.MathUtils.PointD(x * 500 + 200, -100); text.Rotation = -90; text.WidthFactor = 1; textForPad.SetSpecifics(text); //top side IODBObject textForPad2 = filter.CreateText(rasterLayer); ITextSpecificsD text2 = (ITextSpecificsD)textForPad.GetSpecificsD(); text2.Text = text.Text; text2.TextSize = new SizeF(50, 80); text2.Location = new PCBI.MathUtils.PointD(x * 500 + 300, countYLines * 500 + 100); text2.Rotation = 90; text2.WidthFactor = 1; textForPad2.SetSpecifics(text2); #endregion } foreach (string drillName in matrix.GetAllDrillLayerNames()) { IODBLayer drillLayer = (IODBLayer)step.GetLayer(drillName); foreach (IODBObject drill in drillLayer.GetAllLayerObjects()) { Dictionary <PCBI.FeatureAttributeEnum, string> attribs = drill.GetAttributesDictionary(); if (drill.Type == IObjectType.Pad && attribs.ContainsKey(PCBI.FeatureAttributeEnum.drill) && attribs.ContainsKey(PCBI.FeatureAttributeEnum.geometry)) { if (attribs[PCBI.FeatureAttributeEnum.drill].ToUpperInvariant() == "NON_PLATED" && attribs[PCBI.FeatureAttributeEnum.geometry].ToUpperInvariant() == "ICTAUFNAHME") { IODBObject drillMarker = filter.CreatePad(rasterLayer); IPadSpecificsD drillSpec = (IPadSpecificsD)drill.GetSpecificsD(); int shapeIndexNew = IFilter.AddToolDefinitionRound(rasterLayer, (float)drillSpec.Diameter); drillSpec.ShapeIndex = shapeIndexNew; drillMarker.SetSpecifics(drillSpec); } } } } matrix.UpdateDataAndList(); if (!useFlattenStep) { parent.UIAction.Execute(ID_ActionItem.ID_PRINT_PREVIEW); } }