Exemplo n.º 1
0
 //反向与 OrCAD Capture CIS 交互
 //每次操作完整体数据后需要清空列表
 //To Do Somthing ...
 private void CrossProbe2capture()
 {
     //
     if (listComps2capture.Count != 0)
     {
         //结合ActiveMode ,To Do Something
         Debug.WriteLine("Comps Selected : " + strComps);
         listComps2capture.Clear();
         compsCollection = null;
     }
     if (listNets2capture.Count != 0)
     {
         //结合ActiveMode ,To Do Something
         Debug.WriteLine("Nets Selected : " + strNets);
         listNets2capture.Clear();
         netsCollection = null;
     }
     if (listPins2capture.Count != 0)
     {
         //结合ActiveMode ,To Do Something
         Debug.WriteLine("Pins Selected : " + strPins);
         listPins2capture.Clear();
         netsCollection = null;
     }
     pcbDoc.UnHighlightAll();
     //pcbDoc.UnSelectAll();
 }
Exemplo n.º 2
0
        //反向与OrCAD交互,从 Xpedition ---> Capture
        void OnSelectionChange(EPcbOnSelectionType eType)
        {
            strComps = "";
            strNets  = "";
            strPins  = "";
            //从 OrCAD ---> Xpedition 选定交互的过程中有Slected操作
            //会同时调用该点击事件处理函数,因此必须检测是正向还是反向操作
            //在正向操作时给定值为True,处理完毕后再重新设定回默认反向操作
            if (bFromCapture2xpedition)
            {
                Console.WriteLine("点击原理图时又调用了一次该选定事件!");
                //bFromCapture2xpedition = false;
            }
            else
            {
                if (crossProbeEnable)
                {
                    //*
                    switch (pcbApp.Gui.ActiveMode)
                    {
                    case EPcbMode.epcbModeDrawing:
                        break;

                    case EPcbMode.epcbModeModeless:
                        compsCollection = pcbDoc.get_Components(EPcbSelectionType.epcbSelectSelected, EPcbComponentType.epcbCompGeneral, EPcbCelltype.epcbCelltypePackage, "");
                        netsCollection  = pcbDoc.get_Nets(EPcbSelectionType.epcbSelectSelected, true, "");
                        break;

                    case EPcbMode.epcbModePlace:
                        compsCollection = pcbDoc.get_Components(EPcbSelectionType.epcbSelectSelected, EPcbComponentType.epcbCompGeneral, EPcbCelltype.epcbCelltypePackage, "");
                        break;

                    case EPcbMode.epcbModeRF:
                        break;

                    case EPcbMode.epcbModeRoute:
                        netsCollection = pcbDoc.get_Nets(EPcbSelectionType.epcbSelectSelected, true, "");
                        pinsCollection = pcbDoc.get_Pins(EPcbSelectionType.epcbSelectSelected);
                        break;

                    default:
                        break;
                    }
                    //*/

                    if (compsCollection != null)
                    {
                        foreach (MGCPCB.Component comp in compsCollection)
                        {
                            listComps2capture.Add(comp.RefDes);
                            strComps += comp.RefDes + ",";
                        }
                    }
                    if (netsCollection != null)
                    {
                        foreach (MGCPCB.Net net in netsCollection)
                        {
                            listNets2capture.Add(net.Name);
                            strNets += net.Name + ",";
                        }
                    }
                    if (pinsCollection != null)
                    {
                        foreach (MGCPCB.Pin pin in pinsCollection)
                        {
                            listPins2capture.Add(pin.Component.RefDes + "-" + pin.Name);
                            strPins += pin.Component.RefDes + "-" + pin.Name + ",";
                        }
                    }
                    //以下代码供测试用,左侧调用后,清除集合内容(但是正向操作时选定操作会同时调用此过程?)
                    //同时检测crossProbeEnable选项是否打开,以判断是否对 CaptureCIS 原理图作操作
                    CrossProbe2capture();
                    //bFromCapture2xpedition = true;
                }
                else
                {
                    WriteLog(MsgSvr.Info, "反向操作交互已关闭 !");
                }
            }
        }