zoukankan      html  css  js  c++  java
  • 替代件操作

    1、添加替代件的方法

      TCComponentBomLine.add(null, substituteItemRev, null, true);

    2、移除替代件

    public void removelAllSubstitutes(TCComponentBOMLine bomLine) throws TCException{
    		TCComponentItemRevision itemRev = bomLine.getItemRevision();
    		TCComponent[] tccomps3 = itemRev.whereUsed(TCComponentItemRevision.WHERE_USED_ALL);
    		for(TCComponent tcCom : tccomps3){
    			TCComponentItemRevision itemRevIndex = (TCComponentItemRevision) tcCom;
    			TCComponentBOMLine parentBomLine = BOMUtil.getInstance().createWindow().setWindowTopLine(null, itemRevIndex, null, null);
    			AIFComponentContext[] contexts = parentBomLine.getChildren();
    			if(contexts != null && contexts.length > 0){
    				for(AIFComponentContext context : contexts){
    					InterfaceAIFComponent interfaceAIFComIndex = context.getComponent();
    					if(interfaceAIFComIndex instanceof TCComponentBOMLine){
    						TCComponentBOMLine bomLineIndex = (TCComponentBOMLine) interfaceAIFComIndex;
    						if(itemRev == bomLineIndex.getItemRevision()){
    							bomLine = bomLineIndex;
    						}
    					}
    				}
    			}
    		}
    		TCComponentBOMLine[] bomLineSubstitutes = bomLine.listSubstitutes();
    		if(bomLineSubstitutes != null && bomLineSubstitutes.length > 0){
    			for(TCComponentBOMLine bomLineIndex : bomLineSubstitutes){
    				try
    		        {
    		          RelatedSubstituteComp[] arrayOfRelatedSubstituteComp1 = bomLineIndex.getRelatedSubstitutes();
    		          if ((arrayOfRelatedSubstituteComp1 != null) && (arrayOfRelatedSubstituteComp1.length > 0))
    		          {
    		            StringBuilder localStringBuilder = new StringBuilder();
    		            RelatedSubstituteComp[] arrayOfRelatedSubstituteComp2;
    		            int m = (arrayOfRelatedSubstituteComp2 = arrayOfRelatedSubstituteComp1).length;
    		            for (int k = 0; k < m; k++)
    		            {
    		              RelatedSubstituteComp localRelatedSubstituteComp = arrayOfRelatedSubstituteComp2[k];
    		              localStringBuilder.append(localRelatedSubstituteComp.toDisplayString());
    		              localStringBuilder.append("
    ");
    		            }
    		            if (true)
    		            {
    		              removeRelatedSubstitute(bomLineIndex);
    		              bomLineIndex.cut();
    		            }
    		          }
    		          else
    		          {
    		        	  bomLineIndex.cut();
    		          }
    		        }
    		        catch (TCException e)
    		        {
    		          e.printStackTrace();
    		          return;
    		        }
    			}
    		}
    	}
    

      

  • 相关阅读:
    浅涉OPC Client
    枚举目标机器已注册的OPC服务器
    C++ DCOM服务器和C#客户端互操作完全解释
    COMException:没有注册类别(REGDB_E_CLASSNOTREG)
    网络化广播主机ZABKZ/AXT8182
    OPC 技术文档之 IOPCBrowseServerAddressSpace 的使用
    SQL Server 2008 r2 服务无法启动
    Infinova V2040 系列 大型矩阵切换/控制系统
    COM中GUID和UUID、CLSID、IID
    django 视图与网址
  • 原文地址:https://www.cnblogs.com/wwssgg/p/15213930.html
Copyright © 2011-2022 走看看