Example #1
0
    //Autogenerated code. End of implementation [GetState_FixEmbededResistors]

    //Autogenerated code. Begin of implementation [Command_FixEmbededResistors]
    public void Command_FixEmbededResistors(IServerDocumentView view, ref string parameters)
    {
        new clFixEmbededResistors().FixEmbededResistors();
        DXP.Utils.StatusBarSetStateDefault();
        DXP.Utils.PercentFinish();
        return;
    }
Example #2
0
    //Autogenerated code. End of implementation [GetState_OpenExtFile]

    //Autogenerated code. Begin of implementation [Command_OpenExtFile]
    public void Command_OpenExtFile(IServerDocumentView view, ref string parameters)
    {
        new OpenExtFile().OpenEXTFile(parameters);
        DXP.Utils.StatusBarSetStateDefault();
        DXP.Utils.PercentFinish();
        return;
    }
Example #3
0
    //Autogenerated code. End of implementation [GetState_ToggleLockedObjects]

    //Autogenerated code. Begin of implementation [Command_ToggleLockedObjects]
    public void Command_ToggleLockedObjects(IServerDocumentView view, ref string parameters)
    {
        new ToggleLockedObjects().ToggleProtectLockedObjects();
        DXP.Utils.StatusBarSetStateDefault();
        DXP.Utils.PercentFinish();
        return;
    }
Example #4
0
    //Autogenerated code. End of implementation [GetState_OpenSchematics]

    //Autogenerated code. Begin of implementation [Command_OpenSchematics]
    public void Command_OpenSchematics(IServerDocumentView view, ref string parameters)
    {
        IDXPWorkSpace CurrentWorkspace = DXP.GlobalVars.DXPWorkSpace;
        IDXPProject   CurrentProject;
        int           LogicalDocumentCount;
        int           LoopIterator;
        IDXPDocument  CurrentSheet;

        CurrentProject       = CurrentWorkspace.DM_FocusedProject();
        LogicalDocumentCount = CurrentProject.DM_LogicalDocumentCount();
        ISch_Document SchDoc;
        IClient       Client = DXP.GlobalVars.Client;

        for (LoopIterator = 1; LoopIterator <= LogicalDocumentCount; LoopIterator++)
        {
            CurrentSheet = CurrentProject.DM_LogicalDocuments(LoopIterator - 1);
            if (CurrentSheet.DM_DocumentKind() == "SCH")
            {
                SchDoc = CurrentSheet as ISch_Document;
                //Open document if not already open.
                if (!Client.IsDocumentOpen(CurrentSheet.DM_FullPath()))
                {
                    Client.ShowDocument(Client.OpenDocument("SCH", CurrentSheet.DM_FullPath()));
                }
            }
        }
    }
Example #5
0
    //Autogenerated code. End of implementation [GetState_BatchOutjob]

    //Autogenerated code. Begin of implementation [Command_BatchOutjob]
    public void Command_BatchOutjob(IServerDocumentView view, ref string parameters)
    {
        new BatchOutjob().StartOutjobBatch();
        DXP.Utils.StatusBarSetStateDefault();
        DXP.Utils.PercentFinish();
        return;
    }
Example #6
0
    //Autogenerated code. End of implementation [GetState_ToggleDesignRule]

    //Autogenerated code. Begin of implementation [Command_ToggleDesignRule]
    public void Command_ToggleDesignRule(IServerDocumentView view, ref string parameters)
    {
        new ToggleDesignRules().ToggleDesignRule(parameters);
        DXP.Utils.StatusBarSetStateDefault();
        DXP.Utils.PercentFinish();
        return;
    }
Example #7
0
 public void Command_CleanupSamtecSymbols(IServerDocumentView view, ref string parameters)
 {
     if (CheckKindSchLib(view))
     {
         CleanUpSamtecSymbols();
     }
 }
Example #8
0
    public void Command_GetAllComponents(IServerDocumentView view, ref string parameters)
    {
        ComponentList <string, string> CompList = new ModBom_IO().GetComponents();

        IClient    client    = DXP.GlobalVars.Client;
        IWorkspace workSpace = client.GetDXPWorkspace() as IWorkspace;
        IProject   project   = workSpace.DM_FocusedProject();

        if (project.DM_NeedsCompile())
        {
            project.DM_Compile();
        }

        List <string> designators = new List <string>();

        IDocument document       = project.DM_DocumentFlattened();
        int       componentCount = document.DM_ComponentCount();

        for (int i = 0; i < componentCount; i++)
        {
            IComponent component = document.DM_Components(i);
            designators.Add(component.DM_PhysicalDesignator());
            //component.DM_NexusDeviceId()
        }

        return;
    }
Example #9
0
    //Autogenerated code. End of implementation [Command_Test]

    //Autogenerated code. Begin of implementation [GetState_ToggleDesignRule]
    public void GetState_ToggleDesignRule(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
    {
        ToggleDesignRules clDesignRule = new ToggleDesignRules();

        clDesignRule.RuleName = argParameters;
        argEnabled            = clDesignRule.Enabled;
        argChecked            = clDesignRule.Status;
    }
Example #10
0
    //Autogenerated code. End of implementation [GetState_AdjustGridSnap]

    //Autogenerated code. Begin of implementation [Command_AdjustGridSnap]
    public void Command_AdjustGridSnap(IServerDocumentView view, ref string parameters)
    {
        //To Do : Insert code here
        new SCH_GridChange().GridChange(parameters);
        DXP.Utils.StatusBarSetStateDefault();
        DXP.Utils.PercentFinish();
        return;
    }
Example #11
0
    //Autogenerated code. End of implementation [Command_AssignNet]

    //Autogenerated code. Begin of implementation [GetState_ToggleLoopRemoval]
    public void GetState_ToggleLoopRemoval(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
    {
        IPCB_SystemOptions PCBSystemOptions;

        PCBSystemOptions = PCB.GlobalVars.PCBServer.GetState_SystemOptions();
        if (PCBSystemOptions == null)
        {
            return;
        }

        argChecked = PCBSystemOptions.GetState_LoopRemoval();
    }
Example #12
0
    //Autogenerated code. End of implementation [Command_PIMS]

    //Autogenerated code. Begin of implementation [GetState_CSEnable]
    public void GetState_CSEnable(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
    {
        IOptionsReader optionsReader = DXP.Utils.ServerOptionsReader("WorkspaceManager");

        if (optionsReader.SectionExists("Workspace Preferences\\HighlightMethod"))
        {
            argChecked = optionsReader.ReadBoolean("Workspace Preferences\\HighlightMethod", "CrossSelectMode", false);
        }
        else
        {
            argEnabled = false;
        }
    }
Example #13
0
 private bool CheckKindSchLib(IServerDocumentView ArgView)
 {
     if (ArgView != null)
     {
         IServerDocument OwnerDoucment = ArgView.GetOwnerDocument();
         if (!"SCHLIB".Equals(OwnerDoucment.GetKind(), StringComparison.OrdinalIgnoreCase))
         {
             DXP.Utils.ShowWarning("This is not a schmatic library doucment");
             return(false);
         }
     }
     return(true);
 }
Example #14
0
    //Autogenerated code. End of implementation [GetState_ViaReplace]

    //Autogenerated code. Begin of implementation [Command_ViaReplace]
    public void Command_ViaReplace(IServerDocumentView view, ref string parameters)
    {
        IGUIManager guiManager = DXP.GlobalVars.Client.GetGUIManager();

        if (guiManager == null)
        {
            return;
        }

        if (!guiManager.GetPanelIsOpen(frmViaReplace.PanelName))
        {
            guiManager.SetPanelVisibleInCurrentForm(frmViaReplace.PanelName, true);
        }
    }
Example #15
0
    //Autogenerated code. End of implementation [GetState_ResFinder]

    //Autogenerated code. Begin of implementation [Command_ResFinder]
    public void Command_ResFinder(IServerDocumentView view, ref string parameters)
    {
        IGUIManager guiManager = DXP.GlobalVars.Client.GetGUIManager();

        if (guiManager == null)
        {
            return;
        }

        if (!guiManager.GetPanelIsOpen(frmResFinder.PanelName))
        {
            guiManager.SetPanelVisibleInCurrentForm(frmResFinder.PanelName, true);
        }
        //To Do : Insert code here
    }
Example #16
0
    //Autogenerated code. End of implementation [GetState_VarFootprintSelect]

    //Autogenerated code. Begin of implementation [Command_VarFootprintSelect]
    public void Command_VarFootprintSelect(IServerDocumentView view, ref string parameters)
    {
        IGUIManager guiManager = DXP.GlobalVars.Client.GetGUIManager();

        if (guiManager == null)
        {
            return;
        }

        if (!guiManager.GetPanelIsOpen(FootprintSelect.PanelName))
        {
            guiManager.SetPanelVisibleInCurrentForm(FootprintSelect.PanelName, true);
        }

        //new FootprintSelect().Show();
    }
Example #17
0
    //Autogenerated code. End of implementation [GetState_DoReport]

    //Autogenerated code. Begin of implementation [Command_DoReport]
    public void Command_DoReport(IServerDocumentView view, ref string parameters)
    {
        IGUIManager guiManager = DXP.GlobalVars.Client.GetGUIManager();

        if (guiManager == null)
        {
            return;
        }

        if (!guiManager.GetPanelIsOpen(DoFileGen.PanelName))
        {
            guiManager.SetPanelVisibleInCurrentForm(DoFileGen.PanelName, true);
        }
        DXP.Utils.StatusBarSetStateDefault();
        DXP.Utils.PercentFinish();
        return;
    }
Example #18
0
    //Autogenerated code. End of implementation [GetState_Viagrid]

    //Autogenerated code. Begin of implementation [Command_Viagrid]
    public void Command_Viagrid(IServerDocumentView view, ref string parameters)
    {
        IPCB_ServerInterface pcbServer = PCB.GlobalVars.PCBServer;

        if (pcbServer == null)
        {
            return;
        }

        IPCB_Board pcbBoard = pcbServer.GetCurrentPCBBoard();

        if (pcbBoard == null)
        {
            return;
        }

        DXP.Utils.RunCommand("PCB:DeSelect", "Scope=All");

        var boundingRect = pcbBoard.GetState_BoardOutline().BoundingRectangle();
        var gridSize     = (int)pcbBoard.GetState_ComponentGridSize();
        var delta        = EDP.Utils.MMsToCoord(0.001);

        IPCB_BoardIterator iterator = pcbBoard.BoardIterator_Create();

        iterator.AddFilter_ObjectSet(new PCB.TObjectSet(PCB.TObjectId.eViaObject));
        iterator.AddFilter_LayerSet(PCBConstant.V6AllLayersSet);
        iterator.AddFilter_Area(boundingRect.Left, boundingRect.Bottom, boundingRect.Right, boundingRect.Top);

        IPCB_Primitive pcbObject = iterator.FirstPCBObject();

        while (pcbObject != null)
        {
            if (pcbObject is IPCB_Via via &&
                (via.GetState_XLocation() % gridSize > delta ||
                 via.GetState_XLocation() % gridSize > delta))
            {
                via.SetState_Selected(true);
            }
            pcbObject = iterator.NextPCBObject();
        }

        pcbBoard.BoardIterator_Destroy(ref iterator);

        DXP.Utils.RunCommand("PCB:RunQuery", "Apply=True|Expr=IsSelected|Mask=True|Select=True");
    }
Example #19
0
    //Autogenerated code. End of implementation [GetState_TrackUtil]

    //Autogenerated code. Begin of implementation [Command_TrackUtil]
    public void Command_TrackUtil(IServerDocumentView view, ref string parameters)
    {
        //new Track_Util().TrackUtil(new frmTracks(), Track_Util.PanelName);
        IGUIManager guiManager = DXP.GlobalVars.Client.GetGUIManager();

        if (guiManager == null)
        {
            return;
        }

        if (!guiManager.GetPanelIsOpen(frmTracks.PanelName))
        {
            guiManager.SetPanelVisibleInCurrentForm(frmTracks.PanelName, true);
        }
        DXP.Utils.StatusBarSetStateDefault();
        DXP.Utils.PercentFinish();
        return;
    }
Example #20
0
    //Autogenerated code. End of implementation [GetState_CSPins]

    //Autogenerated code. Begin of implementation [Command_CSPins]
    public void Command_CSPins(IServerDocumentView view, ref string parameters)
    {
        bool CurrentState;

        IOptionsReader optionsReader = DXP.Utils.ServerOptionsReader("WorkspaceManager");
        IOptionsWriter optionsWriter = DXP.Utils.ServerOptionsWriter("WorkspaceManager");

        CurrentState = optionsReader.ReadBoolean("Workspace Preferences\\CrossSelectMode", "CrossSelectPins", false); //Get current preference state.
        optionsWriter.WriteBoolean("Workspace Preferences\\CrossSelectMode", "CrossSelectPins", !CurrentState);       //Invert current preference state.

        //Update changed preferences.
        var schServer = DXP.GlobalVars.Client.GetServerModuleByName("WorkspaceManager");

        if (schServer != null)
        {
            (schServer as IServerOptions).ReloadOptions();
        }
    }
Example #21
0
    //Autogenerated code. End of implementation [Command_RefdesReport]

    //Autogenerated code. Begin of implementation [GetState_DocGrouping]
    public void GetState_DocGrouping(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
    {
        switch (argParameters)
        {
        case "Project":
            argChecked = new GenericOptions().GroupEnabled(TDocumentsBarGrouping.dbgByProject);
            break;

        case "Type":
            argChecked = new GenericOptions().GroupEnabled(TDocumentsBarGrouping.dbgByDocKind);
            break;

        case "Disabled":
            argChecked = new GenericOptions().GroupEnabled(TDocumentsBarGrouping.dbgNone);
            break;

        default:
            break;
        }
    }
Example #22
0
    //Autogenerated code. End of implementation [GetState_DocGrouping]

    //Autogenerated code. Begin of implementation [Command_DocGrouping]
    public void Command_DocGrouping(IServerDocumentView view, ref string parameters)
    {
        switch (parameters)
        {
        case "Project":
            new GenericOptions().ChangeDocGrouping(TDocumentsBarGrouping.dbgByProject);
            break;

        case "Type":
            new GenericOptions().ChangeDocGrouping(TDocumentsBarGrouping.dbgByDocKind);
            break;

        case "Disabled":
            new GenericOptions().ChangeDocGrouping(TDocumentsBarGrouping.dbgNone);
            break;

        default:
            break;
        }
    }
Example #23
0
    //Autogenerated code. End of implementation [GetState_SetActiveLayer]

    //Autogenerated code. Begin of implementation [Command_SetActiveLayer]
    public void Command_SetActiveLayer(IServerDocumentView view, ref string parameters)
    {
        IPCB_Primitive obj   = null;
        IPCB_Board     board = Util.GetCurrentPCB();

        try
        {
            //If a object is already selected, Use it. If not, then get the object under the cursor.
            if (board.GetState_SelectecObjectCount() != 1)
            {
                obj = (IPCB_Primitive)board.GetObjectAtXYAskUserIfAmbiguous(board.GetState_XCursor(), board.GetState_YCursor(), Util.PCBAllObject, PCBConstant.V6AllLayersSet, TEditingAction.eEditAction_Focus);
            }
            if (obj == null)
            {
                obj = (IPCB_Primitive)board.GetLastClickedObject(Util.PCBAllObject, TEditingAction.eEditAction_Select);
            }
            else
            {
                obj = (IPCB_Primitive)board.GetState_SelectecObject(0);
            }

            if (obj == null)
            {
                return;
            }
            //Set the active layer to that of the selected object layer. Doesnt update the selected layer tab.
            board.SetState_CurrentLayerV7(obj.GetState_V7Layer());

            //Switch to the next layer and back so that the propper layer tab is selected.
            DXP.Utils.RunCommand("PCB:SetCurrentLayer", "LayerName = Next");
            DXP.Utils.RunCommand("PCB:SetCurrentLayer", "LayerName = Previous");

            //Switch to single layer mode.
            //DXP.Utils.RunCommand("PCB:SetupPreferences", "SingleLayerMode=ON");
        }
        catch (Exception ex)
        {
            ErrorMail.LogError("Error in " + System.Reflection.MethodBase.GetCurrentMethod().Name + ".", ex);
        }
    }
Example #24
0
    //Autogenerated code. End of implementation [GetState_ShowHideRefDes]

    //Autogenerated code. Begin of implementation [Command_ShowHideRefDes]
    public void Command_ShowHideRefDes(IServerDocumentView view, ref string parameters)
    {
        bool Show      = false;
        bool Discretes = false;

        switch (parameters)
        {
        case "showAll":
            Show = true;
            break;

        case "hideAll":
            Show = false;
            break;

        case "showDiscrete":
            Show      = true;
            Discretes = true;
            break;

        case "hideDiscrete":
            Show      = false;
            Discretes = true;
            break;

        default:
            DXP.Utils.ShowError("Wrong parameter given. Use 'showAll', 'hideAll', 'showDiscrete' or 'hideDiscrete'.");
            DXP.Utils.StatusBarSetStateDefault();
            DXP.Utils.PercentFinish();
            return;
        }
        new ShowHideRefDes().ShowHide(Util.GetCurrentPCB(), Show, Discretes);
        DXP.Utils.StatusBarSetStateDefault();
        DXP.Utils.PercentFinish();
        return;
    }
Example #25
0
 public void Command_CountPinsOfSymbol(IServerDocumentView view, ref string parameters)
 {
     CountPinsOfSymbol();
 }
Example #26
0
 public void Command_CleanupSamtecFootprints(IServerDocumentView view, ref string parameters)
 {
     CleanUpSamtecFootprints();
 }
Example #27
0
 public void Command_RemoveSymbolVaultLink(IServerDocumentView view, ref string parameters)
 {
     RemoveSymbolVaultLink();
 }
Example #28
0
 public void Command_AddCenterMark(IServerDocumentView view, ref string parameters)
 {
     AddCenterMark();
 }
Example #29
0
 public void Command_AddCourtyard(IServerDocumentView view, ref string parameters)
 {
     AddCourtyard();
 }
Example #30
0
 public void Command_CountFootprintPrimitives(IServerDocumentView view, ref string parameters)
 {
     CountPrimitivesOfFootprint();
 }